diff --git a/generated/.openapi-generator/FILES b/generated/.openapi-generator/FILES index 118b1583..e97074f3 100644 --- a/generated/.openapi-generator/FILES +++ b/generated/.openapi-generator/FILES @@ -48,8 +48,11 @@ docs/RuleRequest.md docs/SnoozeTimeUnitEnum.md docs/SourceEnum.md docs/StatusEnum.md +docs/TextRecognitionResult.md docs/UserApi.md docs/VerbEnum.md +docs/WebhookAction.md +docs/WebhookActionRequest.md git_push.sh groundlight_openapi_client/__init__.py groundlight_openapi_client/api/__init__.py @@ -107,7 +110,10 @@ groundlight_openapi_client/model/rule_request.py groundlight_openapi_client/model/snooze_time_unit_enum.py groundlight_openapi_client/model/source_enum.py groundlight_openapi_client/model/status_enum.py +groundlight_openapi_client/model/text_recognition_result.py groundlight_openapi_client/model/verb_enum.py +groundlight_openapi_client/model/webhook_action.py +groundlight_openapi_client/model/webhook_action_request.py groundlight_openapi_client/model_utils.py groundlight_openapi_client/models/__init__.py groundlight_openapi_client/rest.py @@ -116,4 +122,7 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_text_recognition_result.py +test/test_webhook_action.py +test/test_webhook_action_request.py tox.ini diff --git a/generated/README.md b/generated/README.md index bd5fe9eb..881ceeaa 100644 --- a/generated/README.md +++ b/generated/README.md @@ -90,6 +90,12 @@ rule_request = RuleRequest( }, ), action=None, + webhook_action=[ + WebhookActionRequest( + url="url_example", + include_image=True, + ), + ], ) # RuleRequest | try: @@ -171,7 +177,10 @@ Class | Method | HTTP request | Description - [SnoozeTimeUnitEnum](docs/SnoozeTimeUnitEnum.md) - [SourceEnum](docs/SourceEnum.md) - [StatusEnum](docs/StatusEnum.md) + - [TextRecognitionResult](docs/TextRecognitionResult.md) - [VerbEnum](docs/VerbEnum.md) + - [WebhookAction](docs/WebhookAction.md) + - [WebhookActionRequest](docs/WebhookActionRequest.md) ## Documentation For Authorization diff --git a/generated/docs/ActionsApi.md b/generated/docs/ActionsApi.md index f1d5b017..62acb205 100644 --- a/generated/docs/ActionsApi.md +++ b/generated/docs/ActionsApi.md @@ -65,6 +65,12 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: }, ), action=None, + webhook_action=[ + WebhookActionRequest( + url="url_example", + include_image=True, + ), + ], ) # RuleRequest | # example passing only required values which don't have defaults set @@ -296,6 +302,8 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = actions_api.ActionsApi(api_client) detector_id = "detector_id_example" # str | + page = 1 # int | A page number within the paginated result set. (optional) + page_size = 1 # int | Number of results to return per page. (optional) # example passing only required values which don't have defaults set try: @@ -303,6 +311,14 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: pprint(api_response) except groundlight_openapi_client.ApiException as e: print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.list_detector_rules(detector_id, page=page, page_size=page_size) + pprint(api_response) + except groundlight_openapi_client.ApiException as e: + print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e) ``` @@ -311,6 +327,8 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **detector_id** | **str**| | + **page** | **int**| A page number within the paginated result set. | [optional] + **page_size** | **int**| Number of results to return per page. | [optional] ### Return type diff --git a/generated/docs/BinaryClassificationResult.md b/generated/docs/BinaryClassificationResult.md index f8dc4656..40cf272e 100644 --- a/generated/docs/BinaryClassificationResult.md +++ b/generated/docs/BinaryClassificationResult.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | **str** | | -**confidence** | **float** | | [optional] +**confidence** | **float, none_type** | | [optional] **source** | **str** | | [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 c58845d8..3af68072 100644 --- a/generated/docs/CountingResult.md +++ b/generated/docs/CountingResult.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **count** | **int, none_type** | | -**confidence** | **float** | | [optional] +**confidence** | **float, none_type** | | [optional] **source** | **str** | | [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/DetectorCreationInputRequest.md b/generated/docs/DetectorCreationInputRequest.md index afd25ab5..fe683f5d 100644 --- a/generated/docs/DetectorCreationInputRequest.md +++ b/generated/docs/DetectorCreationInputRequest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0 **pipeline_config** | **str, none_type** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional] **metadata** | **str** | Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding. | [optional] -**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS | [optional] +**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT | [optional] **mode_configuration** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [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/ImageQueriesApi.md b/generated/docs/ImageQueriesApi.md index 3d405374..e3f91416 100644 --- a/generated/docs/ImageQueriesApi.md +++ b/generated/docs/ImageQueriesApi.md @@ -201,14 +201,14 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY' with groundlight_openapi_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = image_queries_api.ImageQueriesApi(api_client) + detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional) page = 1 # int | A page number within the paginated result set. (optional) page_size = 1 # int | Number of items to return per page. (optional) - detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.list_image_queries(page=page, page_size=page_size, detector_id=detector_id) + api_response = api_instance.list_image_queries(detector_id=detector_id, page=page, page_size=page_size) pprint(api_response) except groundlight_openapi_client.ApiException as e: print("Exception when calling ImageQueriesApi->list_image_queries: %s\n" % e) @@ -219,9 +219,9 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **detector_id** | **str**| Optionally filter image queries by detector ID. | [optional] **page** | **int**| A page number within the paginated result set. | [optional] **page_size** | **int**| Number of items to return per page. | [optional] - **detector_id** | **str**| Optionally filter image queries by detector ID. | [optional] ### Return type diff --git a/generated/docs/ModeEnum.md b/generated/docs/ModeEnum.md index 178498d0..c14a5aca 100644 --- a/generated/docs/ModeEnum.md +++ b/generated/docs/ModeEnum.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", ] +**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] [[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 4f401a3d..5bd3cfc4 100644 --- a/generated/docs/MultiClassificationResult.md +++ b/generated/docs/MultiClassificationResult.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | **str** | | -**confidence** | **float** | | [optional] +**confidence** | **float, none_type** | | [optional] **source** | **str** | | [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/Note.md b/generated/docs/Note.md index baaad6ad..a5e80378 100644 --- a/generated/docs/Note.md +++ b/generated/docs/Note.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **detector_id** | **str** | | [readonly] -**content** | **str** | Text content of the note. | +**content** | **str, none_type** | Text content of the note. | [optional] +**is_pinned** | **bool, none_type** | | [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] [[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/NoteRequest.md b/generated/docs/NoteRequest.md index 4410b952..783cb431 100644 --- a/generated/docs/NoteRequest.md +++ b/generated/docs/NoteRequest.md @@ -4,7 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | **str** | Text content of the note. | +**content** | **str, none_type** | Text content of the note. | [optional] +**is_pinned** | **bool, none_type** | | [optional] **image** | **file_type, none_type** | | [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/NotesApi.md b/generated/docs/NotesApi.md index 877f4f8b..f4e20739 100644 --- a/generated/docs/NotesApi.md +++ b/generated/docs/NotesApi.md @@ -9,11 +9,11 @@ Method | HTTP request | Description # **create_note** -> create_note(detector_id, note_request) +> create_note(detector_id) -Create a new note +Creates a new note. ### Example @@ -49,12 +49,20 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: detector_id = "detector_id_example" # str | the detector to associate the new note with note_request = NoteRequest( content="content_example", + is_pinned=True, image=open('/path/to/file', 'rb'), - ) # NoteRequest | + ) # NoteRequest | (optional) # example passing only required values which don't have defaults set try: - api_instance.create_note(detector_id, note_request) + api_instance.create_note(detector_id) + except groundlight_openapi_client.ApiException as e: + print("Exception when calling NotesApi->create_note: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_instance.create_note(detector_id, note_request=note_request) except groundlight_openapi_client.ApiException as e: print("Exception when calling NotesApi->create_note: %s\n" % e) ``` @@ -65,7 +73,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **detector_id** | **str**| the detector to associate the new note with | - **note_request** | [**NoteRequest**](NoteRequest.md)| | + **note_request** | [**NoteRequest**](NoteRequest.md)| | [optional] ### Return type @@ -94,7 +102,7 @@ void (empty response body) -Get all the notes from a given detector and return the answer in lists, one for each note_category +Retrieves all notes from a given detector and returns them in lists, one for each note_category. ### Example diff --git a/generated/docs/ResultTypeEnum.md b/generated/docs/ResultTypeEnum.md index 352f7694..0f03cf6c 100644 --- a/generated/docs/ResultTypeEnum.md +++ b/generated/docs/ResultTypeEnum.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", ] +**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] [[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/Rule.md b/generated/docs/Rule.md index b1cff625..a3f0c9d5 100644 --- a/generated/docs/Rule.md +++ b/generated/docs/Rule.md @@ -9,12 +9,13 @@ Name | Type | Description | Notes **detector_name** | **str** | | [readonly] **name** | **str** | | **condition** | [**Condition**](Condition.md) | | -**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **enabled** | **bool** | | [optional] if omitted the server will use the default value of True **snooze_time_enabled** | **bool** | | [optional] if omitted the server will use the default value of False **snooze_time_value** | **int** | | [optional] if omitted the server will use the default value of 0 **snooze_time_unit** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] **human_review_required** | **bool** | | [optional] if omitted the server will use the default value of False +**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**webhook_action** | [**[WebhookAction]**](WebhookAction.md) | | [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] [[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/RuleRequest.md b/generated/docs/RuleRequest.md index fa8b463b..9e5b3294 100644 --- a/generated/docs/RuleRequest.md +++ b/generated/docs/RuleRequest.md @@ -6,12 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | **condition** | [**ConditionRequest**](ConditionRequest.md) | | -**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **enabled** | **bool** | | [optional] if omitted the server will use the default value of True **snooze_time_enabled** | **bool** | | [optional] if omitted the server will use the default value of False **snooze_time_value** | **int** | | [optional] if omitted the server will use the default value of 0 **snooze_time_unit** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] **human_review_required** | **bool** | | [optional] if omitted the server will use the default value of False +**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**webhook_action** | [**[WebhookActionRequest]**](WebhookActionRequest.md) | | [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] [[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 new file mode 100644 index 00000000..d50b80df --- /dev/null +++ b/generated/docs/TextRecognitionResult.md @@ -0,0 +1,15 @@ +# TextRecognitionResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **str** | | +**truncated** | **bool** | | +**confidence** | **float, none_type** | | [optional] +**source** | **str** | | [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] + +[[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/WebhookAction.md b/generated/docs/WebhookAction.md new file mode 100644 index 00000000..639f1f7a --- /dev/null +++ b/generated/docs/WebhookAction.md @@ -0,0 +1,13 @@ +# WebhookAction + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | +**include_image** | **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] + +[[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/WebhookActionRequest.md b/generated/docs/WebhookActionRequest.md new file mode 100644 index 00000000..411d192d --- /dev/null +++ b/generated/docs/WebhookActionRequest.md @@ -0,0 +1,13 @@ +# WebhookActionRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | +**include_image** | **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] + +[[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/api/actions_api.py b/generated/groundlight_openapi_client/api/actions_api.py index 47ac8d0d..4f9d42f5 100644 --- a/generated/groundlight_openapi_client/api/actions_api.py +++ b/generated/groundlight_openapi_client/api/actions_api.py @@ -173,6 +173,8 @@ def __init__(self, api_client=None): params_map={ "all": [ "detector_id", + "page", + "page_size", ], "required": [ "detector_id", @@ -186,12 +188,18 @@ def __init__(self, api_client=None): "allowed_values": {}, "openapi_types": { "detector_id": (str,), + "page": (int,), + "page_size": (int,), }, "attribute_map": { "detector_id": "detector_id", + "page": "page", + "page_size": "page_size", }, "location_map": { "detector_id": "path", + "page": "query", + "page_size": "query", }, "collection_format_map": {}, }, @@ -434,6 +442,8 @@ def list_detector_rules(self, detector_id, **kwargs): detector_id (str): Keyword Args: + page (int): A page number within the paginated result set.. [optional] + page_size (int): Number of results to return per page.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object diff --git a/generated/groundlight_openapi_client/api/image_queries_api.py b/generated/groundlight_openapi_client/api/image_queries_api.py index 906bb202..03ad2600 100644 --- a/generated/groundlight_openapi_client/api/image_queries_api.py +++ b/generated/groundlight_openapi_client/api/image_queries_api.py @@ -127,9 +127,9 @@ def __init__(self, api_client=None): }, params_map={ "all": [ + "detector_id", "page", "page_size", - "detector_id", ], "required": [], "nullable": [], @@ -140,19 +140,19 @@ def __init__(self, api_client=None): "validations": {}, "allowed_values": {}, "openapi_types": { + "detector_id": (str,), "page": (int,), "page_size": (int,), - "detector_id": (str,), }, "attribute_map": { + "detector_id": "detector_id", "page": "page", "page_size": "page_size", - "detector_id": "detector_id", }, "location_map": { + "detector_id": "query", "page": "query", "page_size": "query", - "detector_id": "query", }, "collection_format_map": {}, }, @@ -377,9 +377,9 @@ def list_image_queries(self, **kwargs): Keyword Args: + detector_id (str): Optionally filter image queries by detector ID.. [optional] page (int): A page number within the paginated result set.. [optional] page_size (int): Number of items to return per page.. [optional] - detector_id (str): Optionally filter image queries by detector ID.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object diff --git a/generated/groundlight_openapi_client/api/notes_api.py b/generated/groundlight_openapi_client/api/notes_api.py index f6522e04..f1af2cb5 100644 --- a/generated/groundlight_openapi_client/api/notes_api.py +++ b/generated/groundlight_openapi_client/api/notes_api.py @@ -52,7 +52,6 @@ def __init__(self, api_client=None): ], "required": [ "detector_id", - "note_request", ], "nullable": [], "enum": [], @@ -121,21 +120,21 @@ def __init__(self, api_client=None): api_client=api_client, ) - def create_note(self, detector_id, note_request, **kwargs): + def create_note(self, detector_id, **kwargs): """create_note # noqa: E501 - Create a new note # noqa: E501 + Creates a new note. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_note(detector_id, note_request, async_req=True) + >>> thread = api.create_note(detector_id, async_req=True) >>> result = thread.get() Args: detector_id (str): the detector to associate the new note with - note_request (NoteRequest): Keyword Args: + note_request (NoteRequest): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -178,13 +177,12 @@ def create_note(self, detector_id, note_request, **kwargs): kwargs["_content_type"] = kwargs.get("_content_type") kwargs["_host_index"] = kwargs.get("_host_index") kwargs["detector_id"] = detector_id - kwargs["note_request"] = note_request return self.create_note_endpoint.call_with_http_info(**kwargs) def get_notes(self, detector_id, **kwargs): """get_notes # noqa: E501 - Get all the notes from a given detector and return the answer in lists, one for each note_category # noqa: E501 + Retrieves all notes from a given detector and returns them in lists, one for each note_category. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/generated/groundlight_openapi_client/model/binary_classification_result.py b/generated/groundlight_openapi_client/model/binary_classification_result.py index b9cd17eb..d4f5ebc4 100644 --- a/generated/groundlight_openapi_client/model/binary_classification_result.py +++ b/generated/groundlight_openapi_client/model/binary_classification_result.py @@ -107,7 +107,10 @@ def openapi_types(): """ return { "label": (str,), # noqa: E501 - "confidence": (float,), # noqa: E501 + "confidence": ( + float, + none_type, + ), # noqa: E501 "source": (str,), # noqa: E501 } @@ -164,7 +167,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - confidence (float): [optional] # noqa: E501 + confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 """ @@ -254,7 +257,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - confidence (float): [optional] # noqa: E501 + confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/counting_result.py b/generated/groundlight_openapi_client/model/counting_result.py index a81b49f5..953a1acf 100644 --- a/generated/groundlight_openapi_client/model/counting_result.py +++ b/generated/groundlight_openapi_client/model/counting_result.py @@ -108,7 +108,10 @@ def openapi_types(): int, none_type, ), # noqa: E501 - "confidence": (float,), # noqa: E501 + "confidence": ( + float, + none_type, + ), # noqa: E501 "source": (str,), # noqa: E501 "greater_than_max": (bool,), # noqa: E501 } @@ -167,7 +170,7 @@ def _from_openapi_data(cls, count, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - confidence (float): [optional] # noqa: E501 + confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ @@ -258,7 +261,7 @@ def __init__(self, count, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - confidence (float): [optional] # noqa: E501 + confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/detector_creation_input_request.py b/generated/groundlight_openapi_client/model/detector_creation_input_request.py index 42ea7e7e..8ac281c7 100644 --- a/generated/groundlight_openapi_client/model/detector_creation_input_request.py +++ b/generated/groundlight_openapi_client/model/detector_creation_input_request.py @@ -227,7 +227,7 @@ def _from_openapi_data(cls, name, query, *args, **kwargs): # noqa: E501 patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501 pipeline_config (str, none_type): (Advanced usage) Configuration needed to instantiate a prediction pipeline.. [optional] # noqa: E501 metadata (str): Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding.. [optional] # noqa: E501 - mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS. [optional] # noqa: E501 + mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT. [optional] # noqa: E501 mode_configuration (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 """ @@ -324,7 +324,7 @@ def __init__(self, name, query, *args, **kwargs): # noqa: E501 patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501 pipeline_config (str, none_type): (Advanced usage) Configuration needed to instantiate a prediction pipeline.. [optional] # noqa: E501 metadata (str): Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding.. [optional] # noqa: E501 - mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS. [optional] # noqa: E501 + mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT. [optional] # noqa: E501 mode_configuration (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/image_query.py b/generated/groundlight_openapi_client/model/image_query.py index 951ee454..fda15e77 100644 --- a/generated/groundlight_openapi_client/model/image_query.py +++ b/generated/groundlight_openapi_client/model/image_query.py @@ -36,6 +36,7 @@ def lazy_import(): from groundlight_openapi_client.model.multi_classification_result import MultiClassificationResult from groundlight_openapi_client.model.result_type_enum import ResultTypeEnum from groundlight_openapi_client.model.roi import ROI + from groundlight_openapi_client.model.text_recognition_result import TextRecognitionResult globals()["BinaryClassificationResult"] = BinaryClassificationResult globals()["CountingResult"] = CountingResult @@ -43,6 +44,7 @@ def lazy_import(): globals()["MultiClassificationResult"] = MultiClassificationResult globals()["ROI"] = ROI globals()["ResultTypeEnum"] = ResultTypeEnum + globals()["TextRecognitionResult"] = TextRecognitionResult class ImageQuery(ModelNormal): diff --git a/generated/groundlight_openapi_client/model/mode_enum.py b/generated/groundlight_openapi_client/model/mode_enum.py index 34987371..a947ba8c 100644 --- a/generated/groundlight_openapi_client/model/mode_enum.py +++ b/generated/groundlight_openapi_client/model/mode_enum.py @@ -54,6 +54,7 @@ class ModeEnum(ModelSimple): "BINARY": "BINARY", "COUNT": "COUNT", "MULTI_CLASS": "MULTI_CLASS", + "TEXT": "TEXT", }, } @@ -103,10 +104,10 @@ def __init__(self, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", ] # noqa: E501 + args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", ] # noqa: E501 + value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # 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. @@ -195,10 +196,10 @@ def _from_openapi_data(cls, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", ] # noqa: E501 + args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", ] # noqa: E501 + value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # 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. diff --git a/generated/groundlight_openapi_client/model/multi_classification_result.py b/generated/groundlight_openapi_client/model/multi_classification_result.py index e3e99760..177574a7 100644 --- a/generated/groundlight_openapi_client/model/multi_classification_result.py +++ b/generated/groundlight_openapi_client/model/multi_classification_result.py @@ -102,7 +102,10 @@ def openapi_types(): """ return { "label": (str,), # noqa: E501 - "confidence": (float,), # noqa: E501 + "confidence": ( + float, + none_type, + ), # noqa: E501 "source": (str,), # noqa: E501 } @@ -159,7 +162,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - confidence (float): [optional] # noqa: E501 + confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 """ @@ -249,7 +252,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - confidence (float): [optional] # noqa: E501 + confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/note.py b/generated/groundlight_openapi_client/model/note.py index 91b565c4..64f139a7 100644 --- a/generated/groundlight_openapi_client/model/note.py +++ b/generated/groundlight_openapi_client/model/note.py @@ -89,7 +89,14 @@ def openapi_types(): """ return { "detector_id": (str,), # noqa: E501 - "content": (str,), # noqa: E501 + "content": ( + str, + none_type, + ), # noqa: E501 + "is_pinned": ( + bool, + none_type, + ), # noqa: E501 } @cached_property @@ -99,6 +106,7 @@ def discriminator(): attribute_map = { "detector_id": "detector_id", # noqa: E501 "content": "content", # noqa: E501 + "is_pinned": "is_pinned", # noqa: E501 } read_only_vars = { @@ -109,12 +117,11 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, detector_id, content, *args, **kwargs): # noqa: E501 + def _from_openapi_data(cls, detector_id, *args, **kwargs): # noqa: E501 """Note - a model defined in OpenAPI Args: detector_id (str): - content (str): Text content of the note. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -147,6 +154,8 @@ def _from_openapi_data(cls, detector_id, content, *args, **kwargs): # noqa: E50 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + content (str, none_type): Text content of the note.. [optional] # noqa: E501 + is_pinned (bool, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -176,7 +185,6 @@ def _from_openapi_data(cls, detector_id, content, *args, **kwargs): # noqa: E50 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.detector_id = detector_id - self.content = content for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -199,11 +207,9 @@ def _from_openapi_data(cls, detector_id, content, *args, **kwargs): # noqa: E50 ]) @convert_js_args_to_python_args - def __init__(self, content, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Note - a model defined in OpenAPI - content (str): Text content of the note. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -235,6 +241,8 @@ def __init__(self, content, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + content (str, none_type): Text content of the note.. [optional] # noqa: E501 + is_pinned (bool, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -261,7 +269,6 @@ def __init__(self, content, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.content = content for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/generated/groundlight_openapi_client/model/note_request.py b/generated/groundlight_openapi_client/model/note_request.py index 09e4fe5d..95889010 100644 --- a/generated/groundlight_openapi_client/model/note_request.py +++ b/generated/groundlight_openapi_client/model/note_request.py @@ -55,11 +55,7 @@ class NoteRequest(ModelNormal): allowed_values = {} - validations = { - ("content",): { - "min_length": 1, - }, - } + validations = {} @cached_property def additional_properties_type(): @@ -92,7 +88,14 @@ def openapi_types(): and the value is attribute type. """ return { - "content": (str,), # noqa: E501 + "content": ( + str, + none_type, + ), # noqa: E501 + "is_pinned": ( + bool, + none_type, + ), # noqa: E501 "image": ( file_type, none_type, @@ -105,6 +108,7 @@ def discriminator(): attribute_map = { "content": "content", # noqa: E501 + "is_pinned": "is_pinned", # noqa: E501 "image": "image", # noqa: E501 } @@ -114,12 +118,9 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, content, *args, **kwargs): # noqa: E501 + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 """NoteRequest - a model defined in OpenAPI - Args: - content (str): Text content of the note. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -151,6 +152,8 @@ def _from_openapi_data(cls, content, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + content (str, none_type): Text content of the note.. [optional] # noqa: E501 + is_pinned (bool, none_type): [optional] # noqa: E501 image (file_type, none_type): [optional] # noqa: E501 """ @@ -180,7 +183,6 @@ def _from_openapi_data(cls, content, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.content = content for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -203,12 +205,9 @@ def _from_openapi_data(cls, content, *args, **kwargs): # noqa: E501 ]) @convert_js_args_to_python_args - def __init__(self, content, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """NoteRequest - a model defined in OpenAPI - Args: - content (str): Text content of the note. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -240,6 +239,8 @@ def __init__(self, content, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + content (str, none_type): Text content of the note.. [optional] # noqa: E501 + is_pinned (bool, none_type): [optional] # noqa: E501 image (file_type, none_type): [optional] # noqa: E501 """ @@ -267,7 +268,6 @@ def __init__(self, content, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.content = content for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/generated/groundlight_openapi_client/model/result_type_enum.py b/generated/groundlight_openapi_client/model/result_type_enum.py index 187c5861..4fff6840 100644 --- a/generated/groundlight_openapi_client/model/result_type_enum.py +++ b/generated/groundlight_openapi_client/model/result_type_enum.py @@ -54,6 +54,7 @@ class ResultTypeEnum(ModelSimple): "BINARY_CLASSIFICATION": "binary_classification", "COUNTING": "counting", "MULTI_CLASSIFICATION": "multi_classification", + "TEXT_RECOGNITION": "text_recognition", }, } @@ -103,10 +104,10 @@ def __init__(self, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", ] # noqa: E501 + args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["binary_classification", "counting", "multi_classification", ] # noqa: E501 + value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # 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. @@ -195,10 +196,10 @@ def _from_openapi_data(cls, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", ] # noqa: E501 + args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["binary_classification", "counting", "multi_classification", ] # noqa: E501 + value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # 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. diff --git a/generated/groundlight_openapi_client/model/rule.py b/generated/groundlight_openapi_client/model/rule.py index 78760fca..7f1be14a 100644 --- a/generated/groundlight_openapi_client/model/rule.py +++ b/generated/groundlight_openapi_client/model/rule.py @@ -34,11 +34,13 @@ def lazy_import(): from groundlight_openapi_client.model.action_list import ActionList from groundlight_openapi_client.model.condition import Condition from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum + from groundlight_openapi_client.model.webhook_action import WebhookAction globals()["Action"] = Action globals()["ActionList"] = ActionList globals()["Condition"] = Condition globals()["SnoozeTimeUnitEnum"] = SnoozeTimeUnitEnum + globals()["WebhookAction"] = WebhookAction class Rule(ModelNormal): @@ -114,7 +116,10 @@ def openapi_types(): "detector_name": (str,), # noqa: E501 "name": (str,), # noqa: E501 "condition": (Condition,), # noqa: E501 - "action": ( + "enabled": (bool,), # noqa: E501 + "snooze_time_enabled": (bool,), # noqa: E501 + "snooze_time_value": (int,), # noqa: E501 + "snooze_time_unit": ( bool, date, datetime, @@ -125,10 +130,8 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "enabled": (bool,), # noqa: E501 - "snooze_time_enabled": (bool,), # noqa: E501 - "snooze_time_value": (int,), # noqa: E501 - "snooze_time_unit": ( + "human_review_required": (bool,), # noqa: E501 + "action": ( bool, date, datetime, @@ -139,7 +142,7 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "human_review_required": (bool,), # noqa: E501 + "webhook_action": ([WebhookAction],), # noqa: E501 } @cached_property @@ -152,12 +155,13 @@ def discriminator(): "detector_name": "detector_name", # noqa: E501 "name": "name", # noqa: E501 "condition": "condition", # noqa: E501 - "action": "action", # noqa: E501 "enabled": "enabled", # noqa: E501 "snooze_time_enabled": "snooze_time_enabled", # noqa: E501 "snooze_time_value": "snooze_time_value", # noqa: E501 "snooze_time_unit": "snooze_time_unit", # noqa: E501 "human_review_required": "human_review_required", # noqa: E501 + "action": "action", # noqa: E501 + "webhook_action": "webhook_action", # noqa: E501 } read_only_vars = { @@ -170,7 +174,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, action, *args, **kwargs): # noqa: E501 + def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, *args, **kwargs): # noqa: E501 """Rule - a model defined in OpenAPI Args: @@ -179,7 +183,6 @@ def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, act detector_name (str): name (str): condition (Condition): - action (bool, date, datetime, dict, float, int, list, str, none_type): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -217,6 +220,8 @@ def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, act snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + webhook_action ([WebhookAction]): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -250,7 +255,6 @@ def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, act self.detector_name = detector_name self.name = name self.condition = condition - self.action = action for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -273,12 +277,11 @@ def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, act ]) @convert_js_args_to_python_args - def __init__(self, name, condition, action, *args, **kwargs): # noqa: E501 + def __init__(self, name, condition, *args, **kwargs): # noqa: E501 """Rule - a model defined in OpenAPI name (str): condition (Condition): - action (bool, date, datetime, dict, float, int, list, str, none_type): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -316,6 +319,8 @@ def __init__(self, name, condition, action, *args, **kwargs): # noqa: E501 snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + webhook_action ([WebhookAction]): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -344,7 +349,6 @@ def __init__(self, name, condition, action, *args, **kwargs): # noqa: E501 self.name = name self.condition = condition - self.action = action for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/generated/groundlight_openapi_client/model/rule_request.py b/generated/groundlight_openapi_client/model/rule_request.py index 0cb5934f..8fdf8fe1 100644 --- a/generated/groundlight_openapi_client/model/rule_request.py +++ b/generated/groundlight_openapi_client/model/rule_request.py @@ -34,11 +34,13 @@ def lazy_import(): from groundlight_openapi_client.model.action_list import ActionList from groundlight_openapi_client.model.condition_request import ConditionRequest from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum + from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest globals()["Action"] = Action globals()["ActionList"] = ActionList globals()["ConditionRequest"] = ConditionRequest globals()["SnoozeTimeUnitEnum"] = SnoozeTimeUnitEnum + globals()["WebhookActionRequest"] = WebhookActionRequest class RuleRequest(ModelNormal): @@ -112,7 +114,10 @@ def openapi_types(): return { "name": (str,), # noqa: E501 "condition": (ConditionRequest,), # noqa: E501 - "action": ( + "enabled": (bool,), # noqa: E501 + "snooze_time_enabled": (bool,), # noqa: E501 + "snooze_time_value": (int,), # noqa: E501 + "snooze_time_unit": ( bool, date, datetime, @@ -123,10 +128,8 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "enabled": (bool,), # noqa: E501 - "snooze_time_enabled": (bool,), # noqa: E501 - "snooze_time_value": (int,), # noqa: E501 - "snooze_time_unit": ( + "human_review_required": (bool,), # noqa: E501 + "action": ( bool, date, datetime, @@ -137,7 +140,7 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "human_review_required": (bool,), # noqa: E501 + "webhook_action": ([WebhookActionRequest],), # noqa: E501 } @cached_property @@ -147,12 +150,13 @@ def discriminator(): attribute_map = { "name": "name", # noqa: E501 "condition": "condition", # noqa: E501 - "action": "action", # noqa: E501 "enabled": "enabled", # noqa: E501 "snooze_time_enabled": "snooze_time_enabled", # noqa: E501 "snooze_time_value": "snooze_time_value", # noqa: E501 "snooze_time_unit": "snooze_time_unit", # noqa: E501 "human_review_required": "human_review_required", # noqa: E501 + "action": "action", # noqa: E501 + "webhook_action": "webhook_action", # noqa: E501 } read_only_vars = {} @@ -161,13 +165,12 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, name, condition, action, *args, **kwargs): # noqa: E501 + def _from_openapi_data(cls, name, condition, *args, **kwargs): # noqa: E501 """RuleRequest - a model defined in OpenAPI Args: name (str): condition (ConditionRequest): - action (bool, date, datetime, dict, float, int, list, str, none_type): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -205,6 +208,8 @@ def _from_openapi_data(cls, name, condition, action, *args, **kwargs): # noqa: snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + webhook_action ([WebhookActionRequest]): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -235,7 +240,6 @@ def _from_openapi_data(cls, name, condition, action, *args, **kwargs): # noqa: self.name = name self.condition = condition - self.action = action for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -258,13 +262,12 @@ def _from_openapi_data(cls, name, condition, action, *args, **kwargs): # noqa: ]) @convert_js_args_to_python_args - def __init__(self, name, condition, action, *args, **kwargs): # noqa: E501 + def __init__(self, name, condition, *args, **kwargs): # noqa: E501 """RuleRequest - a model defined in OpenAPI Args: name (str): condition (ConditionRequest): - action (bool, date, datetime, dict, float, int, list, str, none_type): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -302,6 +305,8 @@ def __init__(self, name, condition, action, *args, **kwargs): # noqa: E501 snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + webhook_action ([WebhookActionRequest]): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -330,7 +335,6 @@ def __init__(self, name, condition, action, *args, **kwargs): # noqa: E501 self.name = name self.condition = condition - self.action = action for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/generated/groundlight_openapi_client/model/text_recognition_result.py b/generated/groundlight_openapi_client/model/text_recognition_result.py new file mode 100644 index 00000000..ca44ff65 --- /dev/null +++ b/generated/groundlight_openapi_client/model/text_recognition_result.py @@ -0,0 +1,304 @@ +""" + 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 TextRecognitionResult(ModelNormal): + """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. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + 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 = { + ("source",): { + "STILL_PROCESSING": "STILL_PROCESSING", + "CLOUD": "CLOUD", + "USER": "USER", + "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", + "ALGORITHM": "ALGORITHM", + }, + } + + validations = { + ("confidence",): { + "inclusive_maximum": 1.0, + "inclusive_minimum": 0.0, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _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 { + "text": (str,), # noqa: E501 + "truncated": (bool,), # noqa: E501 + "confidence": ( + float, + none_type, + ), # noqa: E501 + "source": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "text": "text", # noqa: E501 + "truncated": "truncated", # noqa: E501 + "confidence": "confidence", # noqa: E501 + "source": "source", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text, truncated, *args, **kwargs): # noqa: E501 + """TextRecognitionResult - a model defined in OpenAPI + + Args: + text (str): + truncated (bool): + + Keyword Args: + _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,) + confidence (float, none_type): [optional] # noqa: E501 + source (str): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + 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.text = text + self.truncated = truncated + 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 + ): + # 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", + ]) + + @convert_js_args_to_python_args + def __init__(self, text, truncated, *args, **kwargs): # noqa: E501 + """TextRecognitionResult - a model defined in OpenAPI + + Args: + text (str): + truncated (bool): + + Keyword Args: + _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,) + confidence (float, none_type): [optional] # noqa: E501 + source (str): [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", ()) + + 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.text = text + self.truncated = truncated + 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 + ): + # 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 " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/webhook_action.py b/generated/groundlight_openapi_client/model/webhook_action.py new file mode 100644 index 00000000..826b3312 --- /dev/null +++ b/generated/groundlight_openapi_client/model/webhook_action.py @@ -0,0 +1,282 @@ +""" + 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 WebhookAction(ModelNormal): + """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. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + 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 = {} + + validations = { + ("url",): { + "max_length": 200, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _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 { + "url": (str,), # noqa: E501 + "include_image": (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "url": "url", # noqa: E501 + "include_image": "include_image", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501 + """WebhookAction - a model defined in OpenAPI + + Args: + url (str): + + Keyword Args: + _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,) + include_image (bool): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + 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.url = url + 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 + ): + # 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", + ]) + + @convert_js_args_to_python_args + def __init__(self, url, *args, **kwargs): # noqa: E501 + """WebhookAction - a model defined in OpenAPI + + Args: + url (str): + + Keyword Args: + _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,) + include_image (bool): [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", ()) + + 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.url = url + 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 + ): + # 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 " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/webhook_action_request.py b/generated/groundlight_openapi_client/model/webhook_action_request.py new file mode 100644 index 00000000..9990e3e0 --- /dev/null +++ b/generated/groundlight_openapi_client/model/webhook_action_request.py @@ -0,0 +1,283 @@ +""" + 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 WebhookActionRequest(ModelNormal): + """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. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + 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 = {} + + validations = { + ("url",): { + "max_length": 200, + "min_length": 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _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 { + "url": (str,), # noqa: E501 + "include_image": (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "url": "url", # noqa: E501 + "include_image": "include_image", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501 + """WebhookActionRequest - a model defined in OpenAPI + + Args: + url (str): + + Keyword Args: + _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,) + include_image (bool): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + 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.url = url + 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 + ): + # 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", + ]) + + @convert_js_args_to_python_args + def __init__(self, url, *args, **kwargs): # noqa: E501 + """WebhookActionRequest - a model defined in OpenAPI + + Args: + url (str): + + Keyword Args: + _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,) + include_image (bool): [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", ()) + + 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.url = url + 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 + ): + # 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 " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/models/__init__.py b/generated/groundlight_openapi_client/models/__init__.py index ce6f3cb0..a81ec9af 100644 --- a/generated/groundlight_openapi_client/models/__init__.py +++ b/generated/groundlight_openapi_client/models/__init__.py @@ -50,4 +50,7 @@ from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum from groundlight_openapi_client.model.source_enum import SourceEnum from groundlight_openapi_client.model.status_enum import StatusEnum +from groundlight_openapi_client.model.text_recognition_result import TextRecognitionResult from groundlight_openapi_client.model.verb_enum import VerbEnum +from groundlight_openapi_client.model.webhook_action import WebhookAction +from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest diff --git a/generated/model.py b/generated/model.py index aac94f27..60f81dcd 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2024-12-19T17:53:53+00:00 +# timestamp: 2025-01-17T23:47:47+00:00 from __future__ import annotations @@ -80,15 +80,18 @@ class ModeEnum(str, Enum): BINARY = "BINARY" COUNT = "COUNT" MULTI_CLASS = "MULTI_CLASS" + TEXT = "TEXT" class Note(BaseModel): detector_id: str - content: str = Field(..., description="Text content of the note.") + content: Optional[str] = Field(None, description="Text content of the note.") + is_pinned: Optional[bool] = None class NoteRequest(BaseModel): - content: constr(min_length=1) = Field(..., description="Text content of the note.") + content: Optional[str] = Field(None, description="Text content of the note.") + is_pinned: Optional[bool] = None image: Optional[bytes] = None @@ -115,6 +118,7 @@ class ResultTypeEnum(str, Enum): binary_classification = "binary_classification" counting = "counting" multi_classification = "multi_classification" + text_recognition = "text_recognition" class SnoozeTimeUnitEnum(str, Enum): @@ -177,6 +181,16 @@ class VerbEnum(str, Enum): NO_QUERIES = "NO_QUERIES" +class WebhookAction(BaseModel): + url: AnyUrl + include_image: Optional[bool] = None + + +class WebhookActionRequest(BaseModel): + url: AnyUrl + include_image: Optional[bool] = None + + class Source(str, Enum): STILL_PROCESSING = "STILL_PROCESSING" CLOUD = "CLOUD" @@ -210,6 +224,13 @@ class MultiClassificationResult(BaseModel): label: str +class TextRecognitionResult(BaseModel): + confidence: Optional[confloat(ge=0.0, le=1.0)] = None + source: Optional[Source] = None + text: str + truncated: bool + + class CountModeConfiguration(BaseModel): max_count: Optional[conint(ge=1, le=50)] = None class_name: str @@ -220,6 +241,10 @@ class MultiClassModeConfiguration(BaseModel): num_classes: Optional[int] = None +class TextModeConfiguration(BaseModel): + pass + + class ChannelEnum(str, Enum): TEXT = "TEXT" EMAIL = "EMAIL" @@ -321,10 +346,12 @@ class DetectorCreationInputRequest(BaseModel): "BINARY", description=( "Mode in which this detector will work.\n\n* `BINARY` - BINARY\n* `COUNT` - COUNT\n* `MULTI_CLASS` -" - " MULTI_CLASS" + " MULTI_CLASS\n* `TEXT` - TEXT" ), ) - mode_configuration: Optional[Union[CountModeConfiguration, MultiClassModeConfiguration]] = None + mode_configuration: Optional[Union[CountModeConfiguration, MultiClassModeConfiguration, TextModeConfiguration]] = ( + None + ) class ImageQuery(BaseModel): @@ -339,7 +366,9 @@ class ImageQuery(BaseModel): query: str = Field(..., description="A question about the image.") detector_id: str = Field(..., description="Which detector was used on this image query?") result_type: ResultTypeEnum = Field(..., description="What type of result are we returning?") - result: Optional[Union[BinaryClassificationResult, CountingResult, MultiClassificationResult]] = Field(...) + result: Optional[ + Union[BinaryClassificationResult, CountingResult, MultiClassificationResult, TextRecognitionResult] + ] = Field(...) patience_time: float = Field(..., description="How long to wait for a confident response.") confidence_threshold: float = Field( ..., description="Min confidence needed to accept the response of the image query." @@ -421,7 +450,8 @@ class Rule(BaseModel): snooze_time_unit: SnoozeTimeUnitEnum = "DAYS" human_review_required: bool = False condition: Condition - action: Union[Action, ActionList] + action: Optional[Union[Action, ActionList]] = None + webhook_action: Optional[List[WebhookAction]] = None class RuleRequest(BaseModel): @@ -432,7 +462,8 @@ class RuleRequest(BaseModel): snooze_time_unit: SnoozeTimeUnitEnum = "DAYS" human_review_required: bool = False condition: ConditionRequest - action: Union[Action, ActionList] + action: Optional[Union[Action, ActionList]] = None + webhook_action: Optional[List[WebhookActionRequest]] = None class PaginatedRuleList(BaseModel): diff --git a/generated/test/test_text_recognition_result.py b/generated/test/test_text_recognition_result.py new file mode 100644 index 00000000..3bec7f1b --- /dev/null +++ b/generated/test/test_text_recognition_result.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.text_recognition_result import TextRecognitionResult + + +class TestTextRecognitionResult(unittest.TestCase): + """TextRecognitionResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTextRecognitionResult(self): + """Test TextRecognitionResult""" + # FIXME: construct object with mandatory attributes with example values + # model = TextRecognitionResult() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_webhook_action.py b/generated/test/test_webhook_action.py new file mode 100644 index 00000000..84fbe32c --- /dev/null +++ b/generated/test/test_webhook_action.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.webhook_action import WebhookAction + + +class TestWebhookAction(unittest.TestCase): + """WebhookAction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhookAction(self): + """Test WebhookAction""" + # FIXME: construct object with mandatory attributes with example values + # model = WebhookAction() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_webhook_action_request.py b/generated/test/test_webhook_action_request.py new file mode 100644 index 00000000..e846f353 --- /dev/null +++ b/generated/test/test_webhook_action_request.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.webhook_action_request import WebhookActionRequest + + +class TestWebhookActionRequest(unittest.TestCase): + """WebhookActionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhookActionRequest(self): + """Test WebhookActionRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = WebhookActionRequest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/pyproject.toml b/pyproject.toml index a93534cf..39f82da0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ packages = [ {include = "**/*.py", from = "src"}, ] readme = "README.md" -version = "0.21.3" +version = "0.22.0" [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 930dc555..81b66670 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -19,6 +19,18 @@ paths: schema: type: string required: true + - name: page + required: false + in: query + description: A page number within the paginated result set. + schema: + type: integer + - name: page_size + required: false + in: query + description: Number of results to return per page. + schema: + type: integer tags: - actions security: @@ -313,6 +325,11 @@ paths: operationId: List image queries description: Retrieve a list of image-queries. parameters: + - in: query + name: detector_id + schema: + type: string + description: Optionally filter image queries by detector ID. - in: query name: page schema: @@ -323,11 +340,6 @@ paths: schema: type: integer description: Number of items to return per page. - - in: query - name: detector_id - schema: - type: string - description: Optionally filter image queries by detector ID. tags: - image-queries security: @@ -540,8 +552,8 @@ paths: /v1/notes: get: operationId: get notes - description: Get all the notes from a given detector and return the answer in - lists, one for each note_category + description: Retrieves all notes from a given detector and returns them in lists, + one for each note_category. parameters: - in: query name: detector_id @@ -562,7 +574,7 @@ paths: description: '' post: operationId: Create note - description: Create a new note + description: Creates a new note. parameters: - in: query name: detector_id @@ -583,7 +595,6 @@ paths: multipart/form-data: schema: $ref: '#/components/schemas/NoteRequest' - required: true security: - ApiToken: [] responses: @@ -833,10 +844,12 @@ components: * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS + * `TEXT` - TEXT mode_configuration: oneOf: - $ref: '#/components/schemas/CountModeConfiguration' - $ref: '#/components/schemas/MultiClassModeConfiguration' + - $ref: '#/components/schemas/TextModeConfiguration' nullable: true required: - name @@ -917,6 +930,7 @@ components: - $ref: '#/components/schemas/BinaryClassificationResult' - $ref: '#/components/schemas/CountingResult' - $ref: '#/components/schemas/MultiClassificationResult' + - $ref: '#/components/schemas/TextRecognitionResult' nullable: true patience_time: type: number @@ -1037,6 +1051,7 @@ components: - BINARY - COUNT - MULTI_CLASS + - TEXT type: string Note: type: object @@ -1046,24 +1061,28 @@ components: readOnly: true content: type: string + nullable: true description: Text content of the note. + is_pinned: + type: boolean + nullable: true required: - - content - detector_id NoteRequest: type: object properties: content: type: string - minLength: 1 + nullable: true description: Text content of the note. + is_pinned: + type: boolean + nullable: true image: type: string format: binary writeOnly: true nullable: true - required: - - content PaginatedDetectorList: type: object required: @@ -1206,6 +1225,7 @@ components: - binary_classification - counting - multi_classification + - text_recognition type: string Rule: type: object @@ -1245,8 +1265,11 @@ components: oneOf: - $ref: '#/components/schemas/Action' - $ref: '#/components/schemas/ActionList' + webhook_action: + type: array + items: + $ref: '#/components/schemas/WebhookAction' required: - - action - condition - detector_id - detector_name @@ -1282,8 +1305,11 @@ components: oneOf: - $ref: '#/components/schemas/Action' - $ref: '#/components/schemas/ActionList' + webhook_action: + type: array + items: + $ref: '#/components/schemas/WebhookActionRequest' required: - - action - condition - name SnoozeTimeUnitEnum: @@ -1338,6 +1364,29 @@ components: * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES + WebhookAction: + type: object + properties: + url: + type: string + format: uri + maxLength: 200 + include_image: + type: boolean + required: + - url + WebhookActionRequest: + type: object + properties: + url: + type: string + format: uri + minLength: 1 + maxLength: 200 + include_image: + type: boolean + required: + - url BinaryClassificationResult: type: object properties: @@ -1346,6 +1395,7 @@ components: format: float minimum: 0.0 maximum: 1.0 + nullable: true source: type: string enum: @@ -1370,6 +1420,7 @@ components: format: float minimum: 0.0 maximum: 1.0 + nullable: true source: type: string enum: @@ -1394,6 +1445,7 @@ components: format: float minimum: 0.0 maximum: 1.0 + nullable: true source: type: string enum: @@ -1406,6 +1458,30 @@ components: type: string required: - label + TextRecognitionResult: + type: object + properties: + confidence: + type: number + format: float + minimum: 0.0 + maximum: 1.0 + nullable: true + source: + type: string + enum: + - STILL_PROCESSING + - CLOUD + - USER + - CLOUD_ENSEMBLE + - ALGORITHM + text: + type: string + truncated: + type: boolean + required: + - text + - truncated CountModeConfiguration: type: object properties: @@ -1413,6 +1489,7 @@ components: type: integer minimum: 1 maximum: 50 + nullable: false class_name: type: string required: @@ -1426,8 +1503,11 @@ components: type: string num_classes: type: integer + nullable: false required: - class_names + TextModeConfiguration: + type: object ChannelEnum: type: string enum: @@ -1463,4 +1543,4 @@ servers: - url: https://device.positronix.ai/device-api description: Device Prod - url: https://device.integ.positronix.ai/device-api - description: Device Integ + description: Device Integ \ No newline at end of file diff --git a/src/groundlight/experimental_api.py b/src/groundlight/experimental_api.py index bc9649b2..17f80d49 100644 --- a/src/groundlight/experimental_api.py +++ b/src/groundlight/experimental_api.py @@ -27,6 +27,7 @@ from groundlight_openapi_client.model.rule_request import RuleRequest from groundlight_openapi_client.model.status_enum import StatusEnum from groundlight_openapi_client.model.verb_enum import VerbEnum +from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest from model import ( ROI, Action, @@ -38,6 +39,7 @@ ModeEnum, PaginatedRuleList, Rule, + WebhookAction, ) from groundlight.images import parse_supported_image_types @@ -46,7 +48,7 @@ from .client import DEFAULT_REQUEST_TIMEOUT, Groundlight, logger -class ExperimentalApi(Groundlight): +class ExperimentalApi(Groundlight): # pylint: disable=too-many-public-methods def __init__( self, endpoint: Union[str, None] = None, @@ -156,12 +158,29 @@ def make_action( include_image=include_image, ) - def create_alert( # pylint: disable=too-many-locals # noqa: PLR0913 + def make_webhook_action(self, url: str, include_image: bool) -> WebhookAction: + """ + Creates a WebhookAction object for use in creating alerts + This function serves as a convenience method; WebhookAction objects can also be created directly. + **Example usage**:: + gl = ExperimentalApi() + # Create a webhook action for an alert + action = gl.make_webhook_action("https://example.com/webhook", include_image=True) + :param url: The URL to send the webhook to + :param include_image: Whether to include the triggering image in the webhook payload + """ + return WebhookAction( + url=str(url), + include_image=include_image, + ) + + def create_alert( # pylint: disable=too-many-locals, too-many-arguments # noqa: PLR0913 self, detector: Union[str, Detector], name, condition: Condition, - actions: Union[Action, List[Action], ActionList], + actions: Optional[Union[Action, List[Action], ActionList]] = None, + webhook_actions: Optional[Union[WebhookAction, List[WebhookAction]]] = None, *, enabled: bool = True, snooze_time_enabled: bool = False, @@ -206,6 +225,10 @@ def create_alert( # pylint: disable=too-many-locals # noqa: PLR0913 :param detector: The detector ID or Detector object to add the alert to :param name: A unique name to identify this alert + :param condition: The condition to use for the alert + :param actions: The actions to use for the alert. Optional if webhook_actions are provided (default None) + :param webhook_actions: The webhook actions to use for the alert. Optional if actions are provided (default + None) :param enabled: Whether the alert should be active when created (default True) :param snooze_time_enabled: Enable notification snoozing to prevent alert spam (default False) :param snooze_time_value: Duration of snooze period (default 3600) @@ -220,13 +243,30 @@ def create_alert( # pylint: disable=too-many-locals # noqa: PLR0913 actions = actions.root if isinstance(detector, Detector): detector = detector.id + if isinstance(webhook_actions, WebhookAction): + webhook_actions = [webhook_actions] # translate pydantic type to the openapi type - actions = [ - ActionRequest( - channel=ChannelEnum(action.channel), recipient=action.recipient, include_image=action.include_image - ) - for action in actions - ] + actions = ( + [ + ActionRequest( + channel=ChannelEnum(action.channel), recipient=action.recipient, include_image=action.include_image + ) + for action in actions + ] + if actions + else [] + ) + webhook_actions = ( + [ + WebhookActionRequest( + url=str(webhook_action.url), + include_image=webhook_action.include_image, + ) + for webhook_action in webhook_actions + ] + if webhook_actions + else [] + ) rule_input = RuleRequest( detector_id=detector, name=name, @@ -237,6 +277,7 @@ def create_alert( # pylint: disable=too-many-locals # noqa: PLR0913 snooze_time_value=snooze_time_value, snooze_time_unit=snooze_time_unit, human_review_required=human_review_required, + webhook_action=webhook_actions, ) return Rule.model_validate(self.actions_api.create_rule(detector, rule_input).to_dict()) @@ -257,6 +298,8 @@ def create_rule( # pylint: disable=too-many-locals # noqa: PLR0913 human_review_required: bool = False, ) -> Rule: """ + DEPRECATED: Use create_alert instead. + Creates a notification rule for a detector that will send alerts based on specified conditions. A notification rule allows you to configure automated alerts when certain conditions are met, diff --git a/test/unit/test_actions.py b/test/unit/test_actions.py index a437acc6..65055c51 100644 --- a/test/unit/test_actions.py +++ b/test/unit/test_actions.py @@ -68,3 +68,44 @@ def test_create_alert_multiple_actions(gl_experimental: ExperimentalApi): actions, ) assert len(alert.action.root) == len(actions) + + +def test_create_alert_webhook_action(gl_experimental: ExperimentalApi): + name = f"Test {datetime.utcnow()}" + det = gl_experimental.get_or_create_detector(name, "test_query") + condition = gl_experimental.make_condition("ANSWERED_CONSECUTIVELY", {"num_consecutive_labels": 1, "label": "YES"}) + webhook_url = "https://hooks.slack.com/services/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" + webhook_action = gl_experimental.make_webhook_action(webhook_url, include_image=False) + alert = gl_experimental.create_alert( + det, + f"test_alert_{name}", + condition, + webhook_actions=webhook_action, + ) + assert len(alert.webhook_action) == 1 + assert len(alert.action.root) == 0 + + +def test_create_alert_multiple_webhook_actions(gl_experimental: ExperimentalApi): + name = f"Test {datetime.utcnow()}" + det = gl_experimental.get_or_create_detector(name, "test_query") + condition = gl_experimental.make_condition("CHANGED_TO", {"label": "YES"}) + webhook_action_1 = gl_experimental.make_webhook_action("https://groundlight.ai", include_image=True) + webhook_action_2 = gl_experimental.make_webhook_action("https://example.com/webhook", include_image=False) + webhook_actions = [webhook_action_1, webhook_action_2] + alert = gl_experimental.create_alert(det, f"test_alert_{name}", condition, webhook_actions=webhook_actions) + assert len(alert.webhook_action) == len(webhook_actions) + assert len(alert.action.root) == 0 + + +def test_create_alert_webhook_action_and_other_action(gl_experimental: ExperimentalApi): + name = f"Test {datetime.utcnow()}" + det = gl_experimental.get_or_create_detector(name, "test_query") + condition = gl_experimental.make_condition("CHANGED_TO", {"label": "YES"}) + webhook_action = gl_experimental.make_webhook_action("https://groundlight.ai", include_image=True) + email_action = gl_experimental.make_action("EMAIL", "test@groundlight.ai", False) + alert = gl_experimental.create_alert( + det, f"test_alert_{name}", condition, webhook_actions=webhook_action, actions=email_action + ) + assert len(alert.webhook_action) == 1 + assert len(alert.action.root) == 1