From 5539861c0bd6dbb46e023702487f217ed8c376c8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 12 Sep 2025 12:49:07 +0000 Subject: [PATCH] Update SDK to version v1.79.0 - Generated from OpenAPI spec version v1.79.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 2 +- docs/AnalysesCoreApi.md | 83 +++++ docs/DefaultApi.md | 91 ----- docs/FunctionMapping.md | 1 + revengai/__init__.py | 4 +- revengai/api/__init__.py | 1 - revengai/api/analyses_core_api.py | 280 ++++++++++++++++ revengai/api/default_api.py | 317 ------------------ revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/function_mapping.py | 8 +- test/test_analyses_core_api.py | 7 + test/test_analysis_function_mapping.py | 6 + ...base_response_analysis_function_mapping.py | 3 + test/test_default_api.py | 37 -- test/test_function_mapping.py | 6 + 17 files changed, 397 insertions(+), 457 deletions(-) delete mode 100644 docs/DefaultApi.md delete mode 100644 revengai/api/default_api.py delete mode 100644 test/test_default_api.py diff --git a/.sdk-version b/.sdk-version index 5909159..26f4e1e 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v1.78.1 +v1.79.0 diff --git a/README.md b/README.md index bd185ba..ff45971 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ Class | Method | HTTP request | Description *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 *AnalysesCoreApi* | [**get_analysis_basic_info**](docs/AnalysesCoreApi.md#get_analysis_basic_info) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information +*AnalysesCoreApi* | [**get_analysis_function_map**](docs/AnalysesCoreApi.md#get_analysis_function_map) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map *AnalysesCoreApi* | [**get_analysis_logs**](docs/AnalysesCoreApi.md#get_analysis_logs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis *AnalysesCoreApi* | [**get_analysis_params**](docs/AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information *AnalysesCoreApi* | [**get_analysis_status**](docs/AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis @@ -156,7 +157,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 -*DefaultApi* | [**get_analysis_function_map**](docs/DefaultApi.md#get_analysis_function_map) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map ## Documentation For Models diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 20bac3d..f6e28ac 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**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 [**get_analysis_basic_info**](AnalysesCoreApi.md#get_analysis_basic_info) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information +[**get_analysis_function_map**](AnalysesCoreApi.md#get_analysis_function_map) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map [**get_analysis_logs**](AnalysesCoreApi.md#get_analysis_logs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis [**get_analysis_params**](AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information [**get_analysis_status**](AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis @@ -357,6 +358,88 @@ 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) +# **get_analysis_function_map** +> BaseResponseAnalysisFunctionMapping get_analysis_function_map(analysis_id, authorization=authorization) + +Get Analysis Function Map + +Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping +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) + analysis_id = 56 # int | + authorization = 'authorization_example' # str | API Key bearer token (optional) + + try: + # Get Analysis Function Map + api_response = api_instance.get_analysis_function_map(analysis_id, authorization=authorization) + print("The response of AnalysesCoreApi->get_analysis_function_map:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->get_analysis_function_map: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| | + **authorization** | **str**| API Key bearer token | [optional] + +### Return type + +[**BaseResponseAnalysisFunctionMapping**](BaseResponseAnalysisFunctionMapping.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + # **get_analysis_logs** > BaseResponseLogs get_analysis_logs(analysis_id, authorization=authorization) diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md deleted file mode 100644 index 3b66876..0000000 --- a/docs/DefaultApi.md +++ /dev/null @@ -1,91 +0,0 @@ -# revengai.DefaultApi - -All URIs are relative to *https://api.reveng.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_analysis_function_map**](DefaultApi.md#get_analysis_function_map) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map - - -# **get_analysis_function_map** -> BaseResponseAnalysisFunctionMapping get_analysis_function_map(analysis_id, authorization=authorization) - -Get Analysis Function Map - -Returns the a map of function ids to function addresses for the analysis, and it's inverse. - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping -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.DefaultApi(api_client) - analysis_id = 56 # int | - authorization = 'authorization_example' # str | API Key bearer token (optional) - - try: - # Get Analysis Function Map - api_response = api_instance.get_analysis_function_map(analysis_id, authorization=authorization) - print("The response of DefaultApi->get_analysis_function_map:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->get_analysis_function_map: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - **authorization** | **str**| API Key bearer token | [optional] - -### Return type - -[**BaseResponseAnalysisFunctionMapping**](BaseResponseAnalysisFunctionMapping.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **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/docs/FunctionMapping.md b/docs/FunctionMapping.md index 198aec1..54b93a1 100644 --- a/docs/FunctionMapping.md +++ b/docs/FunctionMapping.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **function_map** | **Dict[str, int]** | Mapping of remote function ids to local function addresses | **inverse_function_map** | **Dict[str, int]** | Mapping of local function addresses to remote function ids | +**name_map** | **Dict[str, str]** | Mapping of local function addresses to function names | ## Example diff --git a/revengai/__init__.py b/revengai/__init__.py index 3a20ad2..ee7ba4f 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v1.78.1" +__version__ = "v1.79.0" # Define package exports __all__ = [ @@ -37,7 +37,6 @@ "FunctionsThreatScoreApi", "ModelsApi", "SearchApi", - "DefaultApi", "ApiResponse", "ApiClient", "Configuration", @@ -380,7 +379,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.default_api import DefaultApi as DefaultApi # import ApiClient from revengai.api_response import ApiResponse as ApiResponse diff --git a/revengai/api/__init__.py b/revengai/api/__init__.py index 7cd5d0d..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.default_api import DefaultApi diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index def1bc8..0d2ca33 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -25,6 +25,7 @@ from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy from revengai.models.base_response_analysis_create_response import BaseResponseAnalysisCreateResponse from revengai.models.base_response_analysis_detail_response import BaseResponseAnalysisDetailResponse +from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse from revengai.models.base_response_basic import BaseResponseBasic from revengai.models.base_response_binary_ann_list_response import BaseResponseBinaryAnnListResponse @@ -1233,6 +1234,285 @@ def _get_analysis_basic_info_serialize( + @validate_call + def get_analysis_function_map( + self, + analysis_id: StrictInt, + 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, + ) -> BaseResponseAnalysisFunctionMapping: + """Get Analysis Function Map + + Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + + :param analysis_id: (required) + :type analysis_id: int + :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._get_analysis_function_map_serialize( + analysis_id=analysis_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionMapping", + '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 get_analysis_function_map_with_http_info( + self, + analysis_id: StrictInt, + 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[BaseResponseAnalysisFunctionMapping]: + """Get Analysis Function Map + + Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + + :param analysis_id: (required) + :type analysis_id: int + :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._get_analysis_function_map_serialize( + analysis_id=analysis_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionMapping", + '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 get_analysis_function_map_without_preload_content( + self, + analysis_id: StrictInt, + 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: + """Get Analysis Function Map + + Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + + :param analysis_id: (required) + :type analysis_id: int + :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._get_analysis_function_map_serialize( + analysis_id=analysis_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionMapping", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_analysis_function_map_serialize( + self, + analysis_id, + 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 + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # 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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/analyses/{analysis_id}/func_maps', + 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 get_analysis_logs( self, diff --git a/revengai/api/default_api.py b/revengai/api/default_api.py deleted file mode 100644 index 013d6c5..0000000 --- a/revengai/api/default_api.py +++ /dev/null @@ -1,317 +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, StrictInt, StrictStr -from typing import Optional -from typing_extensions import Annotated -from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping - -from revengai.api_client import ApiClient, RequestSerialized -from revengai.api_response import ApiResponse -from revengai.rest import RESTResponseType - - -class DefaultApi: - """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 get_analysis_function_map( - self, - analysis_id: StrictInt, - 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, - ) -> BaseResponseAnalysisFunctionMapping: - """Get Analysis Function Map - - Returns the a map of function ids to function addresses for the analysis, and it's inverse. - - :param analysis_id: (required) - :type analysis_id: int - :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._get_analysis_function_map_serialize( - analysis_id=analysis_id, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisFunctionMapping", - '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 get_analysis_function_map_with_http_info( - self, - analysis_id: StrictInt, - 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[BaseResponseAnalysisFunctionMapping]: - """Get Analysis Function Map - - Returns the a map of function ids to function addresses for the analysis, and it's inverse. - - :param analysis_id: (required) - :type analysis_id: int - :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._get_analysis_function_map_serialize( - analysis_id=analysis_id, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisFunctionMapping", - '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 get_analysis_function_map_without_preload_content( - self, - analysis_id: StrictInt, - 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: - """Get Analysis Function Map - - Returns the a map of function ids to function addresses for the analysis, and it's inverse. - - :param analysis_id: (required) - :type analysis_id: int - :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._get_analysis_function_map_serialize( - analysis_id=analysis_id, - authorization=authorization, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisFunctionMapping", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_analysis_function_map_serialize( - self, - analysis_id, - 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 - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id - # 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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'APIKey' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v2/analyses/{analysis_id}/func_maps', - 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 aea317b..fae567f 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.78.1/python' + self.user_agent = 'OpenAPI-Generator/v1.79.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 6bb3e12..999fe39 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.78.1\n"\ - "SDK Package Version: v1.78.1".\ + "Version of the API: v1.79.0\n"\ + "SDK Package Version: v1.79.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/function_mapping.py b/revengai/models/function_mapping.py index 9eda874..5651381 100644 --- a/revengai/models/function_mapping.py +++ b/revengai/models/function_mapping.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,8 @@ class FunctionMapping(BaseModel): """ # noqa: E501 function_map: Dict[str, StrictInt] = Field(description="Mapping of remote function ids to local function addresses") inverse_function_map: Dict[str, StrictInt] = Field(description="Mapping of local function addresses to remote function ids") - __properties: ClassVar[List[str]] = ["function_map", "inverse_function_map"] + name_map: Dict[str, StrictStr] = Field(description="Mapping of local function addresses to function names") + __properties: ClassVar[List[str]] = ["function_map", "inverse_function_map", "name_map"] model_config = ConfigDict( populate_by_name=True, @@ -81,7 +82,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "function_map": obj.get("function_map"), - "inverse_function_map": obj.get("inverse_function_map") + "inverse_function_map": obj.get("inverse_function_map"), + "name_map": obj.get("name_map") }) return _obj diff --git a/test/test_analyses_core_api.py b/test/test_analyses_core_api.py index 15bbb88..6bb7269 100644 --- a/test/test_analyses_core_api.py +++ b/test/test_analyses_core_api.py @@ -53,6 +53,13 @@ def test_get_analysis_basic_info(self) -> None: """ pass + def test_get_analysis_function_map(self) -> None: + """Test case for get_analysis_function_map + + Get Analysis Function Map + """ + pass + def test_get_analysis_logs(self) -> None: """Test case for get_analysis_logs diff --git a/test/test_analysis_function_mapping.py b/test/test_analysis_function_mapping.py index cb69394..8d4bf28 100644 --- a/test/test_analysis_function_mapping.py +++ b/test/test_analysis_function_mapping.py @@ -40,6 +40,9 @@ def make_instance(self, include_optional) -> AnalysisFunctionMapping: }, inverse_function_map = { 'key' : 56 + }, + name_map = { + 'key' : '' }, ) ) else: @@ -50,6 +53,9 @@ def make_instance(self, include_optional) -> AnalysisFunctionMapping: }, inverse_function_map = { 'key' : 56 + }, + name_map = { + 'key' : '' }, ), ) """ diff --git a/test/test_base_response_analysis_function_mapping.py b/test/test_base_response_analysis_function_mapping.py index c8eb4ce..df00f2a 100644 --- a/test/test_base_response_analysis_function_mapping.py +++ b/test/test_base_response_analysis_function_mapping.py @@ -42,6 +42,9 @@ def make_instance(self, include_optional) -> BaseResponseAnalysisFunctionMapping }, inverse_function_map = { 'key' : 56 + }, + name_map = { + 'key' : '' }, ), ), message = '', errors = [ diff --git a/test/test_default_api.py b/test/test_default_api.py deleted file mode 100644 index 2690b8c..0000000 --- a/test/test_default_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.default_api import DefaultApi - - -class TestDefaultApi(unittest.TestCase): - """DefaultApi unit test stubs""" - - def setUp(self) -> None: - self.api = DefaultApi() - - def tearDown(self) -> None: - pass - - def test_get_analysis_function_map(self) -> None: - """Test case for get_analysis_function_map - - Get Analysis Function Map - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_function_mapping.py b/test/test_function_mapping.py index 14c3c6e..d47df72 100644 --- a/test/test_function_mapping.py +++ b/test/test_function_mapping.py @@ -39,6 +39,9 @@ def make_instance(self, include_optional) -> FunctionMapping: }, inverse_function_map = { 'key' : 56 + }, + name_map = { + 'key' : '' } ) else: @@ -49,6 +52,9 @@ def make_instance(self, include_optional) -> FunctionMapping: inverse_function_map = { 'key' : 56 }, + name_map = { + 'key' : '' + }, ) """