diff --git a/.sdk-version b/.sdk-version index d08ce66..769b20e 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.83.0 +v2.84.0 diff --git a/README.md b/README.md index a0d5223..68ad80a 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**cancel_ai_unstrip**](docs/FunctionsCoreApi.md#cancel_ai_unstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel | Cancels a running ai-unstrip *FunctionsCoreApi* | [**cancel_auto_unstrip**](docs/FunctionsCoreApi.md#cancel_auto_unstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/unstrip/cancel | Cancels a running auto-unstrip *FunctionsCoreApi* | [**get_analysis_strings**](docs/FunctionsCoreApi.md#get_analysis_strings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis +*FunctionsCoreApi* | [**get_analysis_strings_status**](docs/FunctionsCoreApi.md#get_analysis_strings_status) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis *FunctionsCoreApi* | [**get_function_blocks**](docs/FunctionsCoreApi.md#get_function_blocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function *FunctionsCoreApi* | [**get_function_callees_callers**](docs/FunctionsCoreApi.md#get_function_callees_callers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function *FunctionsCoreApi* | [**get_function_capabilities**](docs/FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities @@ -161,6 +162,7 @@ Class | Method | HTTP request | Description - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisScope](docs/AnalysisScope.md) - [AnalysisStringsResponse](docs/AnalysisStringsResponse.md) + - [AnalysisStringsStatusResponse](docs/AnalysisStringsStatusResponse.md) - [AnalysisTags](docs/AnalysisTags.md) - [AnalysisUpdateRequest](docs/AnalysisUpdateRequest.md) - [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md) @@ -181,6 +183,7 @@ Class | Method | HTTP request | Description - [BaseResponseAnalysisFunctions](docs/BaseResponseAnalysisFunctions.md) - [BaseResponseAnalysisFunctionsList](docs/BaseResponseAnalysisFunctionsList.md) - [BaseResponseAnalysisStringsResponse](docs/BaseResponseAnalysisStringsResponse.md) + - [BaseResponseAnalysisStringsStatusResponse](docs/BaseResponseAnalysisStringsStatusResponse.md) - [BaseResponseAnalysisTags](docs/BaseResponseAnalysisTags.md) - [BaseResponseAnalysisUpdateTagsResponse](docs/BaseResponseAnalysisUpdateTagsResponse.md) - [BaseResponseBasic](docs/BaseResponseBasic.md) @@ -244,6 +247,7 @@ Class | Method | HTTP request | Description - [BaseResponseUploadResponse](docs/BaseResponseUploadResponse.md) - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - [Basic](docs/Basic.md) + - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [BinaryAdditionalDetailsDataResponse](docs/BinaryAdditionalDetailsDataResponse.md) - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) - [BinaryConfig](docs/BinaryConfig.md) diff --git a/docs/AnalysisStringsStatusResponse.md b/docs/AnalysisStringsStatusResponse.md new file mode 100644 index 0000000..7159e5f --- /dev/null +++ b/docs/AnalysisStringsStatusResponse.md @@ -0,0 +1,29 @@ +# AnalysisStringsStatusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**BinariesTaskStatus**](BinariesTaskStatus.md) | The current status of the strings extraction task | + +## Example + +```python +from revengai.models.analysis_strings_status_response import AnalysisStringsStatusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisStringsStatusResponse from a JSON string +analysis_strings_status_response_instance = AnalysisStringsStatusResponse.from_json(json) +# print the JSON string representation of the object +print(AnalysisStringsStatusResponse.to_json()) + +# convert the object into a dict +analysis_strings_status_response_dict = analysis_strings_status_response_instance.to_dict() +# create an instance of AnalysisStringsStatusResponse from a dict +analysis_strings_status_response_from_dict = AnalysisStringsStatusResponse.from_dict(analysis_strings_status_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/BaseResponseAnalysisStringsStatusResponse.md b/docs/BaseResponseAnalysisStringsStatusResponse.md new file mode 100644 index 0000000..529a501 --- /dev/null +++ b/docs/BaseResponseAnalysisStringsStatusResponse.md @@ -0,0 +1,33 @@ +# BaseResponseAnalysisStringsStatusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] +**data** | [**AnalysisStringsStatusResponse**](AnalysisStringsStatusResponse.md) | | [optional] +**message** | **str** | | [optional] +**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] +**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] + +## Example + +```python +from revengai.models.base_response_analysis_strings_status_response import BaseResponseAnalysisStringsStatusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResponseAnalysisStringsStatusResponse from a JSON string +base_response_analysis_strings_status_response_instance = BaseResponseAnalysisStringsStatusResponse.from_json(json) +# print the JSON string representation of the object +print(BaseResponseAnalysisStringsStatusResponse.to_json()) + +# convert the object into a dict +base_response_analysis_strings_status_response_dict = base_response_analysis_strings_status_response_instance.to_dict() +# create an instance of BaseResponseAnalysisStringsStatusResponse from a dict +base_response_analysis_strings_status_response_from_dict = BaseResponseAnalysisStringsStatusResponse.from_dict(base_response_analysis_strings_status_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/BinariesTaskStatus.md b/docs/BinariesTaskStatus.md new file mode 100644 index 0000000..331e76a --- /dev/null +++ b/docs/BinariesTaskStatus.md @@ -0,0 +1,18 @@ +# BinariesTaskStatus + + +## Enum + +* `UNINITIALISED` (value: `'UNINITIALISED'`) + +* `PENDING` (value: `'PENDING'`) + +* `RUNNING` (value: `'RUNNING'`) + +* `COMPLETED` (value: `'COMPLETED'`) + +* `FAILED` (value: `'FAILED'`) + +[[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/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 72cf8c2..84d1ffe 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**cancel_ai_unstrip**](FunctionsCoreApi.md#cancel_ai_unstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel | Cancels a running ai-unstrip [**cancel_auto_unstrip**](FunctionsCoreApi.md#cancel_auto_unstrip) | **DELETE** /v2/analyses/{analysis_id}/functions/unstrip/cancel | Cancels a running auto-unstrip [**get_analysis_strings**](FunctionsCoreApi.md#get_analysis_strings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis +[**get_analysis_strings_status**](FunctionsCoreApi.md#get_analysis_strings_status) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis [**get_function_blocks**](FunctionsCoreApi.md#get_function_blocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function [**get_function_callees_callers**](FunctionsCoreApi.md#get_function_callees_callers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function [**get_function_capabilities**](FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities @@ -596,6 +597,86 @@ 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_strings_status** +> BaseResponseAnalysisStringsStatusResponse get_analysis_strings_status(analysis_id) + +Get string processing state for the Analysis + +Get string processing state for the Analysis + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_analysis_strings_status_response import BaseResponseAnalysisStringsStatusResponse +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.FunctionsCoreApi(api_client) + analysis_id = 56 # int | + + try: + # Get string processing state for the Analysis + api_response = api_instance.get_analysis_strings_status(analysis_id) + print("The response of FunctionsCoreApi->get_analysis_strings_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_analysis_strings_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| | + +### Return type + +[**BaseResponseAnalysisStringsStatusResponse**](BaseResponseAnalysisStringsStatusResponse.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_function_blocks** > BaseResponseFunctionBlocksResponse get_function_blocks(function_id) diff --git a/revengai/__init__.py b/revengai/__init__.py index 12e40ab..ebce816 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v2.83.0" +__version__ = "v2.84.0" # Define package exports __all__ = [ @@ -59,6 +59,7 @@ "AnalysisRecord", "AnalysisScope", "AnalysisStringsResponse", + "AnalysisStringsStatusResponse", "AnalysisTags", "AnalysisUpdateRequest", "AnalysisUpdateTagsRequest", @@ -79,6 +80,7 @@ "BaseResponseAnalysisFunctions", "BaseResponseAnalysisFunctionsList", "BaseResponseAnalysisStringsResponse", + "BaseResponseAnalysisStringsStatusResponse", "BaseResponseAnalysisTags", "BaseResponseAnalysisUpdateTagsResponse", "BaseResponseBasic", @@ -142,6 +144,7 @@ "BaseResponseUploadResponse", "BaseResponseVulnerabilities", "Basic", + "BinariesTaskStatus", "BinaryAdditionalDetailsDataResponse", "BinaryAdditionalResponse", "BinaryConfig", @@ -376,6 +379,7 @@ from revengai.models.analysis_record import AnalysisRecord as AnalysisRecord from revengai.models.analysis_scope import AnalysisScope as AnalysisScope from revengai.models.analysis_strings_response import AnalysisStringsResponse as AnalysisStringsResponse +from revengai.models.analysis_strings_status_response import AnalysisStringsStatusResponse as AnalysisStringsStatusResponse from revengai.models.analysis_tags import AnalysisTags as AnalysisTags from revengai.models.analysis_update_request import AnalysisUpdateRequest as AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest as AnalysisUpdateTagsRequest @@ -396,6 +400,7 @@ from revengai.models.base_response_analysis_functions import BaseResponseAnalysisFunctions as BaseResponseAnalysisFunctions from revengai.models.base_response_analysis_functions_list import BaseResponseAnalysisFunctionsList as BaseResponseAnalysisFunctionsList from revengai.models.base_response_analysis_strings_response import BaseResponseAnalysisStringsResponse as BaseResponseAnalysisStringsResponse +from revengai.models.base_response_analysis_strings_status_response import BaseResponseAnalysisStringsStatusResponse as BaseResponseAnalysisStringsStatusResponse from revengai.models.base_response_analysis_tags import BaseResponseAnalysisTags as BaseResponseAnalysisTags from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse as BaseResponseAnalysisUpdateTagsResponse from revengai.models.base_response_basic import BaseResponseBasic as BaseResponseBasic @@ -459,6 +464,7 @@ from revengai.models.base_response_upload_response import BaseResponseUploadResponse as BaseResponseUploadResponse from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities as BaseResponseVulnerabilities from revengai.models.basic import Basic as Basic +from revengai.models.binaries_task_status import BinariesTaskStatus as BinariesTaskStatus from revengai.models.binary_additional_details_data_response import BinaryAdditionalDetailsDataResponse as BinaryAdditionalDetailsDataResponse from revengai.models.binary_additional_response import BinaryAdditionalResponse as BinaryAdditionalResponse from revengai.models.binary_config import BinaryConfig as BinaryConfig diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index db8fccc..ddeeda4 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -23,6 +23,7 @@ from revengai.models.auto_unstrip_request import AutoUnstripRequest from revengai.models.auto_unstrip_response import AutoUnstripResponse from revengai.models.base_response_analysis_strings_response import BaseResponseAnalysisStringsResponse +from revengai.models.base_response_analysis_strings_status_response import BaseResponseAnalysisStringsStatusResponse from revengai.models.base_response_callees_caller_functions_response import BaseResponseCalleesCallerFunctionsResponse from revengai.models.base_response_function_blocks_response import BaseResponseFunctionBlocksResponse from revengai.models.base_response_function_capability_response import BaseResponseFunctionCapabilityResponse @@ -2062,6 +2063,270 @@ def _get_analysis_strings_serialize( + @validate_call + def get_analysis_strings_status( + self, + analysis_id: StrictInt, + _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, + ) -> BaseResponseAnalysisStringsStatusResponse: + """Get string processing state for the Analysis + + Get string processing state for the Analysis + + :param analysis_id: (required) + :type analysis_id: int + :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_strings_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisStringsStatusResponse", + '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_strings_status_with_http_info( + self, + analysis_id: StrictInt, + _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[BaseResponseAnalysisStringsStatusResponse]: + """Get string processing state for the Analysis + + Get string processing state for the Analysis + + :param analysis_id: (required) + :type analysis_id: int + :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_strings_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisStringsStatusResponse", + '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_strings_status_without_preload_content( + self, + analysis_id: StrictInt, + _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 string processing state for the Analysis + + Get string processing state for the Analysis + + :param analysis_id: (required) + :type analysis_id: int + :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_strings_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisStringsStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_analysis_strings_status_serialize( + self, + analysis_id, + _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 + # 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}/functions/strings/status', + 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_function_blocks( self, diff --git a/revengai/api_client.py b/revengai/api_client.py index eff250c..674bd33 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.83.0/python' + self.user_agent = 'OpenAPI-Generator/v2.84.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index dba54e4..70d449b 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.83.0\n"\ - "SDK Package Version: v2.83.0".\ + "Version of the API: v2.84.0\n"\ + "SDK Package Version: v2.84.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 70bef82..57bb83f 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -27,6 +27,7 @@ from revengai.models.analysis_record import AnalysisRecord from revengai.models.analysis_scope import AnalysisScope from revengai.models.analysis_strings_response import AnalysisStringsResponse +from revengai.models.analysis_strings_status_response import AnalysisStringsStatusResponse from revengai.models.analysis_tags import AnalysisTags from revengai.models.analysis_update_request import AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest @@ -47,6 +48,7 @@ from revengai.models.base_response_analysis_functions import BaseResponseAnalysisFunctions from revengai.models.base_response_analysis_functions_list import BaseResponseAnalysisFunctionsList from revengai.models.base_response_analysis_strings_response import BaseResponseAnalysisStringsResponse +from revengai.models.base_response_analysis_strings_status_response import BaseResponseAnalysisStringsStatusResponse from revengai.models.base_response_analysis_tags import BaseResponseAnalysisTags from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse from revengai.models.base_response_basic import BaseResponseBasic @@ -110,6 +112,7 @@ from revengai.models.base_response_upload_response import BaseResponseUploadResponse from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities from revengai.models.basic import Basic +from revengai.models.binaries_task_status import BinariesTaskStatus from revengai.models.binary_additional_details_data_response import BinaryAdditionalDetailsDataResponse from revengai.models.binary_additional_response import BinaryAdditionalResponse from revengai.models.binary_config import BinaryConfig diff --git a/revengai/models/analysis_strings_status_response.py b/revengai/models/analysis_strings_status_response.py new file mode 100644 index 0000000..6464b03 --- /dev/null +++ b/revengai/models/analysis_strings_status_response.py @@ -0,0 +1,87 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from revengai.models.binaries_task_status import BinariesTaskStatus +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisStringsStatusResponse(BaseModel): + """ + AnalysisStringsStatusResponse + """ # noqa: E501 + status: BinariesTaskStatus = Field(description="The current status of the strings extraction task") + __properties: ClassVar[List[str]] = ["status"] + + 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 AnalysisStringsStatusResponse 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 AnalysisStringsStatusResponse 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") + }) + return _obj + + diff --git a/revengai/models/base_response_analysis_strings_status_response.py b/revengai/models/base_response_analysis_strings_status_response.py new file mode 100644 index 0000000..5cdbd06 --- /dev/null +++ b/revengai/models/base_response_analysis_strings_status_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.analysis_strings_status_response import AnalysisStringsStatusResponse +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 BaseResponseAnalysisStringsStatusResponse(BaseModel): + """ + BaseResponseAnalysisStringsStatusResponse + """ # noqa: E501 + status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") + data: Optional[AnalysisStringsStatusResponse] = 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 BaseResponseAnalysisStringsStatusResponse 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 BaseResponseAnalysisStringsStatusResponse 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": AnalysisStringsStatusResponse.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/binaries_task_status.py b/revengai/models/binaries_task_status.py new file mode 100644 index 0000000..b456030 --- /dev/null +++ b/revengai/models/binaries_task_status.py @@ -0,0 +1,39 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class BinariesTaskStatus(str, Enum): + """ + BinariesTaskStatus + """ + + """ + allowed enum values + """ + UNINITIALISED = 'UNINITIALISED' + PENDING = 'PENDING' + RUNNING = 'RUNNING' + COMPLETED = 'COMPLETED' + FAILED = 'FAILED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BinariesTaskStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test/test_analysis_strings_status_response.py b/test/test_analysis_strings_status_response.py new file mode 100644 index 0000000..7838a17 --- /dev/null +++ b/test/test_analysis_strings_status_response.py @@ -0,0 +1,51 @@ +# 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.analysis_strings_status_response import AnalysisStringsStatusResponse + +class TestAnalysisStringsStatusResponse(unittest.TestCase): + """AnalysisStringsStatusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisStringsStatusResponse: + """Test AnalysisStringsStatusResponse + 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 `AnalysisStringsStatusResponse` + """ + model = AnalysisStringsStatusResponse() + if include_optional: + return AnalysisStringsStatusResponse( + status = 'UNINITIALISED' + ) + else: + return AnalysisStringsStatusResponse( + status = 'UNINITIALISED', + ) + """ + + def testAnalysisStringsStatusResponse(self): + """Test AnalysisStringsStatusResponse""" + # 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_base_response_analysis_strings_status_response.py b/test/test_base_response_analysis_strings_status_response.py new file mode 100644 index 0000000..989cb1a --- /dev/null +++ b/test/test_base_response_analysis_strings_status_response.py @@ -0,0 +1,63 @@ +# 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_analysis_strings_status_response import BaseResponseAnalysisStringsStatusResponse + +class TestBaseResponseAnalysisStringsStatusResponse(unittest.TestCase): + """BaseResponseAnalysisStringsStatusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResponseAnalysisStringsStatusResponse: + """Test BaseResponseAnalysisStringsStatusResponse + 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 `BaseResponseAnalysisStringsStatusResponse` + """ + model = BaseResponseAnalysisStringsStatusResponse() + if include_optional: + return BaseResponseAnalysisStringsStatusResponse( + status = True, + data = revengai.models.analysis_strings_status_response.AnalysisStringsStatusResponse( + status = 'UNINITIALISED', ), + 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 BaseResponseAnalysisStringsStatusResponse( + ) + """ + + def testBaseResponseAnalysisStringsStatusResponse(self): + """Test BaseResponseAnalysisStringsStatusResponse""" + # 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_binaries_task_status.py b/test/test_binaries_task_status.py new file mode 100644 index 0000000..ecf0811 --- /dev/null +++ b/test/test_binaries_task_status.py @@ -0,0 +1,32 @@ +# 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.binaries_task_status import BinariesTaskStatus + +class TestBinariesTaskStatus(unittest.TestCase): + """BinariesTaskStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBinariesTaskStatus(self): + """Test BinariesTaskStatus""" + # inst = BinariesTaskStatus() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_functions_core_api.py b/test/test_functions_core_api.py index 44b4b39..7b85882 100644 --- a/test/test_functions_core_api.py +++ b/test/test_functions_core_api.py @@ -74,6 +74,13 @@ def test_get_analysis_strings(self) -> None: """ pass + def test_get_analysis_strings_status(self) -> None: + """Test case for get_analysis_strings_status + + Get string processing state for the Analysis + """ + pass + def test_get_function_blocks(self) -> None: """Test case for get_function_blocks