From 688180dfac3c2ebc54b2e372df8e7518956603f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 29 Jan 2026 09:11:11 +0000 Subject: [PATCH] Update SDK to version v2.90.0 - Generated from OpenAPI spec version v2.90.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 4 + docs/BaseResponseConfigResponse.md | 33 ++ docs/ConfigResponse.md | 31 ++ docs/DefaultApi.md | 85 ++++++ docs/FunctionListItem.md | 1 + docs/NameSourceType.md | 31 ++ revengai/__init__.py | 10 +- revengai/api/__init__.py | 1 + revengai/api/default_api.py | 284 ++++++++++++++++++ revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 3 + .../models/base_response_config_response.py | 125 ++++++++ revengai/models/config_response.py | 90 ++++++ revengai/models/function_list_item.py | 8 +- revengai/models/name_source_type.py | 107 +++++++ test/test_analysis_functions_list.py | 8 + ...t_base_response_analysis_functions_list.py | 4 + test/test_base_response_config_response.py | 67 +++++ test/test_config_response.py | 58 ++++ test/test_default_api.py | 37 +++ test/test_function_list_item.py | 8 + test/test_name_source_type.py | 53 ++++ 24 files changed, 1050 insertions(+), 6 deletions(-) create mode 100644 docs/BaseResponseConfigResponse.md create mode 100644 docs/ConfigResponse.md create mode 100644 docs/DefaultApi.md create mode 100644 docs/NameSourceType.md create mode 100644 revengai/api/default_api.py create mode 100644 revengai/models/base_response_config_response.py create mode 100644 revengai/models/config_response.py create mode 100644 revengai/models/name_source_type.py create mode 100644 test/test_base_response_config_response.py create mode 100644 test/test_config_response.py create mode 100644 test/test_default_api.py create mode 100644 test/test_name_source_type.py diff --git a/.sdk-version b/.sdk-version index 6b6133e..3750c20 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.88.6 +v2.90.0 diff --git a/README.md b/README.md index b20799e..17ac8d3 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ 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_config_v2_config_get**](docs/DefaultApi.md#get_config_v2_config_get) | **GET** /v2/config | Get Config ## Documentation For Models @@ -209,6 +210,7 @@ Class | Method | HTTP request | Description - [BaseResponseCollectionTagsUpdateResponse](docs/BaseResponseCollectionTagsUpdateResponse.md) - [BaseResponseCommentResponse](docs/BaseResponseCommentResponse.md) - [BaseResponseCommunities](docs/BaseResponseCommunities.md) + - [BaseResponseConfigResponse](docs/BaseResponseConfigResponse.md) - [BaseResponseCreated](docs/BaseResponseCreated.md) - [BaseResponseDict](docs/BaseResponseDict.md) - [BaseResponseDynamicExecutionStatus](docs/BaseResponseDynamicExecutionStatus.md) @@ -291,6 +293,7 @@ Class | Method | HTTP request | Description - [Communities](docs/Communities.md) - [CommunityMatchPercentages](docs/CommunityMatchPercentages.md) - [ConfidenceType](docs/ConfidenceType.md) + - [ConfigResponse](docs/ConfigResponse.md) - [Context](docs/Context.md) - [Created](docs/Created.md) - [DecompilationCommentContext](docs/DecompilationCommentContext.md) @@ -374,6 +377,7 @@ Class | Method | HTTP request | Description - [ModelName](docs/ModelName.md) - [ModelsResponse](docs/ModelsResponse.md) - [NameConfidence](docs/NameConfidence.md) + - [NameSourceType](docs/NameSourceType.md) - [NetworkOverviewDns](docs/NetworkOverviewDns.md) - [NetworkOverviewDnsAnswer](docs/NetworkOverviewDnsAnswer.md) - [NetworkOverviewMetadata](docs/NetworkOverviewMetadata.md) diff --git a/docs/BaseResponseConfigResponse.md b/docs/BaseResponseConfigResponse.md new file mode 100644 index 0000000..de1aeb8 --- /dev/null +++ b/docs/BaseResponseConfigResponse.md @@ -0,0 +1,33 @@ +# BaseResponseConfigResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] +**data** | [**ConfigResponse**](ConfigResponse.md) | | [optional] +**message** | **str** | | [optional] +**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] +**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] + +## Example + +```python +from revengai.models.base_response_config_response import BaseResponseConfigResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResponseConfigResponse from a JSON string +base_response_config_response_instance = BaseResponseConfigResponse.from_json(json) +# print the JSON string representation of the object +print(BaseResponseConfigResponse.to_json()) + +# convert the object into a dict +base_response_config_response_dict = base_response_config_response_instance.to_dict() +# create an instance of BaseResponseConfigResponse from a dict +base_response_config_response_from_dict = BaseResponseConfigResponse.from_dict(base_response_config_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ConfigResponse.md b/docs/ConfigResponse.md new file mode 100644 index 0000000..1b608ea --- /dev/null +++ b/docs/ConfigResponse.md @@ -0,0 +1,31 @@ +# ConfigResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dashboard_url** | **str** | The domain of the RevEng.AI platform you are connected to | [optional] [default to ''] +**max_file_size_bytes** | **int** | Maximum file size (in bytes) that can be uploaded for analysis | +**ai_decompiler_unsupported_languages** | **List[str]** | List of programming languages that are not supported for AI decompilation | + +## Example + +```python +from revengai.models.config_response import ConfigResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ConfigResponse from a JSON string +config_response_instance = ConfigResponse.from_json(json) +# print the JSON string representation of the object +print(ConfigResponse.to_json()) + +# convert the object into a dict +config_response_dict = config_response_instance.to_dict() +# create an instance of ConfigResponse from a dict +config_response_from_dict = ConfigResponse.from_dict(config_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md new file mode 100644 index 0000000..9baa365 --- /dev/null +++ b/docs/DefaultApi.md @@ -0,0 +1,85 @@ +# revengai.DefaultApi + +All URIs are relative to *https://api.reveng.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_config_v2_config_get**](DefaultApi.md#get_config_v2_config_get) | **GET** /v2/config | Get Config + + +# **get_config_v2_config_get** +> BaseResponseConfigResponse get_config_v2_config_get() + +Get Config + +General configuration endpoint + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_config_response import BaseResponseConfigResponse +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) + + try: + # Get Config + api_response = api_instance.get_config_v2_config_get() + print("The response of DefaultApi->get_config_v2_config_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DefaultApi->get_config_v2_config_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**BaseResponseConfigResponse**](BaseResponseConfigResponse.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/FunctionListItem.md b/docs/FunctionListItem.md index 6fa0601..36df9b8 100644 --- a/docs/FunctionListItem.md +++ b/docs/FunctionListItem.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **id** | **int** | Function id | **name** | **str** | Name of the function | **name_source_type** | **str** | The source (process) the function name came from | +**name_source** | [**NameSourceType**](NameSourceType.md) | The source of the current function name. | **mangled_name** | **str** | Mangled name of the function | **vaddr** | **int** | Function virtual address | **size** | **int** | Function size in bytes | diff --git a/docs/NameSourceType.md b/docs/NameSourceType.md new file mode 100644 index 0000000..184a16f --- /dev/null +++ b/docs/NameSourceType.md @@ -0,0 +1,31 @@ +# NameSourceType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | The source (process) the function name came from | +**function_id** | **int** | | [optional] +**binary_id** | **int** | | [optional] + +## Example + +```python +from revengai.models.name_source_type import NameSourceType + +# TODO update the JSON string below +json = "{}" +# create an instance of NameSourceType from a JSON string +name_source_type_instance = NameSourceType.from_json(json) +# print the JSON string representation of the object +print(NameSourceType.to_json()) + +# convert the object into a dict +name_source_type_dict = name_source_type_instance.to_dict() +# create an instance of NameSourceType from a dict +name_source_type_from_dict = NameSourceType.from_dict(name_source_type_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index d66d914..3c50020 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v2.88.6" +__version__ = "v2.90.0" # Define package exports __all__ = [ @@ -35,6 +35,7 @@ "FunctionsRenamingHistoryApi", "ModelsApi", "SearchApi", + "DefaultApi", "ApiResponse", "ApiClient", "Configuration", @@ -104,6 +105,7 @@ "BaseResponseCollectionTagsUpdateResponse", "BaseResponseCommentResponse", "BaseResponseCommunities", + "BaseResponseConfigResponse", "BaseResponseCreated", "BaseResponseDict", "BaseResponseDynamicExecutionStatus", @@ -186,6 +188,7 @@ "Communities", "CommunityMatchPercentages", "ConfidenceType", + "ConfigResponse", "Context", "Created", "DecompilationCommentContext", @@ -269,6 +272,7 @@ "ModelName", "ModelsResponse", "NameConfidence", + "NameSourceType", "NetworkOverviewDns", "NetworkOverviewDnsAnswer", "NetworkOverviewMetadata", @@ -355,6 +359,7 @@ from revengai.api.functions_renaming_history_api import FunctionsRenamingHistoryApi as FunctionsRenamingHistoryApi 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 @@ -428,6 +433,7 @@ from revengai.models.base_response_collection_tags_update_response import BaseResponseCollectionTagsUpdateResponse as BaseResponseCollectionTagsUpdateResponse from revengai.models.base_response_comment_response import BaseResponseCommentResponse as BaseResponseCommentResponse from revengai.models.base_response_communities import BaseResponseCommunities as BaseResponseCommunities +from revengai.models.base_response_config_response import BaseResponseConfigResponse as BaseResponseConfigResponse from revengai.models.base_response_created import BaseResponseCreated as BaseResponseCreated from revengai.models.base_response_dict import BaseResponseDict as BaseResponseDict from revengai.models.base_response_dynamic_execution_status import BaseResponseDynamicExecutionStatus as BaseResponseDynamicExecutionStatus @@ -510,6 +516,7 @@ from revengai.models.communities import Communities as Communities from revengai.models.community_match_percentages import CommunityMatchPercentages as CommunityMatchPercentages from revengai.models.confidence_type import ConfidenceType as ConfidenceType +from revengai.models.config_response import ConfigResponse as ConfigResponse from revengai.models.context import Context as Context from revengai.models.created import Created as Created from revengai.models.decompilation_comment_context import DecompilationCommentContext as DecompilationCommentContext @@ -593,6 +600,7 @@ from revengai.models.model_name import ModelName as ModelName from revengai.models.models_response import ModelsResponse as ModelsResponse from revengai.models.name_confidence import NameConfidence as NameConfidence +from revengai.models.name_source_type import NameSourceType as NameSourceType from revengai.models.network_overview_dns import NetworkOverviewDns as NetworkOverviewDns from revengai.models.network_overview_dns_answer import NetworkOverviewDnsAnswer as NetworkOverviewDnsAnswer from revengai.models.network_overview_metadata import NetworkOverviewMetadata as NetworkOverviewMetadata diff --git a/revengai/api/__init__.py b/revengai/api/__init__.py index 8d6f02d..69f5e4a 100644 --- a/revengai/api/__init__.py +++ b/revengai/api/__init__.py @@ -19,4 +19,5 @@ from revengai.api.functions_renaming_history_api import FunctionsRenamingHistoryApi 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/default_api.py b/revengai/api/default_api.py new file mode 100644 index 0000000..15225c9 --- /dev/null +++ b/revengai/api/default_api.py @@ -0,0 +1,284 @@ +# 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 revengai.models.base_response_config_response import BaseResponseConfigResponse + +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_config_v2_config_get( + self, + _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, + ) -> BaseResponseConfigResponse: + """Get Config + + General configuration endpoint + + :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_config_v2_config_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseConfigResponse", + '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_config_v2_config_get_with_http_info( + self, + _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[BaseResponseConfigResponse]: + """Get Config + + General configuration endpoint + + :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_config_v2_config_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseConfigResponse", + '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_config_v2_config_get_without_preload_content( + self, + _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 Config + + General configuration endpoint + + :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_config_v2_config_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseConfigResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_config_v2_config_get_serialize( + self, + _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 + # 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/config', + 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 8a8a1e6..44975f5 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/v2.88.6/python' + self.user_agent = 'OpenAPI-Generator/v2.90.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 0750f2a..4dd25f0 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v2.88.6\n"\ - "SDK Package Version: v2.88.6".\ + "Version of the API: v2.90.0\n"\ + "SDK Package Version: v2.90.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index d7e2be9..ab0ca5a 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -72,6 +72,7 @@ from revengai.models.base_response_collection_tags_update_response import BaseResponseCollectionTagsUpdateResponse from revengai.models.base_response_comment_response import BaseResponseCommentResponse from revengai.models.base_response_communities import BaseResponseCommunities +from revengai.models.base_response_config_response import BaseResponseConfigResponse from revengai.models.base_response_created import BaseResponseCreated from revengai.models.base_response_dict import BaseResponseDict from revengai.models.base_response_dynamic_execution_status import BaseResponseDynamicExecutionStatus @@ -154,6 +155,7 @@ from revengai.models.communities import Communities from revengai.models.community_match_percentages import CommunityMatchPercentages from revengai.models.confidence_type import ConfidenceType +from revengai.models.config_response import ConfigResponse from revengai.models.context import Context from revengai.models.created import Created from revengai.models.decompilation_comment_context import DecompilationCommentContext @@ -237,6 +239,7 @@ from revengai.models.model_name import ModelName from revengai.models.models_response import ModelsResponse from revengai.models.name_confidence import NameConfidence +from revengai.models.name_source_type import NameSourceType from revengai.models.network_overview_dns import NetworkOverviewDns from revengai.models.network_overview_dns_answer import NetworkOverviewDnsAnswer from revengai.models.network_overview_metadata import NetworkOverviewMetadata diff --git a/revengai/models/base_response_config_response.py b/revengai/models/base_response_config_response.py new file mode 100644 index 0000000..3c455b4 --- /dev/null +++ b/revengai/models/base_response_config_response.py @@ -0,0 +1,125 @@ +# 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 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.config_response import ConfigResponse +from revengai.models.error_model import ErrorModel +from revengai.models.meta_model import MetaModel +from typing import Optional, Set +from typing_extensions import Self + +class BaseResponseConfigResponse(BaseModel): + """ + BaseResponseConfigResponse + """ # noqa: E501 + status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") + data: Optional[ConfigResponse] = None + message: Optional[StrictStr] = None + errors: Optional[List[ErrorModel]] = None + meta: Optional[MetaModel] = Field(default=None, description="Metadata") + __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BaseResponseConfigResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if message (nullable) is None + # and model_fields_set contains the field + if self.message is None and "message" in self.model_fields_set: + _dict['message'] = None + + # set to None if errors (nullable) is None + # and model_fields_set contains the field + if self.errors is None and "errors" in self.model_fields_set: + _dict['errors'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BaseResponseConfigResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") if obj.get("status") is not None else True, + "data": ConfigResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, + "message": obj.get("message"), + "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, + "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/revengai/models/config_response.py b/revengai/models/config_response.py new file mode 100644 index 0000000..f61fe46 --- /dev/null +++ b/revengai/models/config_response.py @@ -0,0 +1,90 @@ +# 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 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ConfigResponse(BaseModel): + """ + ConfigResponse + """ # noqa: E501 + dashboard_url: Optional[StrictStr] = Field(default='', description="The domain of the RevEng.AI platform you are connected to") + max_file_size_bytes: StrictInt = Field(description="Maximum file size (in bytes) that can be uploaded for analysis") + ai_decompiler_unsupported_languages: List[StrictStr] = Field(description="List of programming languages that are not supported for AI decompilation") + __properties: ClassVar[List[str]] = ["dashboard_url", "max_file_size_bytes", "ai_decompiler_unsupported_languages"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConfigResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConfigResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dashboard_url": obj.get("dashboard_url") if obj.get("dashboard_url") is not None else '', + "max_file_size_bytes": obj.get("max_file_size_bytes"), + "ai_decompiler_unsupported_languages": obj.get("ai_decompiler_unsupported_languages") + }) + return _obj + + diff --git a/revengai/models/function_list_item.py b/revengai/models/function_list_item.py index 596dd68..f15ed58 100644 --- a/revengai/models/function_list_item.py +++ b/revengai/models/function_list_item.py @@ -18,6 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List +from revengai.models.name_source_type import NameSourceType from typing import Optional, Set from typing_extensions import Self @@ -28,11 +29,12 @@ class FunctionListItem(BaseModel): id: StrictInt = Field(description="Function id") name: StrictStr = Field(description="Name of the function") name_source_type: StrictStr = Field(description="The source (process) the function name came from") + name_source: NameSourceType = Field(description="The source of the current function name.") mangled_name: StrictStr = Field(description="Mangled name of the function") vaddr: StrictInt = Field(description="Function virtual address") size: StrictInt = Field(description="Function size in bytes") debug: StrictBool = Field(description="Whether the function has debug information") - __properties: ClassVar[List[str]] = ["id", "name", "name_source_type", "mangled_name", "vaddr", "size", "debug"] + __properties: ClassVar[List[str]] = ["id", "name", "name_source_type", "name_source", "mangled_name", "vaddr", "size", "debug"] @field_validator('name_source_type') def name_source_type_validate_enum(cls, value): @@ -80,6 +82,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of name_source + if self.name_source: + _dict['name_source'] = self.name_source.to_dict() return _dict @classmethod @@ -95,6 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "name": obj.get("name"), "name_source_type": obj.get("name_source_type"), + "name_source": NameSourceType.from_dict(obj["name_source"]) if obj.get("name_source") is not None else None, "mangled_name": obj.get("mangled_name"), "vaddr": obj.get("vaddr"), "size": obj.get("size"), diff --git a/revengai/models/name_source_type.py b/revengai/models/name_source_type.py new file mode 100644 index 0000000..d088ee3 --- /dev/null +++ b/revengai/models/name_source_type.py @@ -0,0 +1,107 @@ +# 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 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NameSourceType(BaseModel): + """ + NameSourceType + """ # noqa: E501 + type: StrictStr = Field(description="The source (process) the function name came from") + function_id: Optional[StrictInt] = None + binary_id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["type", "function_id", "binary_id"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NameSourceType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if function_id (nullable) is None + # and model_fields_set contains the field + if self.function_id is None and "function_id" in self.model_fields_set: + _dict['function_id'] = None + + # set to None if binary_id (nullable) is None + # and model_fields_set contains the field + if self.binary_id is None and "binary_id" in self.model_fields_set: + _dict['binary_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NameSourceType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "function_id": obj.get("function_id"), + "binary_id": obj.get("binary_id") + }) + return _obj + + diff --git a/test/test_analysis_functions_list.py b/test/test_analysis_functions_list.py index 2ed29d3..f9abf07 100644 --- a/test/test_analysis_functions_list.py +++ b/test/test_analysis_functions_list.py @@ -39,6 +39,10 @@ def make_instance(self, include_optional) -> AnalysisFunctionsList: id = 56, name = '', name_source_type = 'SYSTEM', + name_source = revengai.models.name_source_type.NameSourceType( + type = 'SYSTEM', + function_id = 56, + binary_id = 56, ), mangled_name = '', vaddr = 56, size = 56, @@ -52,6 +56,10 @@ def make_instance(self, include_optional) -> AnalysisFunctionsList: id = 56, name = '', name_source_type = 'SYSTEM', + name_source = revengai.models.name_source_type.NameSourceType( + type = 'SYSTEM', + function_id = 56, + binary_id = 56, ), mangled_name = '', vaddr = 56, size = 56, diff --git a/test/test_base_response_analysis_functions_list.py b/test/test_base_response_analysis_functions_list.py index b3dcba7..267b26e 100644 --- a/test/test_base_response_analysis_functions_list.py +++ b/test/test_base_response_analysis_functions_list.py @@ -41,6 +41,10 @@ def make_instance(self, include_optional) -> BaseResponseAnalysisFunctionsList: id = 56, name = '', name_source_type = 'SYSTEM', + name_source = revengai.models.name_source_type.NameSourceType( + type = 'SYSTEM', + function_id = 56, + binary_id = 56, ), mangled_name = '', vaddr = 56, size = 56, diff --git a/test/test_base_response_config_response.py b/test/test_base_response_config_response.py new file mode 100644 index 0000000..0afb632 --- /dev/null +++ b/test/test_base_response_config_response.py @@ -0,0 +1,67 @@ +# 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.models.base_response_config_response import BaseResponseConfigResponse + +class TestBaseResponseConfigResponse(unittest.TestCase): + """BaseResponseConfigResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResponseConfigResponse: + """Test BaseResponseConfigResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseResponseConfigResponse` + """ + model = BaseResponseConfigResponse() + if include_optional: + return BaseResponseConfigResponse( + status = True, + data = revengai.models.config_response.ConfigResponse( + dashboard_url = '', + max_file_size_bytes = 56, + ai_decompiler_unsupported_languages = [ + '' + ], ), + message = '', + errors = [ + revengai.models.error_model.ErrorModel( + code = '', + message = '', ) + ], + meta = revengai.models.meta_model.MetaModel( + pagination = revengai.models.pagination_model.PaginationModel( + page_size = 56, + page_number = 56, + has_next_page = True, ), ) + ) + else: + return BaseResponseConfigResponse( + ) + """ + + def testBaseResponseConfigResponse(self): + """Test BaseResponseConfigResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_config_response.py b/test/test_config_response.py new file mode 100644 index 0000000..6c038db --- /dev/null +++ b/test/test_config_response.py @@ -0,0 +1,58 @@ +# 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.models.config_response import ConfigResponse + +class TestConfigResponse(unittest.TestCase): + """ConfigResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConfigResponse: + """Test ConfigResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConfigResponse` + """ + model = ConfigResponse() + if include_optional: + return ConfigResponse( + dashboard_url = '', + max_file_size_bytes = 56, + ai_decompiler_unsupported_languages = [ + '' + ] + ) + else: + return ConfigResponse( + max_file_size_bytes = 56, + ai_decompiler_unsupported_languages = [ + '' + ], + ) + """ + + def testConfigResponse(self): + """Test ConfigResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_default_api.py b/test/test_default_api.py new file mode 100644 index 0000000..2b73812 --- /dev/null +++ b/test/test_default_api.py @@ -0,0 +1,37 @@ +# 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_config_v2_config_get(self) -> None: + """Test case for get_config_v2_config_get + + Get Config + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_function_list_item.py b/test/test_function_list_item.py index d61fbfb..c1d6085 100644 --- a/test/test_function_list_item.py +++ b/test/test_function_list_item.py @@ -37,6 +37,10 @@ def make_instance(self, include_optional) -> FunctionListItem: id = 56, name = '', name_source_type = 'SYSTEM', + name_source = revengai.models.name_source_type.NameSourceType( + type = 'SYSTEM', + function_id = 56, + binary_id = 56, ), mangled_name = '', vaddr = 56, size = 56, @@ -47,6 +51,10 @@ def make_instance(self, include_optional) -> FunctionListItem: id = 56, name = '', name_source_type = 'SYSTEM', + name_source = revengai.models.name_source_type.NameSourceType( + type = 'SYSTEM', + function_id = 56, + binary_id = 56, ), mangled_name = '', vaddr = 56, size = 56, diff --git a/test/test_name_source_type.py b/test/test_name_source_type.py new file mode 100644 index 0000000..361b924 --- /dev/null +++ b/test/test_name_source_type.py @@ -0,0 +1,53 @@ +# 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.models.name_source_type import NameSourceType + +class TestNameSourceType(unittest.TestCase): + """NameSourceType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NameSourceType: + """Test NameSourceType + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NameSourceType` + """ + model = NameSourceType() + if include_optional: + return NameSourceType( + type = 'SYSTEM', + function_id = 56, + binary_id = 56 + ) + else: + return NameSourceType( + type = 'SYSTEM', + ) + """ + + def testNameSourceType(self): + """Test NameSourceType""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()