From 2a7bcb49f226d647351c577f27cacf078dc6b94a Mon Sep 17 00:00:00 2001 From: brandon Date: Mon, 3 Jun 2024 10:06:11 -0700 Subject: [PATCH] updating operation ids one more time --- generated/README.md | 8 +- generated/docs/ActionsApi.md | 46 +-- .../api/actions_api.py | 86 ++--- .../groundlight_openapi_client/api_client.py | 6 +- .../model/classification_result.py | 283 ---------------- .../model/paginated_all_notes_list.py | 305 ------------------ .../model/paginated_note_list.py | 305 ------------------ generated/model.py | 2 +- spec/public-api.yaml | 4 +- 9 files changed, 76 insertions(+), 969 deletions(-) delete mode 100644 generated/groundlight_openapi_client/model/classification_result.py delete mode 100644 generated/groundlight_openapi_client/model/paginated_all_notes_list.py delete mode 100644 generated/groundlight_openapi_client/model/paginated_note_list.py diff --git a/generated/README.md b/generated/README.md index 58b3391e..d5a3c167 100644 --- a/generated/README.md +++ b/generated/README.md @@ -97,10 +97,10 @@ rule_request = RuleRequest( ) # RuleRequest | try: - api_response = api_instance.create_detector_rule(detector_id, rule_request) + api_response = api_instance.create_rule(detector_id, rule_request) pprint(api_response) except groundlight_openapi_client.ApiException as e: - print("Exception when calling ActionsApi->create_detector_rule: %s\n" % e) + print("Exception when calling ActionsApi->create_rule: %s\n" % e) ``` ## Documentation for API Endpoints @@ -109,11 +109,11 @@ All URIs are relative to *https://api.groundlight.ai/device-api* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ActionsApi* | [**create_detector_rule**](docs/ActionsApi.md#create_detector_rule) | **POST** /v1/actions/detector/{detector_id}/rules | +*ActionsApi* | [**create_rule**](docs/ActionsApi.md#create_rule) | **POST** /v1/actions/detector/{detector_id}/rules | *ActionsApi* | [**delete_rule**](docs/ActionsApi.md#delete_rule) | **DELETE** /v1/actions/rules/{id} | *ActionsApi* | [**get_rule**](docs/ActionsApi.md#get_rule) | **GET** /v1/actions/rules/{id} | -*ActionsApi* | [**list_all_rules**](docs/ActionsApi.md#list_all_rules) | **GET** /v1/actions/rules | *ActionsApi* | [**list_detector_rules**](docs/ActionsApi.md#list_detector_rules) | **GET** /v1/actions/detector/{detector_id}/rules | +*ActionsApi* | [**list_rules**](docs/ActionsApi.md#list_rules) | **GET** /v1/actions/rules | *DetectorsApi* | [**create_detector**](docs/DetectorsApi.md#create_detector) | **POST** /v1/detectors | *DetectorsApi* | [**delete_detector**](docs/DetectorsApi.md#delete_detector) | **DELETE** /v1/detectors/{id} | *DetectorsApi* | [**get_detector**](docs/DetectorsApi.md#get_detector) | **GET** /v1/detectors/{id} | diff --git a/generated/docs/ActionsApi.md b/generated/docs/ActionsApi.md index 788f9621..24045150 100644 --- a/generated/docs/ActionsApi.md +++ b/generated/docs/ActionsApi.md @@ -4,15 +4,15 @@ All URIs are relative to *https://api.groundlight.ai/device-api* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_detector_rule**](ActionsApi.md#create_detector_rule) | **POST** /v1/actions/detector/{detector_id}/rules | +[**create_rule**](ActionsApi.md#create_rule) | **POST** /v1/actions/detector/{detector_id}/rules | [**delete_rule**](ActionsApi.md#delete_rule) | **DELETE** /v1/actions/rules/{id} | [**get_rule**](ActionsApi.md#get_rule) | **GET** /v1/actions/rules/{id} | -[**list_all_rules**](ActionsApi.md#list_all_rules) | **GET** /v1/actions/rules | [**list_detector_rules**](ActionsApi.md#list_detector_rules) | **GET** /v1/actions/detector/{detector_id}/rules | +[**list_rules**](ActionsApi.md#list_rules) | **GET** /v1/actions/rules | -# **create_detector_rule** -> Rule create_detector_rule(detector_id, rule_request) +# **create_rule** +> Rule create_rule(detector_id, rule_request) @@ -73,10 +73,10 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set try: - api_response = api_instance.create_detector_rule(detector_id, rule_request) + api_response = api_instance.create_rule(detector_id, rule_request) pprint(api_response) except groundlight_openapi_client.ApiException as e: - print("Exception when calling ActionsApi->create_detector_rule: %s\n" % e) + print("Exception when calling ActionsApi->create_rule: %s\n" % e) ``` @@ -261,12 +261,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_all_rules** -> PaginatedRuleList list_all_rules() +# **list_detector_rules** +> PaginatedRuleList list_detector_rules(detector_id) -Lists all rules over all detectors owned by the requester. +List all rules for a detector ### Example @@ -299,16 +299,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 = actions_api.ActionsApi(api_client) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) + detector_id = "detector_id_example" # str | # example passing only required values which don't have defaults set - # and optional values try: - api_response = api_instance.list_all_rules(page=page, page_size=page_size) + api_response = api_instance.list_detector_rules(detector_id) pprint(api_response) except groundlight_openapi_client.ApiException as e: - print("Exception when calling ActionsApi->list_all_rules: %s\n" % e) + print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e) ``` @@ -316,8 +314,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] + **detector_id** | **str**| | ### Return type @@ -341,12 +338,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_detector_rules** -> PaginatedRuleList list_detector_rules(detector_id) +# **list_rules** +> PaginatedRuleList list_rules() -List all rules for a detector +Lists all rules over all detectors owned by the requester. ### Example @@ -379,14 +376,16 @@ 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 = 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 + # and optional values try: - api_response = api_instance.list_detector_rules(detector_id) + api_response = api_instance.list_rules(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) + print("Exception when calling ActionsApi->list_rules: %s\n" % e) ``` @@ -394,7 +393,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/groundlight_openapi_client/api/actions_api.py b/generated/groundlight_openapi_client/api/actions_api.py index 1f3e5bb1..9920219d 100644 --- a/generated/groundlight_openapi_client/api/actions_api.py +++ b/generated/groundlight_openapi_client/api/actions_api.py @@ -38,12 +38,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.create_detector_rule_endpoint = _Endpoint( + self.create_rule_endpoint = _Endpoint( settings={ "response_type": (Rule,), "auth": ["ApiToken"], "endpoint_path": "/v1/actions/detector/{detector_id}/rules", - "operation_id": "create_detector_rule", + "operation_id": "create_rule", "http_method": "POST", "servers": None, }, @@ -162,21 +162,22 @@ def __init__(self, api_client=None): }, api_client=api_client, ) - self.list_all_rules_endpoint = _Endpoint( + self.list_detector_rules_endpoint = _Endpoint( settings={ "response_type": (PaginatedRuleList,), "auth": ["ApiToken"], - "endpoint_path": "/v1/actions/rules", - "operation_id": "list_all_rules", + "endpoint_path": "/v1/actions/detector/{detector_id}/rules", + "operation_id": "list_detector_rules", "http_method": "GET", "servers": None, }, params_map={ "all": [ - "page", - "page_size", + "detector_id", + ], + "required": [ + "detector_id", ], - "required": [], "nullable": [], "enum": [], "validation": [], @@ -185,16 +186,13 @@ def __init__(self, api_client=None): "validations": {}, "allowed_values": {}, "openapi_types": { - "page": (int,), - "page_size": (int,), + "detector_id": (str,), }, "attribute_map": { - "page": "page", - "page_size": "page_size", + "detector_id": "detector_id", }, "location_map": { - "page": "query", - "page_size": "query", + "detector_id": "path", }, "collection_format_map": {}, }, @@ -204,22 +202,21 @@ def __init__(self, api_client=None): }, api_client=api_client, ) - self.list_detector_rules_endpoint = _Endpoint( + self.list_rules_endpoint = _Endpoint( settings={ "response_type": (PaginatedRuleList,), "auth": ["ApiToken"], - "endpoint_path": "/v1/actions/detector/{detector_id}/rules", - "operation_id": "list_detector_rules", + "endpoint_path": "/v1/actions/rules", + "operation_id": "list_rules", "http_method": "GET", "servers": None, }, params_map={ "all": [ - "detector_id", - ], - "required": [ - "detector_id", + "page", + "page_size", ], + "required": [], "nullable": [], "enum": [], "validation": [], @@ -228,13 +225,16 @@ def __init__(self, api_client=None): "validations": {}, "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": {}, }, @@ -245,14 +245,14 @@ def __init__(self, api_client=None): api_client=api_client, ) - def create_detector_rule(self, detector_id, rule_request, **kwargs): - """create_detector_rule # noqa: E501 + def create_rule(self, detector_id, rule_request, **kwargs): + """create_rule # noqa: E501 Create a new rule for a detector # 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_detector_rule(detector_id, rule_request, async_req=True) + >>> thread = api.create_rule(detector_id, rule_request, async_req=True) >>> result = thread.get() Args: @@ -303,7 +303,7 @@ def create_detector_rule(self, detector_id, rule_request, **kwargs): kwargs["_host_index"] = kwargs.get("_host_index") kwargs["detector_id"] = detector_id kwargs["rule_request"] = rule_request - return self.create_detector_rule_endpoint.call_with_http_info(**kwargs) + return self.create_rule_endpoint.call_with_http_info(**kwargs) def delete_rule(self, id, **kwargs): """delete_rule # noqa: E501 @@ -421,20 +421,20 @@ def get_rule(self, id, **kwargs): kwargs["id"] = id return self.get_rule_endpoint.call_with_http_info(**kwargs) - def list_all_rules(self, **kwargs): - """list_all_rules # noqa: E501 + def list_detector_rules(self, detector_id, **kwargs): + """list_detector_rules # noqa: E501 - Lists all rules over all detectors owned by the requester. # noqa: E501 + List all rules for a detector # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_all_rules(async_req=True) + >>> thread = api.list_detector_rules(detector_id, async_req=True) >>> result = thread.get() + Args: + 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 @@ -476,22 +476,23 @@ def list_all_rules(self, **kwargs): kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) kwargs["_content_type"] = kwargs.get("_content_type") kwargs["_host_index"] = kwargs.get("_host_index") - return self.list_all_rules_endpoint.call_with_http_info(**kwargs) + kwargs["detector_id"] = detector_id + return self.list_detector_rules_endpoint.call_with_http_info(**kwargs) - def list_detector_rules(self, detector_id, **kwargs): - """list_detector_rules # noqa: E501 + def list_rules(self, **kwargs): + """list_rules # noqa: E501 - List all rules for a detector # noqa: E501 + Lists all rules over all detectors owned by the requester. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_detector_rules(detector_id, async_req=True) + >>> thread = api.list_rules(async_req=True) >>> result = thread.get() - Args: - 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 @@ -533,5 +534,4 @@ def list_detector_rules(self, detector_id, **kwargs): kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) kwargs["_content_type"] = kwargs.get("_content_type") kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["detector_id"] = detector_id - return self.list_detector_rules_endpoint.call_with_http_info(**kwargs) + return self.list_rules_endpoint.call_with_http_info(**kwargs) diff --git a/generated/groundlight_openapi_client/api_client.py b/generated/groundlight_openapi_client/api_client.py index f175f360..57caa709 100644 --- a/generated/groundlight_openapi_client/api_client.py +++ b/generated/groundlight_openapi_client/api_client.py @@ -770,10 +770,10 @@ def __call__(self, *args, **kwargs): Example: api_instance = ActionsApi() - api_instance.create_detector_rule # this is an instance of the class Endpoint - api_instance.create_detector_rule() # this invokes api_instance.create_detector_rule.__call__() + api_instance.create_rule # this is an instance of the class Endpoint + api_instance.create_rule() # this invokes api_instance.create_rule.__call__() which then invokes the callable functions stored in that endpoint at - api_instance.create_detector_rule.callable or self.callable in this class + api_instance.create_rule.callable or self.callable in this class """ return self.callable(self, *args, **kwargs) diff --git a/generated/groundlight_openapi_client/model/classification_result.py b/generated/groundlight_openapi_client/model/classification_result.py deleted file mode 100644 index 81a28533..00000000 --- a/generated/groundlight_openapi_client/model/classification_result.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - 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.15.3 - 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 ClassificationResult(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 = {} - - @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 { - "confidence": (float,), # noqa: E501 - "label": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "confidence": "confidence", # noqa: E501 - "label": "label", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, confidence, label, *args, **kwargs): # noqa: E501 - """ClassificationResult - a model defined in OpenAPI - - Args: - confidence (float): - label (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,) - """ - - _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.confidence = confidence - self.label = label - 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, confidence, label, *args, **kwargs): # noqa: E501 - """ClassificationResult - a model defined in OpenAPI - - Args: - confidence (float): - label (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,) - """ - - _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.confidence = confidence - self.label = label - 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/paginated_all_notes_list.py b/generated/groundlight_openapi_client/model/paginated_all_notes_list.py deleted file mode 100644 index 27391076..00000000 --- a/generated/groundlight_openapi_client/model/paginated_all_notes_list.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - 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.15.3 - 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 - - -def lazy_import(): - from groundlight_openapi_client.model.all_notes import AllNotes - - globals()["AllNotes"] = AllNotes - - -class PaginatedAllNotesList(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 = {} - - @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 - """ - lazy_import() - 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. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "results": ([AllNotes],), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "count": "count", # noqa: E501 - "results": "results", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, results, *args, **kwargs): # noqa: E501 - """PaginatedAllNotesList - a model defined in OpenAPI - - Args: - count (int): - results ([AllNotes]): - - 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,) - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [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.count = count - self.results = results - 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, count, results, *args, **kwargs): # noqa: E501 - """PaginatedAllNotesList - a model defined in OpenAPI - - Args: - count (int): - results ([AllNotes]): - - 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,) - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [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.count = count - self.results = results - 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/paginated_note_list.py b/generated/groundlight_openapi_client/model/paginated_note_list.py deleted file mode 100644 index ef37a161..00000000 --- a/generated/groundlight_openapi_client/model/paginated_note_list.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - 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.15.3 - 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 - - -def lazy_import(): - from groundlight_openapi_client.model.note import Note - - globals()["Note"] = Note - - -class PaginatedNoteList(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 = {} - - @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 - """ - lazy_import() - 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. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "results": ([Note],), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "count": "count", # noqa: E501 - "results": "results", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, results, *args, **kwargs): # noqa: E501 - """PaginatedNoteList - a model defined in OpenAPI - - Args: - count (int): - results ([Note]): - - 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,) - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [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.count = count - self.results = results - 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, count, results, *args, **kwargs): # noqa: E501 - """PaginatedNoteList - a model defined in OpenAPI - - Args: - count (int): - results ([Note]): - - 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,) - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [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.count = count - self.results = results - 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/model.py b/generated/model.py index 6671f3b7..b0858ce7 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2024-06-03T16:41:10+00:00 +# timestamp: 2024-06-03T17:05:22+00:00 from __future__ import annotations diff --git a/spec/public-api.yaml b/spec/public-api.yaml index b32f82b8..b1065951 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -31,7 +31,7 @@ paths: $ref: '#/components/schemas/PaginatedRuleList' description: '' post: - operationId: Create detector rule + operationId: Create rule description: Create a new rule for a detector parameters: - in: path @@ -64,7 +64,7 @@ paths: description: '' /v1/actions/rules: get: - operationId: List all rules + operationId: List rules description: Lists all rules over all detectors owned by the requester. parameters: - name: page