diff --git a/.sdk-version b/.sdk-version index 151f7f2..0e286b1 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.63.0 +v2.66.0 diff --git a/README.md b/README.md index f4cc78e..ee8e440 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Class | Method | HTTP request | Description *AnalysesDynamicExecutionApi* | [**get_process_registry**](docs/AnalysesDynamicExecutionApi.md#get_process_registry) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-registry | Get the dynamic execution results for process registry *AnalysesDynamicExecutionApi* | [**get_process_tree**](docs/AnalysesDynamicExecutionApi.md#get_process_tree) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/process-tree | Get the dynamic execution results for process tree *AnalysesDynamicExecutionApi* | [**get_ttps**](docs/AnalysesDynamicExecutionApi.md#get_ttps) | **GET** /v2/analyses/{analysis_id}/dynamic-execution/ttps | Get the dynamic execution results for ttps +*AnalysesResultsMetadataApi* | [**get_analysis_functions_paginated**](docs/AnalysesResultsMetadataApi.md#get_analysis_functions_paginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis *AnalysesResultsMetadataApi* | [**get_capabilities**](docs/AnalysesResultsMetadataApi.md#get_capabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis *AnalysesResultsMetadataApi* | [**get_communities**](docs/AnalysesResultsMetadataApi.md#get_communities) | **GET** /v2/analyses/{analysis_id}/communities | Gets the communities found in the analysis *AnalysesResultsMetadataApi* | [**get_functions_list**](docs/AnalysesResultsMetadataApi.md#get_functions_list) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis @@ -93,10 +94,7 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**update_collection**](docs/CollectionsApi.md#update_collection) | **PATCH** /v2/collections/{collection_id} | Updates a collection *CollectionsApi* | [**update_collection_binaries**](docs/CollectionsApi.md#update_collection_binaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries *CollectionsApi* | [**update_collection_tags**](docs/CollectionsApi.md#update_collection_tags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags -*ExternalSourcesApi* | [**create_external_task_mb**](docs/ExternalSourcesApi.md#create_external_task_mb) | **POST** /v2/analysis/{analysis_id}/external/mb | Pulls data from VirusTotal *ExternalSourcesApi* | [**create_external_task_vt**](docs/ExternalSourcesApi.md#create_external_task_vt) | **POST** /v2/analysis/{analysis_id}/external/vt | Pulls data from VirusTotal -*ExternalSourcesApi* | [**get_mb_data**](docs/ExternalSourcesApi.md#get_mb_data) | **GET** /v2/analysis/{analysis_id}/external/mb | Get MalwareBazaar data -*ExternalSourcesApi* | [**get_mb_task_status**](docs/ExternalSourcesApi.md#get_mb_task_status) | **GET** /v2/analysis/{analysis_id}/external/mb/status | Check the status of MalwareBazaar data retrieval *ExternalSourcesApi* | [**get_vt_data**](docs/ExternalSourcesApi.md#get_vt_data) | **GET** /v2/analysis/{analysis_id}/external/vt | Get VirusTotal data *ExternalSourcesApi* | [**get_vt_task_status**](docs/ExternalSourcesApi.md#get_vt_task_status) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval *FirmwareApi* | [**get_binaries_for_firmware_task**](docs/FirmwareApi.md#get_binaries_for_firmware_task) | **GET** /v2/firmware/get-binaries/{task_id} | Upload firmware for unpacking @@ -159,6 +157,7 @@ Class | Method | HTTP request | Description - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) - [AnalysisFunctionMatchingRequest](docs/AnalysisFunctionMatchingRequest.md) - [AnalysisFunctions](docs/AnalysisFunctions.md) + - [AnalysisFunctionsList](docs/AnalysisFunctionsList.md) - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisScope](docs/AnalysisScope.md) - [AnalysisStringsResponse](docs/AnalysisStringsResponse.md) @@ -180,6 +179,7 @@ Class | Method | HTTP request | Description - [BaseResponseAnalysisDetailResponse](docs/BaseResponseAnalysisDetailResponse.md) - [BaseResponseAnalysisFunctionMapping](docs/BaseResponseAnalysisFunctionMapping.md) - [BaseResponseAnalysisFunctions](docs/BaseResponseAnalysisFunctions.md) + - [BaseResponseAnalysisFunctionsList](docs/BaseResponseAnalysisFunctionsList.md) - [BaseResponseAnalysisStringsResponse](docs/BaseResponseAnalysisStringsResponse.md) - [BaseResponseAnalysisTags](docs/BaseResponseAnalysisTags.md) - [BaseResponseAnalysisUpdateTagsResponse](docs/BaseResponseAnalysisUpdateTagsResponse.md) @@ -318,6 +318,7 @@ Class | Method | HTTP request | Description - [FunctionInfoInput](docs/FunctionInfoInput.md) - [FunctionInfoInputFuncDepsInner](docs/FunctionInfoInputFuncDepsInner.md) - [FunctionInfoOutput](docs/FunctionInfoOutput.md) + - [FunctionListItem](docs/FunctionListItem.md) - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) - [FunctionMappingFull](docs/FunctionMappingFull.md) diff --git a/docs/AnalysesResultsMetadataApi.md b/docs/AnalysesResultsMetadataApi.md index 8e201c5..ee7525f 100644 --- a/docs/AnalysesResultsMetadataApi.md +++ b/docs/AnalysesResultsMetadataApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**get_analysis_functions_paginated**](AnalysesResultsMetadataApi.md#get_analysis_functions_paginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis [**get_capabilities**](AnalysesResultsMetadataApi.md#get_capabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis [**get_communities**](AnalysesResultsMetadataApi.md#get_communities) | **GET** /v2/analyses/{analysis_id}/communities | Gets the communities found in the analysis [**get_functions_list**](AnalysesResultsMetadataApi.md#get_functions_list) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis @@ -13,6 +14,90 @@ Method | HTTP request | Description [**get_vulnerabilities**](AnalysesResultsMetadataApi.md#get_vulnerabilities) | **GET** /v2/analyses/{analysis_id}/vulnerabilities | Gets the vulnerabilities found in the analysis +# **get_analysis_functions_paginated** +> BaseResponseAnalysisFunctionsList get_analysis_functions_paginated(analysis_id, page=page, page_size=page_size) + +Get functions from analysis + +Returns a paginated list of functions identified during analysis + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_analysis_functions_list import BaseResponseAnalysisFunctionsList +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.AnalysesResultsMetadataApi(api_client) + analysis_id = 56 # int | + page = 1 # int | The page number to retrieve. (optional) (default to 1) + page_size = 1000 # int | Number of items per page. (optional) (default to 1000) + + try: + # Get functions from analysis + api_response = api_instance.get_analysis_functions_paginated(analysis_id, page=page, page_size=page_size) + print("The response of AnalysesResultsMetadataApi->get_analysis_functions_paginated:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesResultsMetadataApi->get_analysis_functions_paginated: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| | + **page** | **int**| The page number to retrieve. | [optional] [default to 1] + **page_size** | **int**| Number of items per page. | [optional] [default to 1000] + +### Return type + +[**BaseResponseAnalysisFunctionsList**](BaseResponseAnalysisFunctionsList.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_capabilities** > BaseResponseCapabilities get_capabilities(analysis_id) diff --git a/docs/AnalysisFunctionsList.md b/docs/AnalysisFunctionsList.md new file mode 100644 index 0000000..e6cf230 --- /dev/null +++ b/docs/AnalysisFunctionsList.md @@ -0,0 +1,30 @@ +# AnalysisFunctionsList + +API response schema for paginated functions list + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[FunctionListItem]**](FunctionListItem.md) | The functions associated with the analysis | + +## Example + +```python +from revengai.models.analysis_functions_list import AnalysisFunctionsList + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisFunctionsList from a JSON string +analysis_functions_list_instance = AnalysisFunctionsList.from_json(json) +# print the JSON string representation of the object +print(AnalysisFunctionsList.to_json()) + +# convert the object into a dict +analysis_functions_list_dict = analysis_functions_list_instance.to_dict() +# create an instance of AnalysisFunctionsList from a dict +analysis_functions_list_from_dict = AnalysisFunctionsList.from_dict(analysis_functions_list_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/BaseResponseAnalysisFunctionsList.md b/docs/BaseResponseAnalysisFunctionsList.md new file mode 100644 index 0000000..f116d31 --- /dev/null +++ b/docs/BaseResponseAnalysisFunctionsList.md @@ -0,0 +1,33 @@ +# BaseResponseAnalysisFunctionsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] +**data** | [**AnalysisFunctionsList**](AnalysisFunctionsList.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_functions_list import BaseResponseAnalysisFunctionsList + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResponseAnalysisFunctionsList from a JSON string +base_response_analysis_functions_list_instance = BaseResponseAnalysisFunctionsList.from_json(json) +# print the JSON string representation of the object +print(BaseResponseAnalysisFunctionsList.to_json()) + +# convert the object into a dict +base_response_analysis_functions_list_dict = base_response_analysis_functions_list_instance.to_dict() +# create an instance of BaseResponseAnalysisFunctionsList from a dict +base_response_analysis_functions_list_from_dict = BaseResponseAnalysisFunctionsList.from_dict(base_response_analysis_functions_list_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/ExternalSourcesApi.md b/docs/ExternalSourcesApi.md index 1c0abdd..dbae590 100644 --- a/docs/ExternalSourcesApi.md +++ b/docs/ExternalSourcesApi.md @@ -4,93 +4,11 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_external_task_mb**](ExternalSourcesApi.md#create_external_task_mb) | **POST** /v2/analysis/{analysis_id}/external/mb | Pulls data from VirusTotal [**create_external_task_vt**](ExternalSourcesApi.md#create_external_task_vt) | **POST** /v2/analysis/{analysis_id}/external/vt | Pulls data from VirusTotal -[**get_mb_data**](ExternalSourcesApi.md#get_mb_data) | **GET** /v2/analysis/{analysis_id}/external/mb | Get MalwareBazaar data -[**get_mb_task_status**](ExternalSourcesApi.md#get_mb_task_status) | **GET** /v2/analysis/{analysis_id}/external/mb/status | Check the status of MalwareBazaar data retrieval [**get_vt_data**](ExternalSourcesApi.md#get_vt_data) | **GET** /v2/analysis/{analysis_id}/external/vt | Get VirusTotal data [**get_vt_task_status**](ExternalSourcesApi.md#get_vt_task_status) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval -# **create_external_task_mb** -> BaseResponseStr create_external_task_mb(analysis_id) - -Pulls data from VirusTotal - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_str import BaseResponseStr -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.ExternalSourcesApi(api_client) - analysis_id = 56 # int | - - try: - # Pulls data from VirusTotal - api_response = api_instance.create_external_task_mb(analysis_id) - print("The response of ExternalSourcesApi->create_external_task_mb:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ExternalSourcesApi->create_external_task_mb: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - -### Return type - -[**BaseResponseStr**](BaseResponseStr.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**202** | Successful Response | - | -**422** | Invalid request parameters | - | -**409** | Request already queued | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **create_external_task_vt** > BaseResponseStr create_external_task_vt(analysis_id) @@ -170,163 +88,6 @@ 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_mb_data** -> BaseResponseExternalResponse get_mb_data(analysis_id) - -Get MalwareBazaar data - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_external_response import BaseResponseExternalResponse -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.ExternalSourcesApi(api_client) - analysis_id = 56 # int | - - try: - # Get MalwareBazaar data - api_response = api_instance.get_mb_data(analysis_id) - print("The response of ExternalSourcesApi->get_mb_data:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ExternalSourcesApi->get_mb_data: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - -### Return type - -[**BaseResponseExternalResponse**](BaseResponseExternalResponse.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 | - | -**404** | No data retrieved from MalwareBazaar for the given analysis_id | - | - -[[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_mb_task_status** -> BaseResponseTaskResponse get_mb_task_status(analysis_id) - -Check the status of MalwareBazaar data retrieval - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_task_response import BaseResponseTaskResponse -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.ExternalSourcesApi(api_client) - analysis_id = 56 # int | - - try: - # Check the status of MalwareBazaar data retrieval - api_response = api_instance.get_mb_task_status(analysis_id) - print("The response of ExternalSourcesApi->get_mb_task_status:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ExternalSourcesApi->get_mb_task_status: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - -### Return type - -[**BaseResponseTaskResponse**](BaseResponseTaskResponse.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_vt_data** > BaseResponseExternalResponse get_vt_data(analysis_id) diff --git a/docs/FunctionListItem.md b/docs/FunctionListItem.md new file mode 100644 index 0000000..af49a44 --- /dev/null +++ b/docs/FunctionListItem.md @@ -0,0 +1,34 @@ +# FunctionListItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Function id | +**name** | **str** | Name of the function | +**mangled_name** | **str** | Mangled name of the function | +**vaddr** | **int** | Function virtual address | +**size** | **int** | Function size in bytes | +**debug** | **bool** | Whether the function has debug information | + +## Example + +```python +from revengai.models.function_list_item import FunctionListItem + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionListItem from a JSON string +function_list_item_instance = FunctionListItem.from_json(json) +# print the JSON string representation of the object +print(FunctionListItem.to_json()) + +# convert the object into a dict +function_list_item_dict = function_list_item_instance.to_dict() +# create an instance of FunctionListItem from a dict +function_list_item_from_dict = FunctionListItem.from_dict(function_list_item_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 7dc5166..3c3a530 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v2.63.0" +__version__ = "v2.66.0" # Define package exports __all__ = [ @@ -55,6 +55,7 @@ "AnalysisFunctionMapping", "AnalysisFunctionMatchingRequest", "AnalysisFunctions", + "AnalysisFunctionsList", "AnalysisRecord", "AnalysisScope", "AnalysisStringsResponse", @@ -76,6 +77,7 @@ "BaseResponseAnalysisDetailResponse", "BaseResponseAnalysisFunctionMapping", "BaseResponseAnalysisFunctions", + "BaseResponseAnalysisFunctionsList", "BaseResponseAnalysisStringsResponse", "BaseResponseAnalysisTags", "BaseResponseAnalysisUpdateTagsResponse", @@ -214,6 +216,7 @@ "FunctionInfoInput", "FunctionInfoInputFuncDepsInner", "FunctionInfoOutput", + "FunctionListItem", "FunctionLocalVariableResponse", "FunctionMapping", "FunctionMappingFull", @@ -369,6 +372,7 @@ from revengai.models.analysis_function_mapping import AnalysisFunctionMapping as AnalysisFunctionMapping from revengai.models.analysis_function_matching_request import AnalysisFunctionMatchingRequest as AnalysisFunctionMatchingRequest from revengai.models.analysis_functions import AnalysisFunctions as AnalysisFunctions +from revengai.models.analysis_functions_list import AnalysisFunctionsList as AnalysisFunctionsList 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 @@ -390,6 +394,7 @@ from revengai.models.base_response_analysis_detail_response import BaseResponseAnalysisDetailResponse as BaseResponseAnalysisDetailResponse from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping as BaseResponseAnalysisFunctionMapping 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_tags import BaseResponseAnalysisTags as BaseResponseAnalysisTags from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse as BaseResponseAnalysisUpdateTagsResponse @@ -528,6 +533,7 @@ from revengai.models.function_info_input import FunctionInfoInput as FunctionInfoInput from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner as FunctionInfoInputFuncDepsInner from revengai.models.function_info_output import FunctionInfoOutput as FunctionInfoOutput +from revengai.models.function_list_item import FunctionListItem as FunctionListItem from revengai.models.function_local_variable_response import FunctionLocalVariableResponse as FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping as FunctionMapping from revengai.models.function_mapping_full import FunctionMappingFull as FunctionMappingFull diff --git a/revengai/api/analyses_results_metadata_api.py b/revengai/api/analyses_results_metadata_api.py index aaaed44..6cd2205 100644 --- a/revengai/api/analyses_results_metadata_api.py +++ b/revengai/api/analyses_results_metadata_api.py @@ -19,6 +19,7 @@ from typing import Any, Optional from typing_extensions import Annotated 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_tags import BaseResponseAnalysisTags from revengai.models.base_response_capabilities import BaseResponseCapabilities from revengai.models.base_response_communities import BaseResponseCommunities @@ -43,6 +44,304 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def get_analysis_functions_paginated( + self, + analysis_id: StrictInt, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of items per page.")] = 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, + ) -> BaseResponseAnalysisFunctionsList: + """Get functions from analysis + + Returns a paginated list of functions identified during analysis + + :param analysis_id: (required) + :type analysis_id: int + :param page: The page number to retrieve. + :type page: int + :param page_size: Number of items per page. + :type page_size: 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_functions_paginated_serialize( + analysis_id=analysis_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionsList", + '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_functions_paginated_with_http_info( + self, + analysis_id: StrictInt, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of items per page.")] = 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[BaseResponseAnalysisFunctionsList]: + """Get functions from analysis + + Returns a paginated list of functions identified during analysis + + :param analysis_id: (required) + :type analysis_id: int + :param page: The page number to retrieve. + :type page: int + :param page_size: Number of items per page. + :type page_size: 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_functions_paginated_serialize( + analysis_id=analysis_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionsList", + '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_functions_paginated_without_preload_content( + self, + analysis_id: StrictInt, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of items per page.")] = 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 functions from analysis + + Returns a paginated list of functions identified during analysis + + :param analysis_id: (required) + :type analysis_id: int + :param page: The page number to retrieve. + :type page: int + :param page_size: Number of items per page. + :type page_size: 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_functions_paginated_serialize( + analysis_id=analysis_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionsList", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_analysis_functions_paginated_serialize( + self, + analysis_id, + page, + page_size, + _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 + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + # 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', + 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_capabilities( self, diff --git a/revengai/api/external_sources_api.py b/revengai/api/external_sources_api.py index 9c9ab9d..7b5d03a 100644 --- a/revengai/api/external_sources_api.py +++ b/revengai/api/external_sources_api.py @@ -38,270 +38,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call - def create_external_task_mb( - 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, - ) -> BaseResponseStr: - """Pulls data from VirusTotal - - - :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._create_external_task_mb_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]] = { - '202': "BaseResponseStr", - '422': "BaseResponse", - '409': "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 create_external_task_mb_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[BaseResponseStr]: - """Pulls data from VirusTotal - - - :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._create_external_task_mb_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]] = { - '202': "BaseResponseStr", - '422': "BaseResponse", - '409': "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 create_external_task_mb_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: - """Pulls data from VirusTotal - - - :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._create_external_task_mb_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]] = { - '202': "BaseResponseStr", - '422': "BaseResponse", - '409': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_external_task_mb_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='POST', - resource_path='/v2/analysis/{analysis_id}/external/mb', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call def create_external_task_vt( self, @@ -566,531 +302,6 @@ def _create_external_task_vt_serialize( - @validate_call - def get_mb_data( - 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, - ) -> BaseResponseExternalResponse: - """Get MalwareBazaar data - - - :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_mb_data_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': "BaseResponseExternalResponse", - '422': "BaseResponse", - '404': "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_mb_data_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[BaseResponseExternalResponse]: - """Get MalwareBazaar data - - - :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_mb_data_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': "BaseResponseExternalResponse", - '422': "BaseResponse", - '404': "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_mb_data_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 MalwareBazaar data - - - :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_mb_data_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': "BaseResponseExternalResponse", - '422': "BaseResponse", - '404': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_mb_data_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/analysis/{analysis_id}/external/mb', - 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_mb_task_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, - ) -> BaseResponseTaskResponse: - """Check the status of MalwareBazaar data retrieval - - - :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_mb_task_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': "BaseResponseTaskResponse", - '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_mb_task_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[BaseResponseTaskResponse]: - """Check the status of MalwareBazaar data retrieval - - - :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_mb_task_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': "BaseResponseTaskResponse", - '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_mb_task_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: - """Check the status of MalwareBazaar data retrieval - - - :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_mb_task_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': "BaseResponseTaskResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_mb_task_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/analysis/{analysis_id}/external/mb/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_vt_data( self, diff --git a/revengai/api_client.py b/revengai/api_client.py index aa35597..ad32db4 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.63.0/python' + self.user_agent = 'OpenAPI-Generator/v2.66.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 76bd184..8dee802 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.63.0\n"\ - "SDK Package Version: v2.63.0".\ + "Version of the API: v2.66.0\n"\ + "SDK Package Version: v2.66.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 b3561e8..33a1c7d 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -23,6 +23,7 @@ from revengai.models.analysis_function_mapping import AnalysisFunctionMapping from revengai.models.analysis_function_matching_request import AnalysisFunctionMatchingRequest from revengai.models.analysis_functions import AnalysisFunctions +from revengai.models.analysis_functions_list import AnalysisFunctionsList from revengai.models.analysis_record import AnalysisRecord from revengai.models.analysis_scope import AnalysisScope from revengai.models.analysis_strings_response import AnalysisStringsResponse @@ -44,6 +45,7 @@ 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_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_tags import BaseResponseAnalysisTags from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse @@ -182,6 +184,7 @@ from revengai.models.function_info_input import FunctionInfoInput from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner from revengai.models.function_info_output import FunctionInfoOutput +from revengai.models.function_list_item import FunctionListItem from revengai.models.function_local_variable_response import FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping from revengai.models.function_mapping_full import FunctionMappingFull diff --git a/revengai/models/analysis_functions_list.py b/revengai/models/analysis_functions_list.py new file mode 100644 index 0000000..2043bef --- /dev/null +++ b/revengai/models/analysis_functions_list.py @@ -0,0 +1,94 @@ +# 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.function_list_item import FunctionListItem +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisFunctionsList(BaseModel): + """ + API response schema for paginated functions list + """ # noqa: E501 + functions: List[FunctionListItem] = Field(description="The functions associated with the analysis") + __properties: ClassVar[List[str]] = ["functions"] + + 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 AnalysisFunctionsList 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 each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisFunctionsList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [FunctionListItem.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None + }) + return _obj + + diff --git a/revengai/models/base_response_analysis_functions_list.py b/revengai/models/base_response_analysis_functions_list.py new file mode 100644 index 0000000..1e06c6a --- /dev/null +++ b/revengai/models/base_response_analysis_functions_list.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_functions_list import AnalysisFunctionsList +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 BaseResponseAnalysisFunctionsList(BaseModel): + """ + BaseResponseAnalysisFunctionsList + """ # noqa: E501 + status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") + data: Optional[AnalysisFunctionsList] = 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 BaseResponseAnalysisFunctionsList 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 BaseResponseAnalysisFunctionsList 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": AnalysisFunctionsList.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/function_list_item.py b/revengai/models/function_list_item.py new file mode 100644 index 0000000..7be13c5 --- /dev/null +++ b/revengai/models/function_list_item.py @@ -0,0 +1,96 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class FunctionListItem(BaseModel): + """ + FunctionListItem + """ # noqa: E501 + id: StrictInt = Field(description="Function id") + name: StrictStr = Field(description="Name of the function") + 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", "mangled_name", "vaddr", "size", "debug"] + + 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 FunctionListItem 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 FunctionListItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "mangled_name": obj.get("mangled_name"), + "vaddr": obj.get("vaddr"), + "size": obj.get("size"), + "debug": obj.get("debug") + }) + return _obj + + diff --git a/test/test_analyses_results_metadata_api.py b/test/test_analyses_results_metadata_api.py index 9563c4a..2967be5 100644 --- a/test/test_analyses_results_metadata_api.py +++ b/test/test_analyses_results_metadata_api.py @@ -25,6 +25,13 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_get_analysis_functions_paginated(self) -> None: + """Test case for get_analysis_functions_paginated + + Get functions from analysis + """ + pass + def test_get_capabilities(self) -> None: """Test case for get_capabilities diff --git a/test/test_analysis_functions_list.py b/test/test_analysis_functions_list.py new file mode 100644 index 0000000..044cf9e --- /dev/null +++ b/test/test_analysis_functions_list.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.analysis_functions_list import AnalysisFunctionsList + +class TestAnalysisFunctionsList(unittest.TestCase): + """AnalysisFunctionsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisFunctionsList: + """Test AnalysisFunctionsList + 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 `AnalysisFunctionsList` + """ + model = AnalysisFunctionsList() + if include_optional: + return AnalysisFunctionsList( + functions = [ + revengai.models.function_list_item.FunctionListItem( + id = 56, + name = '', + mangled_name = '', + vaddr = 56, + size = 56, + debug = True, ) + ] + ) + else: + return AnalysisFunctionsList( + functions = [ + revengai.models.function_list_item.FunctionListItem( + id = 56, + name = '', + mangled_name = '', + vaddr = 56, + size = 56, + debug = True, ) + ], + ) + """ + + def testAnalysisFunctionsList(self): + """Test AnalysisFunctionsList""" + # 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_functions_list.py b/test/test_base_response_analysis_functions_list.py new file mode 100644 index 0000000..8ea1885 --- /dev/null +++ b/test/test_base_response_analysis_functions_list.py @@ -0,0 +1,71 @@ +# 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_functions_list import BaseResponseAnalysisFunctionsList + +class TestBaseResponseAnalysisFunctionsList(unittest.TestCase): + """BaseResponseAnalysisFunctionsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResponseAnalysisFunctionsList: + """Test BaseResponseAnalysisFunctionsList + 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 `BaseResponseAnalysisFunctionsList` + """ + model = BaseResponseAnalysisFunctionsList() + if include_optional: + return BaseResponseAnalysisFunctionsList( + status = True, + data = revengai.models.analysis_functions_list.AnalysisFunctionsList( + functions = [ + revengai.models.function_list_item.FunctionListItem( + id = 56, + name = '', + mangled_name = '', + vaddr = 56, + size = 56, + debug = True, ) + ], ), + 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 BaseResponseAnalysisFunctionsList( + ) + """ + + def testBaseResponseAnalysisFunctionsList(self): + """Test BaseResponseAnalysisFunctionsList""" + # 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_external_sources_api.py b/test/test_external_sources_api.py index 2db6ca2..3ef3051 100644 --- a/test/test_external_sources_api.py +++ b/test/test_external_sources_api.py @@ -25,13 +25,6 @@ def setUp(self) -> None: def tearDown(self) -> None: pass - def test_create_external_task_mb(self) -> None: - """Test case for create_external_task_mb - - Pulls data from VirusTotal - """ - pass - def test_create_external_task_vt(self) -> None: """Test case for create_external_task_vt @@ -39,20 +32,6 @@ def test_create_external_task_vt(self) -> None: """ pass - def test_get_mb_data(self) -> None: - """Test case for get_mb_data - - Get MalwareBazaar data - """ - pass - - def test_get_mb_task_status(self) -> None: - """Test case for get_mb_task_status - - Check the status of MalwareBazaar data retrieval - """ - pass - def test_get_vt_data(self) -> None: """Test case for get_vt_data diff --git a/test/test_function_list_item.py b/test/test_function_list_item.py new file mode 100644 index 0000000..86a4a20 --- /dev/null +++ b/test/test_function_list_item.py @@ -0,0 +1,61 @@ +# 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.function_list_item import FunctionListItem + +class TestFunctionListItem(unittest.TestCase): + """FunctionListItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FunctionListItem: + """Test FunctionListItem + 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 `FunctionListItem` + """ + model = FunctionListItem() + if include_optional: + return FunctionListItem( + id = 56, + name = '', + mangled_name = '', + vaddr = 56, + size = 56, + debug = True + ) + else: + return FunctionListItem( + id = 56, + name = '', + mangled_name = '', + vaddr = 56, + size = 56, + debug = True, + ) + """ + + def testFunctionListItem(self): + """Test FunctionListItem""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()