diff --git a/.sdk-version b/.sdk-version index 6b8da40..739706f 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v1.85.0 +v1.86.0 diff --git a/README.md b/README.md index b423aa2..16832cf 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Class | Method | HTTP request | Description *AnalysesCommentsApi* | [**delete_analysis_comment**](docs/AnalysesCommentsApi.md#delete_analysis_comment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment *AnalysesCommentsApi* | [**get_analysis_comments**](docs/AnalysesCommentsApi.md#get_analysis_comments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis *AnalysesCommentsApi* | [**update_analysis_comment**](docs/AnalysesCommentsApi.md#update_analysis_comment) | **PATCH** /v2/analyses/{analysis_id}/comments/{comment_id} | Update a comment +*AnalysesCoreApi* | [**batch_symbol_ann**](docs/AnalysesCoreApi.md#batch_symbol_ann) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs *AnalysesCoreApi* | [**create_analysis**](docs/AnalysesCoreApi.md#create_analysis) | **POST** /v2/analyses | Create Analysis *AnalysesCoreApi* | [**delete_analysis**](docs/AnalysesCoreApi.md#delete_analysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis *AnalysesCoreApi* | [**find_similar_functions_batch**](docs/AnalysesCoreApi.md#find_similar_functions_batch) | **POST** /v2/analyses/{analysis_id}/similarity/functions | Batch Symbol ANN using Analysis ID @@ -155,7 +156,6 @@ Class | Method | HTTP request | Description *SearchApi* | [**search_collections**](docs/SearchApi.md#search_collections) | **GET** /v2/search/collections | Collections search *SearchApi* | [**search_functions**](docs/SearchApi.md#search_functions) | **GET** /v2/search/functions | Functions search *SearchApi* | [**search_tags**](docs/SearchApi.md#search_tags) | **GET** /v2/search/tags | Tags search -*V1Api* | [**batch_symbol_ann**](docs/V1Api.md#batch_symbol_ann) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs ## Documentation For Models diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 0ec8793..4e0d76f 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**batch_symbol_ann**](AnalysesCoreApi.md#batch_symbol_ann) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs [**create_analysis**](AnalysesCoreApi.md#create_analysis) | **POST** /v2/analyses | Create Analysis [**delete_analysis**](AnalysesCoreApi.md#delete_analysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis [**find_similar_functions_batch**](AnalysesCoreApi.md#find_similar_functions_batch) | **POST** /v2/analyses/{analysis_id}/similarity/functions | Batch Symbol ANN using Analysis ID @@ -21,6 +22,89 @@ Method | HTTP request | Description [**upload_file**](AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File +# **batch_symbol_ann** +> FunctionBatchAnn batch_symbol_ann(app_api_rest_v1_ann_schema_ann_function, authorization=authorization) + +Batch Symbol ANN using function IDs + +Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction +from revengai.models.function_batch_ann import FunctionBatchAnn +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + app_api_rest_v1_ann_schema_ann_function = revengai.AppApiRestV1AnnSchemaANNFunction() # AppApiRestV1AnnSchemaANNFunction | + authorization = 'authorization_example' # str | API Key bearer token (optional) + + try: + # Batch Symbol ANN using function IDs + api_response = api_instance.batch_symbol_ann(app_api_rest_v1_ann_schema_ann_function, authorization=authorization) + print("The response of AnalysesCoreApi->batch_symbol_ann:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->batch_symbol_ann: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_api_rest_v1_ann_schema_ann_function** | [**AppApiRestV1AnnSchemaANNFunction**](AppApiRestV1AnnSchemaANNFunction.md)| | + **authorization** | **str**| API Key bearer token | [optional] + +### Return type + +[**FunctionBatchAnn**](FunctionBatchAnn.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | + +[[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) + # **create_analysis** > BaseResponseAnalysisCreateResponse create_analysis(analysis_create_request, authorization=authorization) diff --git a/docs/V1Api.md b/docs/V1Api.md deleted file mode 100644 index b47b3f5..0000000 --- a/docs/V1Api.md +++ /dev/null @@ -1,92 +0,0 @@ -# revengai.V1Api - -All URIs are relative to *https://api.reveng.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**batch_symbol_ann**](V1Api.md#batch_symbol_ann) | **POST** /v1/ann/symbol/batch | Batch Symbol ANN using function IDs - - -# **batch_symbol_ann** -> FunctionBatchAnn batch_symbol_ann(app_api_rest_v1_ann_schema_ann_function, authorization=authorization) - -Batch Symbol ANN using function IDs - -Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction -from revengai.models.function_batch_ann import FunctionBatchAnn -from revengai.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.reveng.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = revengai.Configuration( - host = "https://api.reveng.ai" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: APIKey -configuration.api_key['APIKey'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['APIKey'] = 'Bearer' - -# Enter a context with an instance of the API client -with revengai.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = revengai.V1Api(api_client) - app_api_rest_v1_ann_schema_ann_function = revengai.AppApiRestV1AnnSchemaANNFunction() # AppApiRestV1AnnSchemaANNFunction | - authorization = 'authorization_example' # str | API Key bearer token (optional) - - try: - # Batch Symbol ANN using function IDs - api_response = api_instance.batch_symbol_ann(app_api_rest_v1_ann_schema_ann_function, authorization=authorization) - print("The response of V1Api->batch_symbol_ann:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling V1Api->batch_symbol_ann: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_api_rest_v1_ann_schema_ann_function** | [**AppApiRestV1AnnSchemaANNFunction**](AppApiRestV1AnnSchemaANNFunction.md)| | - **authorization** | **str**| API Key bearer token | [optional] - -### Return type - -[**FunctionBatchAnn**](FunctionBatchAnn.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[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) - diff --git a/revengai/__init__.py b/revengai/__init__.py index 1b90e16..61fc58c 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v1.85.0" +__version__ = "v1.86.0" # Define package exports __all__ = [ @@ -37,7 +37,6 @@ "FunctionsThreatScoreApi", "ModelsApi", "SearchApi", - "V1Api", "ApiResponse", "ApiClient", "Configuration", @@ -376,7 +375,6 @@ from revengai.api.functions_threat_score_api import FunctionsThreatScoreApi as FunctionsThreatScoreApi from revengai.api.models_api import ModelsApi as ModelsApi from revengai.api.search_api import SearchApi as SearchApi -from revengai.api.v1_api import V1Api as V1Api # import ApiClient from revengai.api_response import ApiResponse as ApiResponse diff --git a/revengai/api/__init__.py b/revengai/api/__init__.py index 64445fd..0199858 100644 --- a/revengai/api/__init__.py +++ b/revengai/api/__init__.py @@ -21,5 +21,4 @@ from revengai.api.functions_threat_score_api import FunctionsThreatScoreApi from revengai.api.models_api import ModelsApi from revengai.api.search_api import SearchApi -from revengai.api.v1_api import V1Api diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 515a3e5..e8457e9 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -21,6 +21,7 @@ from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_update_request import AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest +from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy from revengai.models.app_api_rest_v2_similarity_schema_ann_function import AppApiRestV2SimilaritySchemaANNFunction from revengai.models.base_response_analysis_create_response import BaseResponseAnalysisCreateResponse @@ -39,6 +40,7 @@ from revengai.models.base_response_upload_response import BaseResponseUploadResponse from revengai.models.binary_ann_form import BinaryAnnForm from revengai.models.dynamic_execution_status_input import DynamicExecutionStatusInput +from revengai.models.function_batch_ann import FunctionBatchAnn from revengai.models.model_name import ModelName from revengai.models.order import Order from revengai.models.re_analysis_form import ReAnalysisForm @@ -64,6 +66,298 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def batch_symbol_ann( + self, + app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction, + authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FunctionBatchAnn: + """Batch Symbol ANN using function IDs + + Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database + + :param app_api_rest_v1_ann_schema_ann_function: (required) + :type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction + :param authorization: API Key bearer token + :type authorization: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_symbol_ann_serialize( + app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionBatchAnn", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def batch_symbol_ann_with_http_info( + self, + app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction, + authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FunctionBatchAnn]: + """Batch Symbol ANN using function IDs + + Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database + + :param app_api_rest_v1_ann_schema_ann_function: (required) + :type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction + :param authorization: API Key bearer token + :type authorization: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_symbol_ann_serialize( + app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionBatchAnn", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def batch_symbol_ann_without_preload_content( + self, + app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction, + authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Batch Symbol ANN using function IDs + + Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database + + :param app_api_rest_v1_ann_schema_ann_function: (required) + :type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction + :param authorization: API Key bearer token + :type authorization: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_symbol_ann_serialize( + app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionBatchAnn", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _batch_symbol_ann_serialize( + self, + app_api_rest_v1_ann_schema_ann_function, + authorization, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if app_api_rest_v1_ann_schema_ann_function is not None: + _body_params = app_api_rest_v1_ann_schema_ann_function + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/ann/symbol/batch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def create_analysis( self, diff --git a/revengai/api/v1_api.py b/revengai/api/v1_api.py deleted file mode 100644 index b64875e..0000000 --- a/revengai/api/v1_api.py +++ /dev/null @@ -1,334 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictStr -from typing import Optional -from typing_extensions import Annotated -from revengai.models.app_api_rest_v1_ann_schema_ann_function import AppApiRestV1AnnSchemaANNFunction -from revengai.models.function_batch_ann import FunctionBatchAnn - -from revengai.api_client import ApiClient, RequestSerialized -from revengai.api_response import ApiResponse -from revengai.rest import RESTResponseType - - -class V1Api: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def batch_symbol_ann( - self, - app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction, - authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FunctionBatchAnn: - """(Deprecated) Batch Symbol ANN using function IDs - - Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - - :param app_api_rest_v1_ann_schema_ann_function: (required) - :type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction - :param authorization: API Key bearer token - :type authorization: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/ann/symbol/batch is deprecated.", DeprecationWarning) - - _param = self._batch_symbol_ann_serialize( - app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionBatchAnn", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def batch_symbol_ann_with_http_info( - self, - app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction, - authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[FunctionBatchAnn]: - """(Deprecated) Batch Symbol ANN using function IDs - - Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - - :param app_api_rest_v1_ann_schema_ann_function: (required) - :type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction - :param authorization: API Key bearer token - :type authorization: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/ann/symbol/batch is deprecated.", DeprecationWarning) - - _param = self._batch_symbol_ann_serialize( - app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionBatchAnn", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def batch_symbol_ann_without_preload_content( - self, - app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction, - authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """(Deprecated) Batch Symbol ANN using function IDs - - Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the database - - :param app_api_rest_v1_ann_schema_ann_function: (required) - :type app_api_rest_v1_ann_schema_ann_function: AppApiRestV1AnnSchemaANNFunction - :param authorization: API Key bearer token - :type authorization: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/ann/symbol/batch is deprecated.", DeprecationWarning) - - _param = self._batch_symbol_ann_serialize( - app_api_rest_v1_ann_schema_ann_function=app_api_rest_v1_ann_schema_ann_function, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionBatchAnn", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _batch_symbol_ann_serialize( - self, - app_api_rest_v1_ann_schema_ann_function, - authorization, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # process the form parameters - # process the body parameter - if app_api_rest_v1_ann_schema_ann_function is not None: - _body_params = app_api_rest_v1_ann_schema_ann_function - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'APIKey' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/ann/symbol/batch', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/revengai/api_client.py b/revengai/api_client.py index 547ec4c..fe3e346 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v1.85.0/python' + self.user_agent = 'OpenAPI-Generator/v1.86.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 26b9722..dc7d318 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -529,8 +529,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v1.85.0\n"\ - "SDK Package Version: v1.85.0".\ + "Version of the API: v1.86.0\n"\ + "SDK Package Version: v1.86.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/test/test_analyses_core_api.py b/test/test_analyses_core_api.py index 8da5b60..8ded745 100644 --- a/test/test_analyses_core_api.py +++ b/test/test_analyses_core_api.py @@ -25,6 +25,13 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_batch_symbol_ann(self) -> None: + """Test case for batch_symbol_ann + + Batch Symbol ANN using function IDs + """ + pass + def test_create_analysis(self) -> None: """Test case for create_analysis diff --git a/test/test_v1_api.py b/test/test_v1_api.py deleted file mode 100644 index 1222a47..0000000 --- a/test/test_v1_api.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is Similarity Search Engine for executable binaries - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from revengai.api.v1_api import V1Api - - -class TestV1Api(unittest.TestCase): - """V1Api unit test stubs""" - - def setUp(self) -> None: - self.api = V1Api() - - def tearDown(self) -> None: - pass - - def test_batch_symbol_ann(self) -> None: - """Test case for batch_symbol_ann - - Batch Symbol ANN using function IDs - """ - pass - - -if __name__ == '__main__': - unittest.main()