From 63a31c334d5bfe4ea9096522ab68d10dbf432cd7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 3 Jun 2026 07:55:16 +0000 Subject: [PATCH] Update SDK to version v3.86.8 - Generated from OpenAPI spec version v3.86.8 - Auto-generated by GitHub Actions --- README.md | 17 +- docs/AddCalleeInputBody.md | 33 + docs/AnalysesCoreApi.md | 278 +++ docs/AnalysisLogMessage.md | 30 + docs/AnalysisLogs.md | 30 + docs/AnalysisStringFunction.md | 30 + docs/AnalysisStringItem.md | 31 + docs/DynamicExecutionStatusResponse.md | 1 + docs/FunctionStringItem.md | 31 + docs/FunctionsCoreApi.md | 276 +++ docs/GetAnalysisStringsStatusOutputBody.md | 29 + docs/ListAnalysisStringsOutputBody.md | 30 + docs/ListFunctionStringsOutputBody.md | 30 + docs/StringsApi.md | 188 -- revengai/__init__.py | 20 +- revengai/api/__init__.py | 1 - revengai/api/analyses_core_api.py | 1494 ++++++++++--- revengai/api/functions_core_api.py | 1964 ++++++++++++----- revengai/api/strings_api.py | 641 ------ revengai/models/__init__.py | 9 + revengai/models/add_callee_input_body.py | 108 + revengai/models/analysis_log_message.py | 111 + revengai/models/analysis_logs.py | 114 + revengai/models/analysis_string_function.py | 106 + revengai/models/analysis_string_item.py | 116 + .../dynamic_execution_status_response.py | 8 +- revengai/models/function_string_item.py | 103 + ...get_analysis_strings_status_output_body.py | 99 + .../list_analysis_strings_output_body.py | 114 + .../list_function_strings_output_body.py | 114 + 30 files changed, 4534 insertions(+), 1622 deletions(-) create mode 100644 docs/AddCalleeInputBody.md create mode 100644 docs/AnalysisLogMessage.md create mode 100644 docs/AnalysisLogs.md create mode 100644 docs/AnalysisStringFunction.md create mode 100644 docs/AnalysisStringItem.md create mode 100644 docs/FunctionStringItem.md create mode 100644 docs/GetAnalysisStringsStatusOutputBody.md create mode 100644 docs/ListAnalysisStringsOutputBody.md create mode 100644 docs/ListFunctionStringsOutputBody.md delete mode 100644 docs/StringsApi.md delete mode 100644 revengai/api/strings_api.py create mode 100644 revengai/models/add_callee_input_body.py create mode 100644 revengai/models/analysis_log_message.py create mode 100644 revengai/models/analysis_logs.py create mode 100644 revengai/models/analysis_string_function.py create mode 100644 revengai/models/analysis_string_item.py create mode 100644 revengai/models/function_string_item.py create mode 100644 revengai/models/get_analysis_strings_status_output_body.py create mode 100644 revengai/models/list_analysis_strings_output_body.py create mode 100644 revengai/models/list_function_strings_output_body.py diff --git a/README.md b/README.md index 84e48932..1352000f 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Class | Method | HTTP request | Description *AnalysesCommentsApi* | [**delete_analysis_comment**](docs/AnalysesCommentsApi.md#delete_analysis_comment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment *AnalysesCommentsApi* | [**get_analysis_comments**](docs/AnalysesCommentsApi.md#get_analysis_comments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis *AnalysesCommentsApi* | [**update_analysis_comment**](docs/AnalysesCommentsApi.md#update_analysis_comment) | **PATCH** /v2/analyses/{analysis_id}/comments/{comment_id} | Update a comment +*AnalysesCoreApi* | [**add_user_string_to_analysis**](docs/AnalysesCoreApi.md#add_user_string_to_analysis) | **POST** /v3/analyses/{analysis_id}/user-provided-strings | Add a user-provided string to an analysis. *AnalysesCoreApi* | [**create_analysis**](docs/AnalysesCoreApi.md#create_analysis) | **POST** /v2/analyses | Create Analysis *AnalysesCoreApi* | [**delete_analysis**](docs/AnalysesCoreApi.md#delete_analysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis *AnalysesCoreApi* | [**get_analysis_basic_info**](docs/AnalysesCoreApi.md#get_analysis_basic_info) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information @@ -65,6 +66,8 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**get_analysis_params**](docs/AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information *AnalysesCoreApi* | [**get_analysis_queue_position**](docs/AnalysesCoreApi.md#get_analysis_queue_position) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis *AnalysesCoreApi* | [**get_analysis_status**](docs/AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis +*AnalysesCoreApi* | [**get_analysis_strings**](docs/AnalysesCoreApi.md#get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. +*AnalysesCoreApi* | [**get_analysis_strings_status**](docs/AnalysesCoreApi.md#get_analysis_strings_status) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. *AnalysesCoreApi* | [**insert_analysis_log**](docs/AnalysesCoreApi.md#insert_analysis_log) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis *AnalysesCoreApi* | [**list_analyses**](docs/AnalysesCoreApi.md#list_analyses) | **GET** /v2/analyses/list | Gets the most recent analyses *AnalysesCoreApi* | [**lookup_binary_id**](docs/AnalysesCoreApi.md#lookup_binary_id) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID @@ -134,6 +137,8 @@ Class | Method | HTTP request | Description *FunctionsAIDecompilationApi* | [**update_ai_decompilation_comment**](docs/FunctionsAIDecompilationApi.md#update_ai_decompilation_comment) | **PATCH** /v2/functions/{function_id}/ai-decompilation/comments/{comment_id} | Update a comment *FunctionsAIDecompilationApi* | [**upsert_ai_decompilation_overrides**](docs/FunctionsAIDecompilationApi.md#upsert_ai_decompilation_overrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides *FunctionsAIDecompilationApi* | [**upsert_ai_decompilation_rating**](docs/FunctionsAIDecompilationApi.md#upsert_ai_decompilation_rating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation +*FunctionsCoreApi* | [**add_function_callee**](docs/FunctionsCoreApi.md#add_function_callee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function +*FunctionsCoreApi* | [**add_user_string_to_function**](docs/FunctionsCoreApi.md#add_user_string_to_function) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. *FunctionsCoreApi* | [**ai_unstrip**](docs/FunctionsCoreApi.md#ai_unstrip) | **POST** /v2/analyses/{analysis_id}/functions/ai-unstrip | Performs matching and auto-unstrip for an analysis and its functions *FunctionsCoreApi* | [**analysis_function_matching**](docs/FunctionsCoreApi.md#analysis_function_matching) | **POST** /v2/analyses/{analysis_id}/functions/matches | Perform matching for the functions of an analysis *FunctionsCoreApi* | [**auto_unstrip**](docs/FunctionsCoreApi.md#auto_unstrip) | **POST** /v2/analyses/{analysis_id}/functions/auto-unstrip | Performs matching and auto-unstrip for an analysis and its functions @@ -148,6 +153,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**get_function_capabilities**](docs/FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities *FunctionsCoreApi* | [**get_function_details**](docs/FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details *FunctionsCoreApi* | [**get_function_strings**](docs/FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function +*FunctionsCoreApi* | [**get_function_strings_0**](docs/FunctionsCoreApi.md#get_function_strings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. *FunctionsDataTypesApi* | [**generate_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types *FunctionsDataTypesApi* | [**generate_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_functions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions *FunctionsDataTypesApi* | [**get_function_data_types**](docs/FunctionsDataTypesApi.md#get_function_data_types) | **GET** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types @@ -170,13 +176,12 @@ Class | Method | HTTP request | Description *SearchApi* | [**search_collections**](docs/SearchApi.md#search_collections) | **GET** /v2/search/collections | Collections search *SearchApi* | [**search_functions**](docs/SearchApi.md#search_functions) | **GET** /v2/search/functions | Functions search *SearchApi* | [**search_tags**](docs/SearchApi.md#search_tags) | **GET** /v2/search/tags | Tags search -*StringsApi* | [**add_user_string_to_analysis**](docs/StringsApi.md#add_user_string_to_analysis) | **POST** /v3/analyses/{analysis_id}/user-provided-strings | Add a user-provided string to an analysis. -*StringsApi* | [**add_user_string_to_function**](docs/StringsApi.md#add_user_string_to_function) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. ## Documentation For Models - [APIError](docs/APIError.md) + - [AddCalleeInputBody](docs/AddCalleeInputBody.md) - [AddUserStringInputBody](docs/AddUserStringInputBody.md) - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) @@ -196,10 +201,14 @@ Class | Method | HTTP request | Description - [AnalysisFunctionMatchingRequest](docs/AnalysisFunctionMatchingRequest.md) - [AnalysisFunctions](docs/AnalysisFunctions.md) - [AnalysisFunctionsList](docs/AnalysisFunctionsList.md) + - [AnalysisLogMessage](docs/AnalysisLogMessage.md) + - [AnalysisLogs](docs/AnalysisLogs.md) - [AnalysisRecord](docs/AnalysisRecord.md) - [AnalysisReport](docs/AnalysisReport.md) - [AnalysisScope](docs/AnalysisScope.md) + - [AnalysisStringFunction](docs/AnalysisStringFunction.md) - [AnalysisStringInput](docs/AnalysisStringInput.md) + - [AnalysisStringItem](docs/AnalysisStringItem.md) - [AnalysisStringsResponse](docs/AnalysisStringsResponse.md) - [AnalysisStringsStatusResponse](docs/AnalysisStringsStatusResponse.md) - [AnalysisTags](docs/AnalysisTags.md) @@ -422,6 +431,7 @@ Class | Method | HTTP request | Description - [FunctionSearchResult](docs/FunctionSearchResult.md) - [FunctionSourceType](docs/FunctionSourceType.md) - [FunctionString](docs/FunctionString.md) + - [FunctionStringItem](docs/FunctionStringItem.md) - [FunctionStringsResponse](docs/FunctionStringsResponse.md) - [FunctionTaskResponse](docs/FunctionTaskResponse.md) - [FunctionTaskStatus](docs/FunctionTaskStatus.md) @@ -434,6 +444,7 @@ Class | Method | HTTP request | Description - [GenerationStatusList](docs/GenerationStatusList.md) - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAiDecompilationTask](docs/GetAiDecompilationTask.md) + - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GlobalVariable](docs/GlobalVariable.md) - [HistoryEntry](docs/HistoryEntry.md) @@ -447,7 +458,9 @@ Class | Method | HTTP request | Description - [InverseFunctionMapItem](docs/InverseFunctionMapItem.md) - [InverseStringMapItem](docs/InverseStringMapItem.md) - [InverseValue](docs/InverseValue.md) + - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) + - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) - [Logs](docs/Logs.md) - [MITRETechnique](docs/MITRETechnique.md) - [MatchedFunction](docs/MatchedFunction.md) diff --git a/docs/AddCalleeInputBody.md b/docs/AddCalleeInputBody.md new file mode 100644 index 00000000..1eb12d98 --- /dev/null +++ b/docs/AddCalleeInputBody.md @@ -0,0 +1,33 @@ +# AddCalleeInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**callee_function_id** | **int** | Internal callee function ID; 0 means not provided | [optional] +**callee_name** | **str** | Callee name (for external calls) | [optional] +**callee_vaddr** | **int** | Virtual address of the callee | +**is_external** | **bool** | Whether the callee is outside the binary | +**thunked_vaddr** | **int** | Thunked virtual address | [optional] + +## Example + +```python +from revengai.models.add_callee_input_body import AddCalleeInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AddCalleeInputBody from a JSON string +add_callee_input_body_instance = AddCalleeInputBody.from_json(json) +# print the JSON string representation of the object +print(AddCalleeInputBody.to_json()) + +# convert the object into a dict +add_callee_input_body_dict = add_callee_input_body_instance.to_dict() +# create an instance of AddCalleeInputBody from a dict +add_callee_input_body_from_dict = AddCalleeInputBody.from_dict(add_callee_input_body_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/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 9c6529d0..fc84b634 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**add_user_string_to_analysis**](AnalysesCoreApi.md#add_user_string_to_analysis) | **POST** /v3/analyses/{analysis_id}/user-provided-strings | Add a user-provided string to an analysis. [**create_analysis**](AnalysesCoreApi.md#create_analysis) | **POST** /v2/analyses | Create Analysis [**delete_analysis**](AnalysesCoreApi.md#delete_analysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis [**get_analysis_basic_info**](AnalysesCoreApi.md#get_analysis_basic_info) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information @@ -13,6 +14,8 @@ Method | HTTP request | Description [**get_analysis_params**](AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information [**get_analysis_queue_position**](AnalysesCoreApi.md#get_analysis_queue_position) | **GET** /v2/analyses/{analysis_id}/queue-position | Get the queue position of an analysis [**get_analysis_status**](AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis +[**get_analysis_strings**](AnalysesCoreApi.md#get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. +[**get_analysis_strings_status**](AnalysesCoreApi.md#get_analysis_strings_status) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. [**insert_analysis_log**](AnalysesCoreApi.md#insert_analysis_log) | **POST** /v2/analyses/{analysis_id}/logs | Insert a log entry for an analysis [**list_analyses**](AnalysesCoreApi.md#list_analyses) | **GET** /v2/analyses/list | Gets the most recent analyses [**lookup_binary_id**](AnalysesCoreApi.md#lookup_binary_id) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID @@ -23,6 +26,95 @@ Method | HTTP request | Description [**upload_file**](AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File +# **add_user_string_to_analysis** +> Dict[str, object] add_user_string_to_analysis(analysis_id, add_user_string_input_body) + +Add a user-provided string to an analysis. + +Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.add_user_string_input_body import AddUserStringInputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + add_user_string_input_body = revengai.AddUserStringInputBody() # AddUserStringInputBody | + + try: + # Add a user-provided string to an analysis. + api_response = api_instance.add_user_string_to_analysis(analysis_id, add_user_string_input_body) + print("The response of AnalysesCoreApi->add_user_string_to_analysis:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->add_user_string_to_analysis: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **add_user_string_input_body** | [**AddUserStringInputBody**](AddUserStringInputBody.md)| | + +### Return type + +**Dict[str, object]** + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_analysis** > BaseResponseAnalysisCreateResponse create_analysis(analysis_create_request, x_rev_eng_application=x_rev_eng_application) @@ -765,6 +857,192 @@ 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** +> ListAnalysisStringsOutputBody get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, function_search=function_search, order_by=order_by, sort_order=sort_order) + +List strings for an analysis. + +Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + page = 1 # int | Page number (1-indexed). (optional) (default to 1) + page_size = 100 # int | Number of results per page. (optional) (default to 100) + search = 'search_example' # str | Filter by string value (case-insensitive substring match). (optional) + function_search = 'function_search_example' # str | Filter by function name (case-insensitive substring match). (optional) + order_by = value # str | Field to order results by. (optional) (default to value) + sort_order = ASC # str | Sort direction. (optional) (default to ASC) + + try: + # List strings for an analysis. + api_response = api_instance.get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, function_search=function_search, order_by=order_by, sort_order=sort_order) + print("The response of AnalysesCoreApi->get_analysis_strings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->get_analysis_strings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **page** | **int**| Page number (1-indexed). | [optional] [default to 1] + **page_size** | **int**| Number of results per page. | [optional] [default to 100] + **search** | **str**| Filter by string value (case-insensitive substring match). | [optional] + **function_search** | **str**| Filter by function name (case-insensitive substring match). | [optional] + **order_by** | **str**| Field to order results by. | [optional] [default to value] + **sort_order** | **str**| Sort direction. | [optional] [default to ASC] + +### Return type + +[**ListAnalysisStringsOutputBody**](ListAnalysisStringsOutputBody.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** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[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** +> GetAnalysisStringsStatusOutputBody get_analysis_strings_status(analysis_id) + +Get the string-extraction status for an analysis. + +Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get the string-extraction status for an analysis. + api_response = api_instance.get_analysis_strings_status(analysis_id) + print("The response of AnalysesCoreApi->get_analysis_strings_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->get_analysis_strings_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**GetAnalysisStringsStatusOutputBody**](GetAnalysisStringsStatusOutputBody.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** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[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) + # **insert_analysis_log** > BaseResponse insert_analysis_log(analysis_id, insert_analysis_log_request) diff --git a/docs/AnalysisLogMessage.md b/docs/AnalysisLogMessage.md new file mode 100644 index 00000000..13b173e4 --- /dev/null +++ b/docs/AnalysisLogMessage.md @@ -0,0 +1,30 @@ +# AnalysisLogMessage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | +**time** | **str** | | + +## Example + +```python +from revengai.models.analysis_log_message import AnalysisLogMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisLogMessage from a JSON string +analysis_log_message_instance = AnalysisLogMessage.from_json(json) +# print the JSON string representation of the object +print(AnalysisLogMessage.to_json()) + +# convert the object into a dict +analysis_log_message_dict = analysis_log_message_instance.to_dict() +# create an instance of AnalysisLogMessage from a dict +analysis_log_message_from_dict = AnalysisLogMessage.from_dict(analysis_log_message_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/AnalysisLogs.md b/docs/AnalysisLogs.md new file mode 100644 index 00000000..3a6a3a26 --- /dev/null +++ b/docs/AnalysisLogs.md @@ -0,0 +1,30 @@ +# AnalysisLogs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message_count** | **int** | | +**messages** | [**List[AnalysisLogMessage]**](AnalysisLogMessage.md) | | + +## Example + +```python +from revengai.models.analysis_logs import AnalysisLogs + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisLogs from a JSON string +analysis_logs_instance = AnalysisLogs.from_json(json) +# print the JSON string representation of the object +print(AnalysisLogs.to_json()) + +# convert the object into a dict +analysis_logs_dict = analysis_logs_instance.to_dict() +# create an instance of AnalysisLogs from a dict +analysis_logs_from_dict = AnalysisLogs.from_dict(analysis_logs_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/AnalysisStringFunction.md b/docs/AnalysisStringFunction.md new file mode 100644 index 00000000..1fd32063 --- /dev/null +++ b/docs/AnalysisStringFunction.md @@ -0,0 +1,30 @@ +# AnalysisStringFunction + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_id** | **int** | | +**function_vaddr** | **int** | | + +## Example + +```python +from revengai.models.analysis_string_function import AnalysisStringFunction + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisStringFunction from a JSON string +analysis_string_function_instance = AnalysisStringFunction.from_json(json) +# print the JSON string representation of the object +print(AnalysisStringFunction.to_json()) + +# convert the object into a dict +analysis_string_function_dict = analysis_string_function_instance.to_dict() +# create an instance of AnalysisStringFunction from a dict +analysis_string_function_from_dict = AnalysisStringFunction.from_dict(analysis_string_function_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/AnalysisStringItem.md b/docs/AnalysisStringItem.md new file mode 100644 index 00000000..c127cc92 --- /dev/null +++ b/docs/AnalysisStringItem.md @@ -0,0 +1,31 @@ +# AnalysisStringItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[AnalysisStringFunction]**](AnalysisStringFunction.md) | | +**source** | **str** | | +**value** | **str** | | + +## Example + +```python +from revengai.models.analysis_string_item import AnalysisStringItem + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisStringItem from a JSON string +analysis_string_item_instance = AnalysisStringItem.from_json(json) +# print the JSON string representation of the object +print(AnalysisStringItem.to_json()) + +# convert the object into a dict +analysis_string_item_dict = analysis_string_item_instance.to_dict() +# create an instance of AnalysisStringItem from a dict +analysis_string_item_from_dict = AnalysisStringItem.from_dict(analysis_string_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/docs/DynamicExecutionStatusResponse.md b/docs/DynamicExecutionStatusResponse.md index e05b3240..ad73f798 100644 --- a/docs/DynamicExecutionStatusResponse.md +++ b/docs/DynamicExecutionStatusResponse.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error_message** | **str** | Error detail, set when status is ERROR | [optional] +**logs** | [**AnalysisLogs**](AnalysisLogs.md) | Sandbox status log messages captured during the run. Contains a single \"No logs available\" message when none have been captured yet. | **status** | **str** | Task status: UNINITIALISED, PENDING, RUNNING, COMPLETED, or ERROR | ## Example diff --git a/docs/FunctionStringItem.md b/docs/FunctionStringItem.md new file mode 100644 index 00000000..d6fb43df --- /dev/null +++ b/docs/FunctionStringItem.md @@ -0,0 +1,31 @@ +# FunctionStringItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | **str** | | +**vaddr** | **int** | | +**value** | **str** | | + +## Example + +```python +from revengai.models.function_string_item import FunctionStringItem + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionStringItem from a JSON string +function_string_item_instance = FunctionStringItem.from_json(json) +# print the JSON string representation of the object +print(FunctionStringItem.to_json()) + +# convert the object into a dict +function_string_item_dict = function_string_item_instance.to_dict() +# create an instance of FunctionStringItem from a dict +function_string_item_from_dict = FunctionStringItem.from_dict(function_string_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/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index a802cda7..53e5f807 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -4,6 +4,8 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**add_function_callee**](FunctionsCoreApi.md#add_function_callee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function +[**add_user_string_to_function**](FunctionsCoreApi.md#add_user_string_to_function) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. [**ai_unstrip**](FunctionsCoreApi.md#ai_unstrip) | **POST** /v2/analyses/{analysis_id}/functions/ai-unstrip | Performs matching and auto-unstrip for an analysis and its functions [**analysis_function_matching**](FunctionsCoreApi.md#analysis_function_matching) | **POST** /v2/analyses/{analysis_id}/functions/matches | Perform matching for the functions of an analysis [**auto_unstrip**](FunctionsCoreApi.md#auto_unstrip) | **POST** /v2/analyses/{analysis_id}/functions/auto-unstrip | Performs matching and auto-unstrip for an analysis and its functions @@ -18,8 +20,189 @@ Method | HTTP request | Description [**get_function_capabilities**](FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities [**get_function_details**](FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details [**get_function_strings**](FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function +[**get_function_strings_0**](FunctionsCoreApi.md#get_function_strings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. +# **add_function_callee** +> Dict[str, object] add_function_callee(function_id, add_callee_input_body) + +Add a callee to a function + +Records an outgoing call edge from the given function to a callee. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.add_callee_input_body import AddCalleeInputBody +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) + function_id = 56 # int | Function ID + add_callee_input_body = revengai.AddCalleeInputBody() # AddCalleeInputBody | + + try: + # Add a callee to a function + api_response = api_instance.add_function_callee(function_id, add_callee_input_body) + print("The response of FunctionsCoreApi->add_function_callee:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->add_function_callee: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **add_callee_input_body** | [**AddCalleeInputBody**](AddCalleeInputBody.md)| | + +### Return type + +**Dict[str, object]** + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[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) + +# **add_user_string_to_function** +> Dict[str, object] add_user_string_to_function(function_id, add_user_string_to_function_input_body) + +Add a user-provided string to a function. + +Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody +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) + function_id = 56 # int | Function ID + add_user_string_to_function_input_body = revengai.AddUserStringToFunctionInputBody() # AddUserStringToFunctionInputBody | + + try: + # Add a user-provided string to a function. + api_response = api_instance.add_user_string_to_function(function_id, add_user_string_to_function_input_body) + print("The response of FunctionsCoreApi->add_user_string_to_function:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->add_user_string_to_function: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **add_user_string_to_function_input_body** | [**AddUserStringToFunctionInputBody**](AddUserStringToFunctionInputBody.md)| | + +### Return type + +**Dict[str, object]** + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[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) + # **ai_unstrip** > AutoUnstripResponse ai_unstrip(analysis_id, ai_unstrip_request) @@ -1162,3 +1345,96 @@ 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_function_strings_0** +> ListFunctionStringsOutputBody get_function_strings_0(function_id, page=page, page_size=page_size, search=search) + +List strings for a function. + +Returns the strings discovered in a function. Supports value search and pagination. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody +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) + function_id = 56 # int | Function ID + page = 1 # int | Page number (1-indexed). (optional) (default to 1) + page_size = 100 # int | Number of results per page. (optional) (default to 100) + search = 'search_example' # str | Filter by string value (case-insensitive substring match). (optional) + + try: + # List strings for a function. + api_response = api_instance.get_function_strings_0(function_id, page=page, page_size=page_size, search=search) + print("The response of FunctionsCoreApi->get_function_strings_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_function_strings_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **page** | **int**| Page number (1-indexed). | [optional] [default to 1] + **page_size** | **int**| Number of results per page. | [optional] [default to 100] + **search** | **str**| Filter by string value (case-insensitive substring match). | [optional] + +### Return type + +[**ListFunctionStringsOutputBody**](ListFunctionStringsOutputBody.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** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/GetAnalysisStringsStatusOutputBody.md b/docs/GetAnalysisStringsStatusOutputBody.md new file mode 100644 index 00000000..42650d91 --- /dev/null +++ b/docs/GetAnalysisStringsStatusOutputBody.md @@ -0,0 +1,29 @@ +# GetAnalysisStringsStatusOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | + +## Example + +```python +from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAnalysisStringsStatusOutputBody from a JSON string +get_analysis_strings_status_output_body_instance = GetAnalysisStringsStatusOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetAnalysisStringsStatusOutputBody.to_json()) + +# convert the object into a dict +get_analysis_strings_status_output_body_dict = get_analysis_strings_status_output_body_instance.to_dict() +# create an instance of GetAnalysisStringsStatusOutputBody from a dict +get_analysis_strings_status_output_body_from_dict = GetAnalysisStringsStatusOutputBody.from_dict(get_analysis_strings_status_output_body_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/ListAnalysisStringsOutputBody.md b/docs/ListAnalysisStringsOutputBody.md new file mode 100644 index 00000000..30d3a974 --- /dev/null +++ b/docs/ListAnalysisStringsOutputBody.md @@ -0,0 +1,30 @@ +# ListAnalysisStringsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strings** | [**List[AnalysisStringItem]**](AnalysisStringItem.md) | | +**total_strings** | **int** | | + +## Example + +```python +from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListAnalysisStringsOutputBody from a JSON string +list_analysis_strings_output_body_instance = ListAnalysisStringsOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListAnalysisStringsOutputBody.to_json()) + +# convert the object into a dict +list_analysis_strings_output_body_dict = list_analysis_strings_output_body_instance.to_dict() +# create an instance of ListAnalysisStringsOutputBody from a dict +list_analysis_strings_output_body_from_dict = ListAnalysisStringsOutputBody.from_dict(list_analysis_strings_output_body_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/ListFunctionStringsOutputBody.md b/docs/ListFunctionStringsOutputBody.md new file mode 100644 index 00000000..a8b56468 --- /dev/null +++ b/docs/ListFunctionStringsOutputBody.md @@ -0,0 +1,30 @@ +# ListFunctionStringsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strings** | [**List[FunctionStringItem]**](FunctionStringItem.md) | | +**total_strings** | **int** | | + +## Example + +```python +from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListFunctionStringsOutputBody from a JSON string +list_function_strings_output_body_instance = ListFunctionStringsOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListFunctionStringsOutputBody.to_json()) + +# convert the object into a dict +list_function_strings_output_body_dict = list_function_strings_output_body_instance.to_dict() +# create an instance of ListFunctionStringsOutputBody from a dict +list_function_strings_output_body_from_dict = ListFunctionStringsOutputBody.from_dict(list_function_strings_output_body_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/StringsApi.md b/docs/StringsApi.md deleted file mode 100644 index 2bb6d796..00000000 --- a/docs/StringsApi.md +++ /dev/null @@ -1,188 +0,0 @@ -# revengai.StringsApi - -All URIs are relative to *https://api.reveng.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_user_string_to_analysis**](StringsApi.md#add_user_string_to_analysis) | **POST** /v3/analyses/{analysis_id}/user-provided-strings | Add a user-provided string to an analysis. -[**add_user_string_to_function**](StringsApi.md#add_user_string_to_function) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. - - -# **add_user_string_to_analysis** -> Dict[str, object] add_user_string_to_analysis(analysis_id, add_user_string_input_body) - -Add a user-provided string to an analysis. - -Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. - -**Error codes:** -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.add_user_string_input_body import AddUserStringInputBody -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.StringsApi(api_client) - analysis_id = 56 # int | Analysis ID - add_user_string_input_body = revengai.AddUserStringInputBody() # AddUserStringInputBody | - - try: - # Add a user-provided string to an analysis. - api_response = api_instance.add_user_string_to_analysis(analysis_id, add_user_string_input_body) - print("The response of StringsApi->add_user_string_to_analysis:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling StringsApi->add_user_string_to_analysis: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| Analysis ID | - **add_user_string_input_body** | [**AddUserStringInputBody**](AddUserStringInputBody.md)| | - -### Return type - -**Dict[str, object]** - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Created | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[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) - -# **add_user_string_to_function** -> Dict[str, object] add_user_string_to_function(function_id, add_user_string_to_function_input_body) - -Add a user-provided string to a function. - -Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. - -**Error codes:** -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody -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.StringsApi(api_client) - function_id = 56 # int | Function ID - add_user_string_to_function_input_body = revengai.AddUserStringToFunctionInputBody() # AddUserStringToFunctionInputBody | - - try: - # Add a user-provided string to a function. - api_response = api_instance.add_user_string_to_function(function_id, add_user_string_to_function_input_body) - print("The response of StringsApi->add_user_string_to_function:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling StringsApi->add_user_string_to_function: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_id** | **int**| Function ID | - **add_user_string_to_function_input_body** | [**AddUserStringToFunctionInputBody**](AddUserStringToFunctionInputBody.md)| | - -### Return type - -**Dict[str, object]** - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Created | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/revengai/__init__.py b/revengai/__init__.py index a9750afe..1f5593fc 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -37,7 +37,6 @@ "ModelsApi", "ReportsApi", "SearchApi", - "StringsApi", "ApiResponse", "ApiClient", "Configuration", @@ -48,6 +47,7 @@ "ApiAttributeError", "ApiException", "APIError", + "AddCalleeInputBody", "AddUserStringInputBody", "AddUserStringToFunctionInputBody", "AdditionalDetailsStatusResponse", @@ -67,10 +67,14 @@ "AnalysisFunctionMatchingRequest", "AnalysisFunctions", "AnalysisFunctionsList", + "AnalysisLogMessage", + "AnalysisLogs", "AnalysisRecord", "AnalysisReport", "AnalysisScope", + "AnalysisStringFunction", "AnalysisStringInput", + "AnalysisStringItem", "AnalysisStringsResponse", "AnalysisStringsStatusResponse", "AnalysisTags", @@ -293,6 +297,7 @@ "FunctionSearchResult", "FunctionSourceType", "FunctionString", + "FunctionStringItem", "FunctionStringsResponse", "FunctionTaskResponse", "FunctionTaskStatus", @@ -305,6 +310,7 @@ "GenerationStatusList", "GetAiDecompilationRatingResponse", "GetAiDecompilationTask", + "GetAnalysisStringsStatusOutputBody", "GetPublicUserResponse", "GlobalVariable", "HistoryEntry", @@ -318,7 +324,9 @@ "InverseFunctionMapItem", "InverseStringMapItem", "InverseValue", + "ListAnalysisStringsOutputBody", "ListCollectionResults", + "ListFunctionStringsOutputBody", "Logs", "MITRETechnique", "MatchedFunction", @@ -464,7 +472,6 @@ from revengai.api.models_api import ModelsApi as ModelsApi from revengai.api.reports_api import ReportsApi as ReportsApi from revengai.api.search_api import SearchApi as SearchApi -from revengai.api.strings_api import StringsApi as StringsApi # import ApiClient from revengai.api_response import ApiResponse as ApiResponse @@ -479,6 +486,7 @@ # import models into sdk package from revengai.models.api_error import APIError as APIError +from revengai.models.add_callee_input_body import AddCalleeInputBody as AddCalleeInputBody from revengai.models.add_user_string_input_body import AddUserStringInputBody as AddUserStringInputBody from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody as AddUserStringToFunctionInputBody from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse as AdditionalDetailsStatusResponse @@ -498,10 +506,14 @@ 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_log_message import AnalysisLogMessage as AnalysisLogMessage +from revengai.models.analysis_logs import AnalysisLogs as AnalysisLogs from revengai.models.analysis_record import AnalysisRecord as AnalysisRecord from revengai.models.analysis_report import AnalysisReport as AnalysisReport from revengai.models.analysis_scope import AnalysisScope as AnalysisScope +from revengai.models.analysis_string_function import AnalysisStringFunction as AnalysisStringFunction from revengai.models.analysis_string_input import AnalysisStringInput as AnalysisStringInput +from revengai.models.analysis_string_item import AnalysisStringItem as AnalysisStringItem 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 @@ -724,6 +736,7 @@ from revengai.models.function_search_result import FunctionSearchResult as FunctionSearchResult from revengai.models.function_source_type import FunctionSourceType as FunctionSourceType from revengai.models.function_string import FunctionString as FunctionString +from revengai.models.function_string_item import FunctionStringItem as FunctionStringItem from revengai.models.function_strings_response import FunctionStringsResponse as FunctionStringsResponse from revengai.models.function_task_response import FunctionTaskResponse as FunctionTaskResponse from revengai.models.function_task_status import FunctionTaskStatus as FunctionTaskStatus @@ -736,6 +749,7 @@ from revengai.models.generation_status_list import GenerationStatusList as GenerationStatusList from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse as GetAiDecompilationRatingResponse from revengai.models.get_ai_decompilation_task import GetAiDecompilationTask as GetAiDecompilationTask +from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody as GetAnalysisStringsStatusOutputBody from revengai.models.get_public_user_response import GetPublicUserResponse as GetPublicUserResponse from revengai.models.global_variable import GlobalVariable as GlobalVariable from revengai.models.history_entry import HistoryEntry as HistoryEntry @@ -749,7 +763,9 @@ from revengai.models.inverse_function_map_item import InverseFunctionMapItem as InverseFunctionMapItem from revengai.models.inverse_string_map_item import InverseStringMapItem as InverseStringMapItem from revengai.models.inverse_value import InverseValue as InverseValue +from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody as ListAnalysisStringsOutputBody from revengai.models.list_collection_results import ListCollectionResults as ListCollectionResults +from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody as ListFunctionStringsOutputBody from revengai.models.logs import Logs as Logs from revengai.models.mitre_technique import MITRETechnique as MITRETechnique from revengai.models.matched_function import MatchedFunction as MatchedFunction diff --git a/revengai/api/__init__.py b/revengai/api/__init__.py index 46785853..2367c642 100644 --- a/revengai/api/__init__.py +++ b/revengai/api/__init__.py @@ -21,5 +21,4 @@ from revengai.api.models_api import ModelsApi from revengai.api.reports_api import ReportsApi from revengai.api.search_api import SearchApi -from revengai.api.strings_api import StringsApi diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 33bcc789..69d7ca0e 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -15,9 +15,10 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr -from typing import Any, List, Optional, Tuple, Union +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from revengai.models.add_user_string_input_body import AddUserStringInputBody from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_update_request import AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest @@ -36,7 +37,9 @@ from revengai.models.base_response_status import BaseResponseStatus from revengai.models.base_response_upload_response import BaseResponseUploadResponse from revengai.models.dynamic_execution_status import DynamicExecutionStatus +from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest +from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.models.model_name import ModelName from revengai.models.order import Order from revengai.models.put_analysis_strings_request import PutAnalysisStringsRequest @@ -65,10 +68,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def create_analysis( + def add_user_string_to_analysis( self, - analysis_create_request: AnalysisCreateRequest, - x_rev_eng_application: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + add_user_string_input_body: AddUserStringInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -81,15 +84,15 @@ def create_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseAnalysisCreateResponse: - """Create Analysis + ) -> Dict[str, object]: + """Add a user-provided string to an analysis. - Begins an analysis + Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_create_request: (required) - :type analysis_create_request: AnalysisCreateRequest - :param x_rev_eng_application: - :type x_rev_eng_application: str + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param add_user_string_input_body: (required) + :type add_user_string_input_body: AddUserStringInputBody :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 @@ -112,9 +115,9 @@ def create_analysis( :return: Returns the result object. """ # noqa: E501 - _param = self._create_analysis_serialize( - analysis_create_request=analysis_create_request, - x_rev_eng_application=x_rev_eng_application, + _param = self._add_user_string_to_analysis_serialize( + analysis_id=analysis_id, + add_user_string_input_body=add_user_string_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -122,10 +125,11 @@ def create_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseAnalysisCreateResponse", - '422': "BaseResponse", - '404': "BaseResponse", - '400': "BaseResponse", + '201': "Dict[str, object]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -139,10 +143,10 @@ def create_analysis( @validate_call - def create_analysis_with_http_info( + def add_user_string_to_analysis_with_http_info( self, - analysis_create_request: AnalysisCreateRequest, - x_rev_eng_application: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + add_user_string_input_body: AddUserStringInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -155,15 +159,15 @@ def create_analysis_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseAnalysisCreateResponse]: - """Create Analysis + ) -> ApiResponse[Dict[str, object]]: + """Add a user-provided string to an analysis. - Begins an analysis + Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_create_request: (required) - :type analysis_create_request: AnalysisCreateRequest - :param x_rev_eng_application: - :type x_rev_eng_application: str + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param add_user_string_input_body: (required) + :type add_user_string_input_body: AddUserStringInputBody :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 @@ -186,9 +190,9 @@ def create_analysis_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_analysis_serialize( - analysis_create_request=analysis_create_request, - x_rev_eng_application=x_rev_eng_application, + _param = self._add_user_string_to_analysis_serialize( + analysis_id=analysis_id, + add_user_string_input_body=add_user_string_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -196,10 +200,11 @@ def create_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseAnalysisCreateResponse", - '422': "BaseResponse", - '404': "BaseResponse", - '400': "BaseResponse", + '201': "Dict[str, object]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -213,10 +218,10 @@ def create_analysis_with_http_info( @validate_call - def create_analysis_without_preload_content( + def add_user_string_to_analysis_without_preload_content( self, - analysis_create_request: AnalysisCreateRequest, - x_rev_eng_application: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + add_user_string_input_body: AddUserStringInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -230,14 +235,14 @@ def create_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Analysis + """Add a user-provided string to an analysis. - Begins an analysis + Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_create_request: (required) - :type analysis_create_request: AnalysisCreateRequest - :param x_rev_eng_application: - :type x_rev_eng_application: str + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param add_user_string_input_body: (required) + :type add_user_string_input_body: AddUserStringInputBody :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 @@ -260,9 +265,9 @@ def create_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_analysis_serialize( - analysis_create_request=analysis_create_request, - x_rev_eng_application=x_rev_eng_application, + _param = self._add_user_string_to_analysis_serialize( + analysis_id=analysis_id, + add_user_string_input_body=add_user_string_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -270,10 +275,11 @@ def create_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseAnalysisCreateResponse", - '422': "BaseResponse", - '404': "BaseResponse", - '400': "BaseResponse", + '201': "Dict[str, object]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -282,10 +288,10 @@ def create_analysis_without_preload_content( return response_data.response - def _create_analysis_serialize( + def _add_user_string_to_analysis_serialize( self, - analysis_create_request, - x_rev_eng_application, + analysis_id, + add_user_string_input_body, _request_auth, _content_type, _headers, @@ -307,14 +313,14 @@ def _create_analysis_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id # process the query parameters # process the header parameters - if x_rev_eng_application is not None: - _header_params['X-RevEng-Application'] = x_rev_eng_application # process the form parameters # process the body parameter - if analysis_create_request is not None: - _body_params = analysis_create_request + if add_user_string_input_body is not None: + _body_params = add_user_string_input_body # set the HTTP header `Accept` @@ -346,7 +352,7 @@ def _create_analysis_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/analyses', + resource_path='/v3/analyses/{analysis_id}/user-provided-strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -363,9 +369,10 @@ def _create_analysis_serialize( @validate_call - def delete_analysis( + def create_analysis( self, - analysis_id: StrictInt, + analysis_create_request: AnalysisCreateRequest, + x_rev_eng_application: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -378,13 +385,15 @@ def delete_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseDict: - """Delete Analysis + ) -> BaseResponseAnalysisCreateResponse: + """Create Analysis - Deletes an analysis based on the provided analysis ID. + Begins an analysis - :param analysis_id: (required) - :type analysis_id: int + :param analysis_create_request: (required) + :type analysis_create_request: AnalysisCreateRequest + :param x_rev_eng_application: + :type x_rev_eng_application: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -407,8 +416,9 @@ def delete_analysis( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_analysis_serialize( - analysis_id=analysis_id, + _param = self._create_analysis_serialize( + analysis_create_request=analysis_create_request, + x_rev_eng_application=x_rev_eng_application, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -416,10 +426,10 @@ def delete_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseDict", + '201': "BaseResponseAnalysisCreateResponse", '422': "BaseResponse", '404': "BaseResponse", - '403': "BaseResponse", + '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -433,9 +443,10 @@ def delete_analysis( @validate_call - def delete_analysis_with_http_info( + def create_analysis_with_http_info( self, - analysis_id: StrictInt, + analysis_create_request: AnalysisCreateRequest, + x_rev_eng_application: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -448,13 +459,15 @@ def delete_analysis_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseDict]: - """Delete Analysis + ) -> ApiResponse[BaseResponseAnalysisCreateResponse]: + """Create Analysis - Deletes an analysis based on the provided analysis ID. + Begins an analysis - :param analysis_id: (required) - :type analysis_id: int + :param analysis_create_request: (required) + :type analysis_create_request: AnalysisCreateRequest + :param x_rev_eng_application: + :type x_rev_eng_application: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -477,8 +490,9 @@ def delete_analysis_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_analysis_serialize( - analysis_id=analysis_id, + _param = self._create_analysis_serialize( + analysis_create_request=analysis_create_request, + x_rev_eng_application=x_rev_eng_application, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -486,10 +500,10 @@ def delete_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseDict", + '201': "BaseResponseAnalysisCreateResponse", '422': "BaseResponse", '404': "BaseResponse", - '403': "BaseResponse", + '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -503,9 +517,10 @@ def delete_analysis_with_http_info( @validate_call - def delete_analysis_without_preload_content( + def create_analysis_without_preload_content( self, - analysis_id: StrictInt, + analysis_create_request: AnalysisCreateRequest, + x_rev_eng_application: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -519,12 +534,14 @@ def delete_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Analysis + """Create Analysis - Deletes an analysis based on the provided analysis ID. + Begins an analysis - :param analysis_id: (required) - :type analysis_id: int + :param analysis_create_request: (required) + :type analysis_create_request: AnalysisCreateRequest + :param x_rev_eng_application: + :type x_rev_eng_application: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -547,8 +564,9 @@ def delete_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_analysis_serialize( - analysis_id=analysis_id, + _param = self._create_analysis_serialize( + analysis_create_request=analysis_create_request, + x_rev_eng_application=x_rev_eng_application, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -556,10 +574,10 @@ def delete_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseDict", + '201': "BaseResponseAnalysisCreateResponse", '422': "BaseResponse", '404': "BaseResponse", - '403': "BaseResponse", + '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -568,9 +586,10 @@ def delete_analysis_without_preload_content( return response_data.response - def _delete_analysis_serialize( + def _create_analysis_serialize( self, - analysis_id, + analysis_create_request, + x_rev_eng_application, _request_auth, _content_type, _headers, @@ -592,12 +611,14 @@ def _delete_analysis_serialize( _body_params: Optional[bytes] = None # process the path parameters - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id # process the query parameters # process the header parameters + if x_rev_eng_application is not None: + _header_params['X-RevEng-Application'] = x_rev_eng_application # process the form parameters # process the body parameter + if analysis_create_request is not None: + _body_params = analysis_create_request # set the HTTP header `Accept` @@ -608,6 +629,19 @@ def _delete_analysis_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -615,8 +649,8 @@ def _delete_analysis_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/analyses/{analysis_id}', + method='POST', + resource_path='/v2/analyses', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -633,7 +667,7 @@ def _delete_analysis_serialize( @validate_call - def get_analysis_basic_info( + def delete_analysis( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -648,10 +682,10 @@ def get_analysis_basic_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseBasic: - """Gets basic analysis information + ) -> BaseResponseDict: + """Delete Analysis - Returns basic analysis information for an analysis + Deletes an analysis based on the provided analysis ID. :param analysis_id: (required) :type analysis_id: int @@ -677,7 +711,7 @@ def get_analysis_basic_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_basic_info_serialize( + _param = self._delete_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -686,8 +720,10 @@ def get_analysis_basic_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBasic", + '200': "BaseResponseDict", '422': "BaseResponse", + '404': "BaseResponse", + '403': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -701,7 +737,7 @@ def get_analysis_basic_info( @validate_call - def get_analysis_basic_info_with_http_info( + def delete_analysis_with_http_info( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -716,10 +752,10 @@ def get_analysis_basic_info_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseBasic]: - """Gets basic analysis information + ) -> ApiResponse[BaseResponseDict]: + """Delete Analysis - Returns basic analysis information for an analysis + Deletes an analysis based on the provided analysis ID. :param analysis_id: (required) :type analysis_id: int @@ -745,7 +781,7 @@ def get_analysis_basic_info_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_basic_info_serialize( + _param = self._delete_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -754,8 +790,10 @@ def get_analysis_basic_info_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBasic", + '200': "BaseResponseDict", '422': "BaseResponse", + '404': "BaseResponse", + '403': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -769,7 +807,7 @@ def get_analysis_basic_info_with_http_info( @validate_call - def get_analysis_basic_info_without_preload_content( + def delete_analysis_without_preload_content( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -785,9 +823,9 @@ def get_analysis_basic_info_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets basic analysis information + """Delete Analysis - Returns basic analysis information for an analysis + Deletes an analysis based on the provided analysis ID. :param analysis_id: (required) :type analysis_id: int @@ -813,7 +851,7 @@ def get_analysis_basic_info_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_basic_info_serialize( + _param = self._delete_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -822,8 +860,10 @@ def get_analysis_basic_info_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBasic", + '200': "BaseResponseDict", '422': "BaseResponse", + '404': "BaseResponse", + '403': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -832,7 +872,7 @@ def get_analysis_basic_info_without_preload_content( return response_data.response - def _get_analysis_basic_info_serialize( + def _delete_analysis_serialize( self, analysis_id, _request_auth, @@ -879,8 +919,8 @@ def _get_analysis_basic_info_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v2/analyses/{analysis_id}/basic', + method='DELETE', + resource_path='/v2/analyses/{analysis_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -897,10 +937,9 @@ def _get_analysis_basic_info_serialize( @validate_call - def get_analysis_bytes( + def get_analysis_basic_info( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - page: Annotated[Optional[Annotated[int, Field(le=16777216, strict=True, ge=0)]], Field(description="64kb page of binary data")] = None, + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -913,15 +952,13 @@ def get_analysis_bytes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Get the bytes of a binary + ) -> BaseResponseBasic: + """Gets basic analysis information - Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Returns basic analysis information for an analysis - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int - :param page: 64kb page of binary data - :type page: 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 @@ -944,9 +981,8 @@ def get_analysis_bytes( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_bytes_serialize( + _param = self._get_analysis_basic_info_serialize( analysis_id=analysis_id, - page=page, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -954,12 +990,8 @@ def get_analysis_bytes( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIError", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseBasic", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -973,7 +1005,203 @@ def get_analysis_bytes( @validate_call - def get_analysis_bytes_with_http_info( + def get_analysis_basic_info_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[BaseResponseBasic]: + """Gets basic analysis information + + Returns basic analysis information for an 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_basic_info_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': "BaseResponseBasic", + '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_basic_info_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: + """Gets basic analysis information + + Returns basic analysis information for an 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_basic_info_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': "BaseResponseBasic", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_analysis_basic_info_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}/basic', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_analysis_bytes( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], page: Annotated[Optional[Annotated[int, Field(le=16777216, strict=True, ge=0)]], Field(description="64kb page of binary data")] = None, @@ -989,7 +1217,7 @@ def get_analysis_bytes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: + ) -> None: """Get the bytes of a binary Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request @@ -1045,11 +1273,11 @@ def get_analysis_bytes_with_http_info( return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, - ) + ).data @validate_call - def get_analysis_bytes_without_preload_content( + def get_analysis_bytes_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], page: Annotated[Optional[Annotated[int, Field(le=16777216, strict=True, ge=0)]], Field(description="64kb page of binary data")] = None, @@ -1065,15 +1293,629 @@ def get_analysis_bytes_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: + ) -> ApiResponse[None]: """Get the bytes of a binary Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: Analysis ID (required) + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param page: 64kb page of binary data + :type page: 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_bytes_serialize( + analysis_id=analysis_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + 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_bytes_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(le=16777216, strict=True, ge=0)]], Field(description="64kb page of binary data")] = 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 the bytes of a binary + + Returns a 64kb byte page from the binary. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param page: 64kb page of binary data + :type page: 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_bytes_serialize( + analysis_id=analysis_id, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_analysis_bytes_serialize( + self, + analysis_id, + page, + _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)) + + # 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='/v3/analyses/{analysis_id}/bytes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_analysis_function_map( + 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, + ) -> BaseResponseAnalysisFunctionMapping: + """Get Analysis Function Map + + Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + + :param analysis_id: (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_analysis_function_map_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionMapping", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_analysis_function_map_with_http_info( + self, + analysis_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseAnalysisFunctionMapping]: + """Get Analysis Function Map + + Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + + :param analysis_id: (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_analysis_function_map_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionMapping", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_analysis_function_map_without_preload_content( + self, + analysis_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Analysis Function Map + + Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + + :param analysis_id: (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_analysis_function_map_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseAnalysisFunctionMapping", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_analysis_function_map_serialize( + self, + analysis_id, + _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}/func_maps', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_analysis_logs( + self, + 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, + ) -> BaseResponseLogs: + """Gets the logs of an analysis + + Given an analysis ID gets the current logs of an 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_logs_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': "BaseResponseLogs", + '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_logs_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[BaseResponseLogs]: + """Gets the logs of an analysis + + Given an analysis ID gets the current logs of an 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_logs_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': "BaseResponseLogs", + '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_logs_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: + """Gets the logs of an analysis + + Given an analysis ID gets the current logs of an analysis + + :param analysis_id: (required) :type analysis_id: int - :param page: 64kb page of binary data - :type page: 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 @@ -1096,9 +1938,8 @@ def get_analysis_bytes_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_bytes_serialize( + _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, - page=page, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1106,12 +1947,8 @@ def get_analysis_bytes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIError", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseLogs", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -1120,10 +1957,9 @@ def get_analysis_bytes_without_preload_content( return response_data.response - def _get_analysis_bytes_serialize( + def _get_analysis_logs_serialize( self, analysis_id, - page, _request_auth, _content_type, _headers, @@ -1148,10 +1984,6 @@ def _get_analysis_bytes_serialize( 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)) - # process the header parameters # process the form parameters # process the body parameter @@ -1173,7 +2005,7 @@ def _get_analysis_bytes_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/bytes', + resource_path='/v2/analyses/{analysis_id}/logs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1190,7 +2022,7 @@ def _get_analysis_bytes_serialize( @validate_call - def get_analysis_function_map( + def get_analysis_params( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1205,10 +2037,10 @@ def get_analysis_function_map( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseAnalysisFunctionMapping: - """Get Analysis Function Map + ) -> BaseResponseParams: + """Gets analysis param information - Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + Gets the params that the analysis was run with :param analysis_id: (required) :type analysis_id: int @@ -1234,7 +2066,7 @@ def get_analysis_function_map( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_function_map_serialize( + _param = self._get_analysis_params_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1243,7 +2075,7 @@ def get_analysis_function_map( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisFunctionMapping", + '200': "BaseResponseParams", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1258,7 +2090,7 @@ def get_analysis_function_map( @validate_call - def get_analysis_function_map_with_http_info( + def get_analysis_params_with_http_info( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1273,10 +2105,10 @@ def get_analysis_function_map_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseAnalysisFunctionMapping]: - """Get Analysis Function Map + ) -> ApiResponse[BaseResponseParams]: + """Gets analysis param information - Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + Gets the params that the analysis was run with :param analysis_id: (required) :type analysis_id: int @@ -1302,7 +2134,7 @@ def get_analysis_function_map_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_function_map_serialize( + _param = self._get_analysis_params_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1311,7 +2143,7 @@ def get_analysis_function_map_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisFunctionMapping", + '200': "BaseResponseParams", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1326,7 +2158,7 @@ def get_analysis_function_map_with_http_info( @validate_call - def get_analysis_function_map_without_preload_content( + def get_analysis_params_without_preload_content( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1342,9 +2174,9 @@ def get_analysis_function_map_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Analysis Function Map + """Gets analysis param information - Returns three maps: a map of function ids to function addresses, it's inverse and a map of function addresses to function names. + Gets the params that the analysis was run with :param analysis_id: (required) :type analysis_id: int @@ -1370,7 +2202,7 @@ def get_analysis_function_map_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_function_map_serialize( + _param = self._get_analysis_params_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1379,7 +2211,7 @@ def get_analysis_function_map_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisFunctionMapping", + '200': "BaseResponseParams", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1389,7 +2221,7 @@ def get_analysis_function_map_without_preload_content( return response_data.response - def _get_analysis_function_map_serialize( + def _get_analysis_params_serialize( self, analysis_id, _request_auth, @@ -1437,7 +2269,7 @@ def _get_analysis_function_map_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/func_maps', + resource_path='/v2/analyses/{analysis_id}/params', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1454,9 +2286,9 @@ def _get_analysis_function_map_serialize( @validate_call - def get_analysis_logs( + def get_analysis_queue_position( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1469,12 +2301,12 @@ def get_analysis_logs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseLogs: - """Gets the logs of an analysis + ) -> QueuePositionResponse: + """Get the queue position of an analysis - Given an analysis ID gets the current logs of an analysis + Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1498,7 +2330,7 @@ def get_analysis_logs( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_logs_serialize( + _param = self._get_analysis_queue_position_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1507,8 +2339,11 @@ def get_analysis_logs( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseLogs", - '422': "BaseResponse", + '200': "QueuePositionResponse", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1522,9 +2357,9 @@ def get_analysis_logs( @validate_call - def get_analysis_logs_with_http_info( + def get_analysis_queue_position_with_http_info( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1537,12 +2372,12 @@ def get_analysis_logs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseLogs]: - """Gets the logs of an analysis + ) -> ApiResponse[QueuePositionResponse]: + """Get the queue position of an analysis - Given an analysis ID gets the current logs of an analysis + Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1566,7 +2401,7 @@ def get_analysis_logs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_logs_serialize( + _param = self._get_analysis_queue_position_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1575,8 +2410,11 @@ def get_analysis_logs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseLogs", - '422': "BaseResponse", + '200': "QueuePositionResponse", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1590,9 +2428,9 @@ def get_analysis_logs_with_http_info( @validate_call - def get_analysis_logs_without_preload_content( + def get_analysis_queue_position_without_preload_content( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1606,11 +2444,11 @@ def get_analysis_logs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the logs of an analysis + """Get the queue position of an analysis - Given an analysis ID gets the current logs of an analysis + Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1634,7 +2472,7 @@ def get_analysis_logs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_logs_serialize( + _param = self._get_analysis_queue_position_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1643,8 +2481,11 @@ def get_analysis_logs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseLogs", - '422': "BaseResponse", + '200': "QueuePositionResponse", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1653,7 +2494,7 @@ def get_analysis_logs_without_preload_content( return response_data.response - def _get_analysis_logs_serialize( + def _get_analysis_queue_position_serialize( self, analysis_id, _request_auth, @@ -1701,7 +2542,7 @@ def _get_analysis_logs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/logs', + resource_path='/v2/analyses/{analysis_id}/queue-position', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1718,7 +2559,7 @@ def _get_analysis_logs_serialize( @validate_call - def get_analysis_params( + def get_analysis_status( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1733,10 +2574,10 @@ def get_analysis_params( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseParams: - """Gets analysis param information + ) -> BaseResponseStatus: + """Gets the status of an analysis - Gets the params that the analysis was run with + Given an analysis ID gets the current status of the analysis :param analysis_id: (required) :type analysis_id: int @@ -1762,7 +2603,7 @@ def get_analysis_params( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_params_serialize( + _param = self._get_analysis_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1771,7 +2612,7 @@ def get_analysis_params( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseParams", + '200': "BaseResponseStatus", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1786,7 +2627,7 @@ def get_analysis_params( @validate_call - def get_analysis_params_with_http_info( + def get_analysis_status_with_http_info( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1801,10 +2642,10 @@ def get_analysis_params_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseParams]: - """Gets analysis param information + ) -> ApiResponse[BaseResponseStatus]: + """Gets the status of an analysis - Gets the params that the analysis was run with + Given an analysis ID gets the current status of the analysis :param analysis_id: (required) :type analysis_id: int @@ -1830,7 +2671,7 @@ def get_analysis_params_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_params_serialize( + _param = self._get_analysis_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1839,7 +2680,7 @@ def get_analysis_params_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseParams", + '200': "BaseResponseStatus", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1854,7 +2695,7 @@ def get_analysis_params_with_http_info( @validate_call - def get_analysis_params_without_preload_content( + def get_analysis_status_without_preload_content( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1870,9 +2711,9 @@ def get_analysis_params_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets analysis param information + """Gets the status of an analysis - Gets the params that the analysis was run with + Given an analysis ID gets the current status of the analysis :param analysis_id: (required) :type analysis_id: int @@ -1898,7 +2739,7 @@ def get_analysis_params_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_params_serialize( + _param = self._get_analysis_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1907,7 +2748,7 @@ def get_analysis_params_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseParams", + '200': "BaseResponseStatus", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1917,7 +2758,7 @@ def get_analysis_params_without_preload_content( return response_data.response - def _get_analysis_params_serialize( + def _get_analysis_status_serialize( self, analysis_id, _request_auth, @@ -1965,7 +2806,7 @@ def _get_analysis_params_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/params', + resource_path='/v2/analyses/{analysis_id}/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1982,9 +2823,15 @@ def _get_analysis_params_serialize( @validate_call - def get_analysis_queue_position( + def get_analysis_strings( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1997,13 +2844,25 @@ def get_analysis_queue_position( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> QueuePositionResponse: - """Get the queue position of an analysis + ) -> ListAnalysisStringsOutputBody: + """List strings for an analysis. - Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int + :param page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: str + :param function_search: Filter by function name (case-insensitive substring match). + :type function_search: str + :param order_by: Field to order results by. + :type order_by: str + :param sort_order: Sort direction. + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2026,8 +2885,14 @@ def get_analysis_queue_position( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_queue_position_serialize( + _param = self._get_analysis_strings_serialize( analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2035,7 +2900,7 @@ def get_analysis_queue_position( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "QueuePositionResponse", + '200': "ListAnalysisStringsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2053,9 +2918,15 @@ def get_analysis_queue_position( @validate_call - def get_analysis_queue_position_with_http_info( + def get_analysis_strings_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2068,13 +2939,25 @@ def get_analysis_queue_position_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[QueuePositionResponse]: - """Get the queue position of an analysis + ) -> ApiResponse[ListAnalysisStringsOutputBody]: + """List strings for an analysis. - Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int + :param page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: str + :param function_search: Filter by function name (case-insensitive substring match). + :type function_search: str + :param order_by: Field to order results by. + :type order_by: str + :param sort_order: Sort direction. + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2097,8 +2980,14 @@ def get_analysis_queue_position_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_queue_position_serialize( + _param = self._get_analysis_strings_serialize( analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2106,7 +2995,7 @@ def get_analysis_queue_position_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "QueuePositionResponse", + '200': "ListAnalysisStringsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2124,9 +3013,15 @@ def get_analysis_queue_position_with_http_info( @validate_call - def get_analysis_queue_position_without_preload_content( + def get_analysis_strings_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2140,12 +3035,24 @@ def get_analysis_queue_position_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the queue position of an analysis + """List strings for an analysis. - Returns the number of Processing analyses with a lower analysis_id than the given one. Useful for showing the user where they sit in the processing queue while waiting for their analysis to start. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int + :param page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: str + :param function_search: Filter by function name (case-insensitive substring match). + :type function_search: str + :param order_by: Field to order results by. + :type order_by: str + :param sort_order: Sort direction. + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2168,8 +3075,14 @@ def get_analysis_queue_position_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_queue_position_serialize( + _param = self._get_analysis_strings_serialize( analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2177,7 +3090,7 @@ def get_analysis_queue_position_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "QueuePositionResponse", + '200': "ListAnalysisStringsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2190,9 +3103,15 @@ def get_analysis_queue_position_without_preload_content( return response_data.response - def _get_analysis_queue_position_serialize( + def _get_analysis_strings_serialize( self, analysis_id, + page, + page_size, + search, + function_search, + order_by, + sort_order, _request_auth, _content_type, _headers, @@ -2217,6 +3136,30 @@ def _get_analysis_queue_position_serialize( 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)) + + if search is not None: + + _query_params.append(('search', search)) + + if function_search is not None: + + _query_params.append(('function_search', function_search)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if sort_order is not None: + + _query_params.append(('sort_order', sort_order)) + # process the header parameters # process the form parameters # process the body parameter @@ -2238,7 +3181,7 @@ def _get_analysis_queue_position_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/queue-position', + resource_path='/v3/analyses/{analysis_id}/functions/strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2255,9 +3198,9 @@ def _get_analysis_queue_position_serialize( @validate_call - def get_analysis_status( + def get_analysis_strings_status( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2270,12 +3213,12 @@ def get_analysis_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseStatus: - """Gets the status of an analysis + ) -> GetAnalysisStringsStatusOutputBody: + """Get the string-extraction status for an analysis. - Given an analysis ID gets the current status of the analysis + Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2299,7 +3242,7 @@ def get_analysis_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_status_serialize( + _param = self._get_analysis_strings_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2308,8 +3251,11 @@ def get_analysis_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseStatus", - '422': "BaseResponse", + '200': "GetAnalysisStringsStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2323,9 +3269,9 @@ def get_analysis_status( @validate_call - def get_analysis_status_with_http_info( + def get_analysis_strings_status_with_http_info( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2338,12 +3284,12 @@ def get_analysis_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseStatus]: - """Gets the status of an analysis + ) -> ApiResponse[GetAnalysisStringsStatusOutputBody]: + """Get the string-extraction status for an analysis. - Given an analysis ID gets the current status of the analysis + Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2367,7 +3313,7 @@ def get_analysis_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_status_serialize( + _param = self._get_analysis_strings_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2376,8 +3322,11 @@ def get_analysis_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseStatus", - '422': "BaseResponse", + '200': "GetAnalysisStringsStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2391,9 +3340,9 @@ def get_analysis_status_with_http_info( @validate_call - def get_analysis_status_without_preload_content( + def get_analysis_strings_status_without_preload_content( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2407,11 +3356,11 @@ def get_analysis_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the status of an analysis + """Get the string-extraction status for an analysis. - Given an analysis ID gets the current status of the analysis + Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2435,7 +3384,7 @@ def get_analysis_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_status_serialize( + _param = self._get_analysis_strings_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2444,8 +3393,11 @@ def get_analysis_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseStatus", - '422': "BaseResponse", + '200': "GetAnalysisStringsStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2454,7 +3406,7 @@ def get_analysis_status_without_preload_content( return response_data.response - def _get_analysis_status_serialize( + def _get_analysis_strings_status_serialize( self, analysis_id, _request_auth, @@ -2502,7 +3454,7 @@ def _get_analysis_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/status', + resource_path='/v3/analyses/{analysis_id}/functions/strings/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index b4afdd94..40751963 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -16,8 +16,10 @@ from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import List, Optional +from typing import Any, Dict, List, Optional from typing_extensions import Annotated +from revengai.models.add_callee_input_body import AddCalleeInputBody +from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody from revengai.models.ai_unstrip_request import AiUnstripRequest from revengai.models.analysis_function_matching_request import AnalysisFunctionMatchingRequest from revengai.models.auto_unstrip_request import AutoUnstripRequest @@ -32,6 +34,7 @@ from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse from revengai.models.function_matching_request import FunctionMatchingRequest from revengai.models.function_matching_response import FunctionMatchingResponse +from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -52,10 +55,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def ai_unstrip( + def add_function_callee( self, - analysis_id: StrictInt, - ai_unstrip_request: AiUnstripRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + add_callee_input_body: AddCalleeInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -68,15 +71,15 @@ def ai_unstrip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AutoUnstripResponse: - """Performs matching and auto-unstrip for an analysis and its functions + ) -> Dict[str, object]: + """Add a callee to a function - Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system + Records an outgoing call edge from the given function to a callee. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) - :type analysis_id: int - :param ai_unstrip_request: (required) - :type ai_unstrip_request: AiUnstripRequest + :param function_id: Function ID (required) + :type function_id: int + :param add_callee_input_body: (required) + :type add_callee_input_body: AddCalleeInputBody :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 @@ -99,9 +102,9 @@ def ai_unstrip( :return: Returns the result object. """ # noqa: E501 - _param = self._ai_unstrip_serialize( - analysis_id=analysis_id, - ai_unstrip_request=ai_unstrip_request, + _param = self._add_function_callee_serialize( + function_id=function_id, + add_callee_input_body=add_callee_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -109,8 +112,12 @@ def ai_unstrip( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripResponse", - '422': "BaseResponse", + '201': "Dict[str, object]", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -124,10 +131,10 @@ def ai_unstrip( @validate_call - def ai_unstrip_with_http_info( + def add_function_callee_with_http_info( self, - analysis_id: StrictInt, - ai_unstrip_request: AiUnstripRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + add_callee_input_body: AddCalleeInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -140,15 +147,15 @@ def ai_unstrip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AutoUnstripResponse]: - """Performs matching and auto-unstrip for an analysis and its functions + ) -> ApiResponse[Dict[str, object]]: + """Add a callee to a function - Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system + Records an outgoing call edge from the given function to a callee. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) - :type analysis_id: int - :param ai_unstrip_request: (required) - :type ai_unstrip_request: AiUnstripRequest + :param function_id: Function ID (required) + :type function_id: int + :param add_callee_input_body: (required) + :type add_callee_input_body: AddCalleeInputBody :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 @@ -171,9 +178,9 @@ def ai_unstrip_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._ai_unstrip_serialize( - analysis_id=analysis_id, - ai_unstrip_request=ai_unstrip_request, + _param = self._add_function_callee_serialize( + function_id=function_id, + add_callee_input_body=add_callee_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -181,8 +188,12 @@ def ai_unstrip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripResponse", - '422': "BaseResponse", + '201': "Dict[str, object]", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -196,10 +207,10 @@ def ai_unstrip_with_http_info( @validate_call - def ai_unstrip_without_preload_content( + def add_function_callee_without_preload_content( self, - analysis_id: StrictInt, - ai_unstrip_request: AiUnstripRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + add_callee_input_body: AddCalleeInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -213,14 +224,14 @@ def ai_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Performs matching and auto-unstrip for an analysis and its functions + """Add a callee to a function - Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system + Records an outgoing call edge from the given function to a callee. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) - :type analysis_id: int - :param ai_unstrip_request: (required) - :type ai_unstrip_request: AiUnstripRequest + :param function_id: Function ID (required) + :type function_id: int + :param add_callee_input_body: (required) + :type add_callee_input_body: AddCalleeInputBody :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 @@ -243,9 +254,9 @@ def ai_unstrip_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._ai_unstrip_serialize( - analysis_id=analysis_id, - ai_unstrip_request=ai_unstrip_request, + _param = self._add_function_callee_serialize( + function_id=function_id, + add_callee_input_body=add_callee_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -253,8 +264,12 @@ def ai_unstrip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripResponse", - '422': "BaseResponse", + '201': "Dict[str, object]", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -263,10 +278,10 @@ def ai_unstrip_without_preload_content( return response_data.response - def _ai_unstrip_serialize( + def _add_function_callee_serialize( self, - analysis_id, - ai_unstrip_request, + function_id, + add_callee_input_body, _request_auth, _content_type, _headers, @@ -288,14 +303,14 @@ def _ai_unstrip_serialize( _body_params: Optional[bytes] = None # process the path parameters - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if ai_unstrip_request is not None: - _body_params = ai_unstrip_request + if add_callee_input_body is not None: + _body_params = add_callee_input_body # set the HTTP header `Accept` @@ -327,7 +342,7 @@ def _ai_unstrip_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/analyses/{analysis_id}/functions/ai-unstrip', + resource_path='/v3/functions/{function_id}/callees', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -344,10 +359,10 @@ def _ai_unstrip_serialize( @validate_call - def analysis_function_matching( + def add_user_string_to_function( self, - analysis_id: StrictInt, - analysis_function_matching_request: AnalysisFunctionMatchingRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + add_user_string_to_function_input_body: AddUserStringToFunctionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -360,15 +375,15 @@ def analysis_function_matching( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FunctionMatchingResponse: - """Perform matching for the functions of an analysis + ) -> Dict[str, object]: + """Add a user-provided string to a function. - Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids + Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) - :type analysis_id: int - :param analysis_function_matching_request: (required) - :type analysis_function_matching_request: AnalysisFunctionMatchingRequest + :param function_id: Function ID (required) + :type function_id: int + :param add_user_string_to_function_input_body: (required) + :type add_user_string_to_function_input_body: AddUserStringToFunctionInputBody :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 @@ -391,9 +406,9 @@ def analysis_function_matching( :return: Returns the result object. """ # noqa: E501 - _param = self._analysis_function_matching_serialize( - analysis_id=analysis_id, - analysis_function_matching_request=analysis_function_matching_request, + _param = self._add_user_string_to_function_serialize( + function_id=function_id, + add_user_string_to_function_input_body=add_user_string_to_function_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -401,8 +416,11 @@ def analysis_function_matching( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingResponse", - '422': "BaseResponse", + '201': "Dict[str, object]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -416,10 +434,10 @@ def analysis_function_matching( @validate_call - def analysis_function_matching_with_http_info( + def add_user_string_to_function_with_http_info( self, - analysis_id: StrictInt, - analysis_function_matching_request: AnalysisFunctionMatchingRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + add_user_string_to_function_input_body: AddUserStringToFunctionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -432,15 +450,15 @@ def analysis_function_matching_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[FunctionMatchingResponse]: - """Perform matching for the functions of an analysis + ) -> ApiResponse[Dict[str, object]]: + """Add a user-provided string to a function. - Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids + Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) - :type analysis_id: int - :param analysis_function_matching_request: (required) - :type analysis_function_matching_request: AnalysisFunctionMatchingRequest + :param function_id: Function ID (required) + :type function_id: int + :param add_user_string_to_function_input_body: (required) + :type add_user_string_to_function_input_body: AddUserStringToFunctionInputBody :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 @@ -463,9 +481,9 @@ def analysis_function_matching_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._analysis_function_matching_serialize( - analysis_id=analysis_id, - analysis_function_matching_request=analysis_function_matching_request, + _param = self._add_user_string_to_function_serialize( + function_id=function_id, + add_user_string_to_function_input_body=add_user_string_to_function_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -473,8 +491,11 @@ def analysis_function_matching_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingResponse", - '422': "BaseResponse", + '201': "Dict[str, object]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -488,10 +509,10 @@ def analysis_function_matching_with_http_info( @validate_call - def analysis_function_matching_without_preload_content( + def add_user_string_to_function_without_preload_content( self, - analysis_id: StrictInt, - analysis_function_matching_request: AnalysisFunctionMatchingRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + add_user_string_to_function_input_body: AddUserStringToFunctionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -505,14 +526,14 @@ def analysis_function_matching_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Perform matching for the functions of an analysis + """Add a user-provided string to a function. - Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids + Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) - :type analysis_id: int - :param analysis_function_matching_request: (required) - :type analysis_function_matching_request: AnalysisFunctionMatchingRequest + :param function_id: Function ID (required) + :type function_id: int + :param add_user_string_to_function_input_body: (required) + :type add_user_string_to_function_input_body: AddUserStringToFunctionInputBody :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 @@ -535,9 +556,9 @@ def analysis_function_matching_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._analysis_function_matching_serialize( - analysis_id=analysis_id, - analysis_function_matching_request=analysis_function_matching_request, + _param = self._add_user_string_to_function_serialize( + function_id=function_id, + add_user_string_to_function_input_body=add_user_string_to_function_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -545,8 +566,11 @@ def analysis_function_matching_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingResponse", - '422': "BaseResponse", + '201': "Dict[str, object]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -555,10 +579,10 @@ def analysis_function_matching_without_preload_content( return response_data.response - def _analysis_function_matching_serialize( + def _add_user_string_to_function_serialize( self, - analysis_id, - analysis_function_matching_request, + function_id, + add_user_string_to_function_input_body, _request_auth, _content_type, _headers, @@ -580,14 +604,14 @@ def _analysis_function_matching_serialize( _body_params: Optional[bytes] = None # process the path parameters - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if analysis_function_matching_request is not None: - _body_params = analysis_function_matching_request + if add_user_string_to_function_input_body is not None: + _body_params = add_user_string_to_function_input_body # set the HTTP header `Accept` @@ -619,7 +643,7 @@ def _analysis_function_matching_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/analyses/{analysis_id}/functions/matches', + resource_path='/v3/functions/{function_id}/user-provided-strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -636,10 +660,10 @@ def _analysis_function_matching_serialize( @validate_call - def auto_unstrip( + def ai_unstrip( self, analysis_id: StrictInt, - auto_unstrip_request: AutoUnstripRequest, + ai_unstrip_request: AiUnstripRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -655,12 +679,12 @@ def auto_unstrip( ) -> AutoUnstripResponse: """Performs matching and auto-unstrip for an analysis and its functions - Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system + Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system :param analysis_id: (required) :type analysis_id: int - :param auto_unstrip_request: (required) - :type auto_unstrip_request: AutoUnstripRequest + :param ai_unstrip_request: (required) + :type ai_unstrip_request: AiUnstripRequest :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 @@ -683,9 +707,9 @@ def auto_unstrip( :return: Returns the result object. """ # noqa: E501 - _param = self._auto_unstrip_serialize( + _param = self._ai_unstrip_serialize( analysis_id=analysis_id, - auto_unstrip_request=auto_unstrip_request, + ai_unstrip_request=ai_unstrip_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -708,10 +732,10 @@ def auto_unstrip( @validate_call - def auto_unstrip_with_http_info( + def ai_unstrip_with_http_info( self, analysis_id: StrictInt, - auto_unstrip_request: AutoUnstripRequest, + ai_unstrip_request: AiUnstripRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -727,12 +751,12 @@ def auto_unstrip_with_http_info( ) -> ApiResponse[AutoUnstripResponse]: """Performs matching and auto-unstrip for an analysis and its functions - Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system + Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system :param analysis_id: (required) :type analysis_id: int - :param auto_unstrip_request: (required) - :type auto_unstrip_request: AutoUnstripRequest + :param ai_unstrip_request: (required) + :type ai_unstrip_request: AiUnstripRequest :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 @@ -755,9 +779,9 @@ def auto_unstrip_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._auto_unstrip_serialize( + _param = self._ai_unstrip_serialize( analysis_id=analysis_id, - auto_unstrip_request=auto_unstrip_request, + ai_unstrip_request=ai_unstrip_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -780,10 +804,10 @@ def auto_unstrip_with_http_info( @validate_call - def auto_unstrip_without_preload_content( + def ai_unstrip_without_preload_content( self, analysis_id: StrictInt, - auto_unstrip_request: AutoUnstripRequest, + ai_unstrip_request: AiUnstripRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -799,12 +823,12 @@ def auto_unstrip_without_preload_content( ) -> RESTResponseType: """Performs matching and auto-unstrip for an analysis and its functions - Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system + Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system :param analysis_id: (required) :type analysis_id: int - :param auto_unstrip_request: (required) - :type auto_unstrip_request: AutoUnstripRequest + :param ai_unstrip_request: (required) + :type ai_unstrip_request: AiUnstripRequest :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 @@ -827,9 +851,9 @@ def auto_unstrip_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._auto_unstrip_serialize( + _param = self._ai_unstrip_serialize( analysis_id=analysis_id, - auto_unstrip_request=auto_unstrip_request, + ai_unstrip_request=ai_unstrip_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -847,10 +871,10 @@ def auto_unstrip_without_preload_content( return response_data.response - def _auto_unstrip_serialize( + def _ai_unstrip_serialize( self, analysis_id, - auto_unstrip_request, + ai_unstrip_request, _request_auth, _content_type, _headers, @@ -878,8 +902,8 @@ def _auto_unstrip_serialize( # process the header parameters # process the form parameters # process the body parameter - if auto_unstrip_request is not None: - _body_params = auto_unstrip_request + if ai_unstrip_request is not None: + _body_params = ai_unstrip_request # set the HTTP header `Accept` @@ -911,7 +935,7 @@ def _auto_unstrip_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/analyses/{analysis_id}/functions/auto-unstrip', + resource_path='/v2/analyses/{analysis_id}/functions/ai-unstrip', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -928,9 +952,10 @@ def _auto_unstrip_serialize( @validate_call - def batch_function_matching( + def analysis_function_matching( self, - function_matching_request: FunctionMatchingRequest, + analysis_id: StrictInt, + analysis_function_matching_request: AnalysisFunctionMatchingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -944,12 +969,14 @@ def batch_function_matching( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FunctionMatchingResponse: - """Perform function matching for an arbitrary batch of functions, binaries or collections + """Perform matching for the functions of an analysis - Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system + Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - :param function_matching_request: (required) - :type function_matching_request: FunctionMatchingRequest + :param analysis_id: (required) + :type analysis_id: int + :param analysis_function_matching_request: (required) + :type analysis_function_matching_request: AnalysisFunctionMatchingRequest :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 @@ -972,8 +999,9 @@ def batch_function_matching( :return: Returns the result object. """ # noqa: E501 - _param = self._batch_function_matching_serialize( - function_matching_request=function_matching_request, + _param = self._analysis_function_matching_serialize( + analysis_id=analysis_id, + analysis_function_matching_request=analysis_function_matching_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -996,9 +1024,10 @@ def batch_function_matching( @validate_call - def batch_function_matching_with_http_info( + def analysis_function_matching_with_http_info( self, - function_matching_request: FunctionMatchingRequest, + analysis_id: StrictInt, + analysis_function_matching_request: AnalysisFunctionMatchingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1012,12 +1041,14 @@ def batch_function_matching_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[FunctionMatchingResponse]: - """Perform function matching for an arbitrary batch of functions, binaries or collections + """Perform matching for the functions of an analysis - Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system + Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - :param function_matching_request: (required) - :type function_matching_request: FunctionMatchingRequest + :param analysis_id: (required) + :type analysis_id: int + :param analysis_function_matching_request: (required) + :type analysis_function_matching_request: AnalysisFunctionMatchingRequest :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 @@ -1040,8 +1071,9 @@ def batch_function_matching_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._batch_function_matching_serialize( - function_matching_request=function_matching_request, + _param = self._analysis_function_matching_serialize( + analysis_id=analysis_id, + analysis_function_matching_request=analysis_function_matching_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1064,9 +1096,10 @@ def batch_function_matching_with_http_info( @validate_call - def batch_function_matching_without_preload_content( + def analysis_function_matching_without_preload_content( self, - function_matching_request: FunctionMatchingRequest, + analysis_id: StrictInt, + analysis_function_matching_request: AnalysisFunctionMatchingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1080,12 +1113,14 @@ def batch_function_matching_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Perform function matching for an arbitrary batch of functions, binaries or collections + """Perform matching for the functions of an analysis - Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system + Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids - :param function_matching_request: (required) - :type function_matching_request: FunctionMatchingRequest + :param analysis_id: (required) + :type analysis_id: int + :param analysis_function_matching_request: (required) + :type analysis_function_matching_request: AnalysisFunctionMatchingRequest :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 @@ -1108,8 +1143,9 @@ def batch_function_matching_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._batch_function_matching_serialize( - function_matching_request=function_matching_request, + _param = self._analysis_function_matching_serialize( + analysis_id=analysis_id, + analysis_function_matching_request=analysis_function_matching_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1127,9 +1163,10 @@ def batch_function_matching_without_preload_content( return response_data.response - def _batch_function_matching_serialize( + def _analysis_function_matching_serialize( self, - function_matching_request, + analysis_id, + analysis_function_matching_request, _request_auth, _content_type, _headers, @@ -1151,12 +1188,14 @@ def _batch_function_matching_serialize( _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 - if function_matching_request is not None: - _body_params = function_matching_request + if analysis_function_matching_request is not None: + _body_params = analysis_function_matching_request # set the HTTP header `Accept` @@ -1188,7 +1227,7 @@ def _batch_function_matching_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/functions/matches', + resource_path='/v2/analyses/{analysis_id}/functions/matches', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1205,9 +1244,10 @@ def _batch_function_matching_serialize( @validate_call - def cancel_ai_unstrip( + def auto_unstrip( self, analysis_id: StrictInt, + auto_unstrip_request: AutoUnstripRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1221,9 +1261,713 @@ def cancel_ai_unstrip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AutoUnstripResponse: - """Cancels a running ai-unstrip + """Performs matching and auto-unstrip for an analysis and its functions - Takes in the analysis ID and cancels a running ai-unstrip operation + Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system + + :param analysis_id: (required) + :type analysis_id: int + :param auto_unstrip_request: (required) + :type auto_unstrip_request: AutoUnstripRequest + :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._auto_unstrip_serialize( + analysis_id=analysis_id, + auto_unstrip_request=auto_unstrip_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoUnstripResponse", + '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 auto_unstrip_with_http_info( + self, + analysis_id: StrictInt, + auto_unstrip_request: AutoUnstripRequest, + _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[AutoUnstripResponse]: + """Performs matching and auto-unstrip for an analysis and its functions + + Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system + + :param analysis_id: (required) + :type analysis_id: int + :param auto_unstrip_request: (required) + :type auto_unstrip_request: AutoUnstripRequest + :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._auto_unstrip_serialize( + analysis_id=analysis_id, + auto_unstrip_request=auto_unstrip_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoUnstripResponse", + '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 auto_unstrip_without_preload_content( + self, + analysis_id: StrictInt, + auto_unstrip_request: AutoUnstripRequest, + _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: + """Performs matching and auto-unstrip for an analysis and its functions + + Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system + + :param analysis_id: (required) + :type analysis_id: int + :param auto_unstrip_request: (required) + :type auto_unstrip_request: AutoUnstripRequest + :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._auto_unstrip_serialize( + analysis_id=analysis_id, + auto_unstrip_request=auto_unstrip_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoUnstripResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _auto_unstrip_serialize( + self, + analysis_id, + auto_unstrip_request, + _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 + if auto_unstrip_request is not None: + _body_params = auto_unstrip_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/analyses/{analysis_id}/functions/auto-unstrip', + 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 batch_function_matching( + self, + function_matching_request: FunctionMatchingRequest, + _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, + ) -> FunctionMatchingResponse: + """Perform function matching for an arbitrary batch of functions, binaries or collections + + Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system + + :param function_matching_request: (required) + :type function_matching_request: FunctionMatchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_function_matching_serialize( + function_matching_request=function_matching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionMatchingResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def batch_function_matching_with_http_info( + self, + function_matching_request: FunctionMatchingRequest, + _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[FunctionMatchingResponse]: + """Perform function matching for an arbitrary batch of functions, binaries or collections + + Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system + + :param function_matching_request: (required) + :type function_matching_request: FunctionMatchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_function_matching_serialize( + function_matching_request=function_matching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionMatchingResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def batch_function_matching_without_preload_content( + self, + function_matching_request: FunctionMatchingRequest, + _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: + """Perform function matching for an arbitrary batch of functions, binaries or collections + + Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system + + :param function_matching_request: (required) + :type function_matching_request: FunctionMatchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_function_matching_serialize( + function_matching_request=function_matching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FunctionMatchingResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _batch_function_matching_serialize( + self, + function_matching_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if function_matching_request is not None: + _body_params = function_matching_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/functions/matches', + 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 cancel_ai_unstrip( + 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, + ) -> AutoUnstripResponse: + """Cancels a running ai-unstrip + + Takes in the analysis ID and cancels a running ai-unstrip operation + + :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._cancel_ai_unstrip_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': "AutoUnstripResponse", + '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 cancel_ai_unstrip_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[AutoUnstripResponse]: + """Cancels a running ai-unstrip + + Takes in the analysis ID and cancels a running ai-unstrip operation + + :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._cancel_ai_unstrip_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': "AutoUnstripResponse", + '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 cancel_ai_unstrip_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: + """Cancels a running ai-unstrip + + Takes in the analysis ID and cancels a running ai-unstrip operation :param analysis_id: (required) :type analysis_id: int @@ -1257,6 +2001,134 @@ def cancel_ai_unstrip( _host_index=_host_index ) + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoUnstripResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _cancel_ai_unstrip_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='DELETE', + resource_path='/v2/analyses/{analysis_id}/functions/ai-unstrip/cancel', + 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 cancel_auto_unstrip( + 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, + ) -> AutoUnstripResponse: + """Cancels a running auto-unstrip + + Takes in the analysis ID and cancels a running auto-unstrip operation + + :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._cancel_auto_unstrip_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': "AutoUnstripResponse", '422': "BaseResponse", @@ -1273,7 +2145,7 @@ def cancel_ai_unstrip( @validate_call - def cancel_ai_unstrip_with_http_info( + def cancel_auto_unstrip_with_http_info( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1289,9 +2161,9 @@ def cancel_ai_unstrip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AutoUnstripResponse]: - """Cancels a running ai-unstrip + """Cancels a running auto-unstrip - Takes in the analysis ID and cancels a running ai-unstrip operation + Takes in the analysis ID and cancels a running auto-unstrip operation :param analysis_id: (required) :type analysis_id: int @@ -1317,7 +2189,7 @@ def cancel_ai_unstrip_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._cancel_ai_unstrip_serialize( + _param = self._cancel_auto_unstrip_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1341,7 +2213,7 @@ def cancel_ai_unstrip_with_http_info( @validate_call - def cancel_ai_unstrip_without_preload_content( + def cancel_auto_unstrip_without_preload_content( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -1357,9 +2229,9 @@ def cancel_ai_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Cancels a running ai-unstrip + """Cancels a running auto-unstrip - Takes in the analysis ID and cancels a running ai-unstrip operation + Takes in the analysis ID and cancels a running auto-unstrip operation :param analysis_id: (required) :type analysis_id: int @@ -1385,7 +2257,7 @@ def cancel_ai_unstrip_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._cancel_ai_unstrip_serialize( + _param = self._cancel_auto_unstrip_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1404,7 +2276,7 @@ def cancel_ai_unstrip_without_preload_content( return response_data.response - def _cancel_ai_unstrip_serialize( + def _cancel_auto_unstrip_serialize( self, analysis_id, _request_auth, @@ -1452,7 +2324,7 @@ def _cancel_ai_unstrip_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/v2/analyses/{analysis_id}/functions/ai-unstrip/cancel', + resource_path='/v2/analyses/{analysis_id}/functions/unstrip/cancel', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1469,9 +2341,15 @@ def _cancel_ai_unstrip_serialize( @validate_call - def cancel_auto_unstrip( + def get_analysis_strings( 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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + function_search: Annotated[Optional[StrictStr], Field(description="Search is applied to function names")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Order by field")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort order for the results")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1484,13 +2362,25 @@ def cancel_auto_unstrip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AutoUnstripResponse: - """Cancels a running auto-unstrip + ) -> BaseResponseAnalysisStringsResponse: + """Get string information found in the Analysis - Takes in the analysis ID and cancels a running auto-unstrip operation + Get string information found in the 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 search: Search is applied to string value + :type search: str + :param function_search: Search is applied to function names + :type function_search: str + :param order_by: Order by field + :type order_by: str + :param sort_order: Sort order for the results + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1513,8 +2403,14 @@ def cancel_auto_unstrip( :return: Returns the result object. """ # noqa: E501 - _param = self._cancel_auto_unstrip_serialize( + _param = self._get_analysis_strings_serialize( analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1522,7 +2418,7 @@ def cancel_auto_unstrip( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripResponse", + '200': "BaseResponseAnalysisStringsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1537,9 +2433,15 @@ def cancel_auto_unstrip( @validate_call - def cancel_auto_unstrip_with_http_info( + def get_analysis_strings_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + function_search: Annotated[Optional[StrictStr], Field(description="Search is applied to function names")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Order by field")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort order for the results")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1552,13 +2454,25 @@ def cancel_auto_unstrip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AutoUnstripResponse]: - """Cancels a running auto-unstrip + ) -> ApiResponse[BaseResponseAnalysisStringsResponse]: + """Get string information found in the Analysis - Takes in the analysis ID and cancels a running auto-unstrip operation + Get string information found in the 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 search: Search is applied to string value + :type search: str + :param function_search: Search is applied to function names + :type function_search: str + :param order_by: Order by field + :type order_by: str + :param sort_order: Sort order for the results + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1581,8 +2495,14 @@ def cancel_auto_unstrip_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._cancel_auto_unstrip_serialize( + _param = self._get_analysis_strings_serialize( analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1590,7 +2510,7 @@ def cancel_auto_unstrip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripResponse", + '200': "BaseResponseAnalysisStringsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1605,9 +2525,15 @@ def cancel_auto_unstrip_with_http_info( @validate_call - def cancel_auto_unstrip_without_preload_content( + def get_analysis_strings_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + function_search: Annotated[Optional[StrictStr], Field(description="Search is applied to function names")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Order by field")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort order for the results")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1621,12 +2547,24 @@ def cancel_auto_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Cancels a running auto-unstrip + """Get string information found in the Analysis - Takes in the analysis ID and cancels a running auto-unstrip operation + Get string information found in the 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 search: Search is applied to string value + :type search: str + :param function_search: Search is applied to function names + :type function_search: str + :param order_by: Order by field + :type order_by: str + :param sort_order: Sort order for the results + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1649,8 +2587,14 @@ def cancel_auto_unstrip_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._cancel_auto_unstrip_serialize( + _param = self._get_analysis_strings_serialize( analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1658,7 +2602,7 @@ def cancel_auto_unstrip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripResponse", + '200': "BaseResponseAnalysisStringsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1668,9 +2612,15 @@ def cancel_auto_unstrip_without_preload_content( return response_data.response - def _cancel_auto_unstrip_serialize( + def _get_analysis_strings_serialize( self, analysis_id, + page, + page_size, + search, + function_search, + order_by, + sort_order, _request_auth, _content_type, _headers, @@ -1695,6 +2645,30 @@ def _cancel_auto_unstrip_serialize( 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)) + + if search is not None: + + _query_params.append(('search', search)) + + if function_search is not None: + + _query_params.append(('function_search', function_search)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if sort_order is not None: + + _query_params.append(('sort_order', sort_order)) + # process the header parameters # process the form parameters # process the body parameter @@ -1715,8 +2689,8 @@ def _cancel_auto_unstrip_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/analyses/{analysis_id}/functions/unstrip/cancel', + method='GET', + resource_path='/v2/analyses/{analysis_id}/functions/strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1733,15 +2707,9 @@ def _cancel_auto_unstrip_serialize( @validate_call - def get_analysis_strings( + def get_analysis_strings_status( 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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, - function_search: Annotated[Optional[StrictStr], Field(description="Search is applied to function names")] = None, - order_by: Annotated[Optional[StrictStr], Field(description="Order by field")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="Sort order for the results")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1754,25 +2722,13 @@ def get_analysis_strings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseAnalysisStringsResponse: - """Get string information found in the Analysis + ) -> BaseResponseAnalysisStringsStatusResponse: + """Get string processing state for the Analysis - Get string information found in the analysis + Get string processing state for the 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 search: Search is applied to string value - :type search: str - :param function_search: Search is applied to function names - :type function_search: str - :param order_by: Order by field - :type order_by: str - :param sort_order: Sort order for the results - :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1795,14 +2751,8 @@ def get_analysis_strings( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_strings_serialize( + _param = self._get_analysis_strings_status_serialize( analysis_id=analysis_id, - page=page, - page_size=page_size, - search=search, - function_search=function_search, - order_by=order_by, - sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1810,7 +2760,7 @@ def get_analysis_strings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisStringsResponse", + '200': "BaseResponseAnalysisStringsStatusResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1825,15 +2775,9 @@ def get_analysis_strings( @validate_call - def get_analysis_strings_with_http_info( + def get_analysis_strings_status_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, - function_search: Annotated[Optional[StrictStr], Field(description="Search is applied to function names")] = None, - order_by: Annotated[Optional[StrictStr], Field(description="Order by field")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="Sort order for the results")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1846,25 +2790,13 @@ def get_analysis_strings_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseAnalysisStringsResponse]: - """Get string information found in the Analysis + ) -> ApiResponse[BaseResponseAnalysisStringsStatusResponse]: + """Get string processing state for the Analysis - Get string information found in the analysis + Get string processing state for the 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 search: Search is applied to string value - :type search: str - :param function_search: Search is applied to function names - :type function_search: str - :param order_by: Order by field - :type order_by: str - :param sort_order: Sort order for the results - :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1887,14 +2819,8 @@ def get_analysis_strings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_strings_serialize( + _param = self._get_analysis_strings_status_serialize( analysis_id=analysis_id, - page=page, - page_size=page_size, - search=search, - function_search=function_search, - order_by=order_by, - sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1902,7 +2828,7 @@ def get_analysis_strings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisStringsResponse", + '200': "BaseResponseAnalysisStringsStatusResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1917,15 +2843,9 @@ def get_analysis_strings_with_http_info( @validate_call - def get_analysis_strings_without_preload_content( + def get_analysis_strings_status_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, - function_search: Annotated[Optional[StrictStr], Field(description="Search is applied to function names")] = None, - order_by: Annotated[Optional[StrictStr], Field(description="Order by field")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="Sort order for the results")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1939,24 +2859,12 @@ def get_analysis_strings_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get string information found in the Analysis + """Get string processing state for the Analysis - Get string information found in the analysis + Get string processing state for the 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 search: Search is applied to string value - :type search: str - :param function_search: Search is applied to function names - :type function_search: str - :param order_by: Order by field - :type order_by: str - :param sort_order: Sort order for the results - :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1979,14 +2887,8 @@ def get_analysis_strings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_strings_serialize( + _param = self._get_analysis_strings_status_serialize( analysis_id=analysis_id, - page=page, - page_size=page_size, - search=search, - function_search=function_search, - order_by=order_by, - sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1994,7 +2896,7 @@ def get_analysis_strings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisStringsResponse", + '200': "BaseResponseAnalysisStringsStatusResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2004,15 +2906,9 @@ def get_analysis_strings_without_preload_content( return response_data.response - def _get_analysis_strings_serialize( + def _get_analysis_strings_status_serialize( self, analysis_id, - page, - page_size, - search, - function_search, - order_by, - sort_order, _request_auth, _content_type, _headers, @@ -2037,30 +2933,6 @@ def _get_analysis_strings_serialize( 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)) - - if search is not None: - - _query_params.append(('search', search)) - - if function_search is not None: - - _query_params.append(('function_search', function_search)) - - if order_by is not None: - - _query_params.append(('order_by', order_by)) - - if sort_order is not None: - - _query_params.append(('sort_order', sort_order)) - # process the header parameters # process the form parameters # process the body parameter @@ -2082,7 +2954,7 @@ def _get_analysis_strings_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/functions/strings', + resource_path='/v2/analyses/{analysis_id}/functions/strings/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2099,9 +2971,9 @@ def _get_analysis_strings_serialize( @validate_call - def get_analysis_strings_status( + def get_function_blocks( self, - analysis_id: StrictInt, + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2114,13 +2986,13 @@ def get_analysis_strings_status( _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 + ) -> BaseResponseFunctionBlocksResponse: + """Get disassembly blocks related to the function - Get string processing state for the Analysis + Get disassembly blocks related to the function - :param analysis_id: (required) - :type analysis_id: int + :param function_id: (required) + :type function_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 @@ -2143,8 +3015,8 @@ def get_analysis_strings_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_strings_status_serialize( - analysis_id=analysis_id, + _param = self._get_function_blocks_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2152,8 +3024,9 @@ def get_analysis_strings_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisStringsStatusResponse", + '200': "BaseResponseFunctionBlocksResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2167,9 +3040,9 @@ def get_analysis_strings_status( @validate_call - def get_analysis_strings_status_with_http_info( + def get_function_blocks_with_http_info( self, - analysis_id: StrictInt, + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2182,13 +3055,13 @@ def get_analysis_strings_status_with_http_info( _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 + ) -> ApiResponse[BaseResponseFunctionBlocksResponse]: + """Get disassembly blocks related to the function - Get string processing state for the Analysis + Get disassembly blocks related to the function - :param analysis_id: (required) - :type analysis_id: int + :param function_id: (required) + :type function_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 @@ -2211,8 +3084,8 @@ def get_analysis_strings_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_strings_status_serialize( - analysis_id=analysis_id, + _param = self._get_function_blocks_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2220,8 +3093,9 @@ def get_analysis_strings_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisStringsStatusResponse", + '200': "BaseResponseFunctionBlocksResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2235,9 +3109,9 @@ def get_analysis_strings_status_with_http_info( @validate_call - def get_analysis_strings_status_without_preload_content( + def get_function_blocks_without_preload_content( self, - analysis_id: StrictInt, + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2251,12 +3125,12 @@ def get_analysis_strings_status_without_preload_content( _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 disassembly blocks related to the function - Get string processing state for the Analysis + Get disassembly blocks related to the function - :param analysis_id: (required) - :type analysis_id: int + :param function_id: (required) + :type function_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 @@ -2279,8 +3153,8 @@ def get_analysis_strings_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_strings_status_serialize( - analysis_id=analysis_id, + _param = self._get_function_blocks_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2288,8 +3162,9 @@ def get_analysis_strings_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseAnalysisStringsStatusResponse", + '200': "BaseResponseFunctionBlocksResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2298,9 +3173,9 @@ def get_analysis_strings_status_without_preload_content( return response_data.response - def _get_analysis_strings_status_serialize( + def _get_function_blocks_serialize( self, - analysis_id, + function_id, _request_auth, _content_type, _headers, @@ -2322,8 +3197,8 @@ def _get_analysis_strings_status_serialize( _body_params: Optional[bytes] = None # process the path parameters - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters # process the header parameters # process the form parameters @@ -2346,7 +3221,7 @@ def _get_analysis_strings_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/functions/strings/status', + resource_path='/v2/functions/{function_id}/blocks', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2363,7 +3238,7 @@ def _get_analysis_strings_status_serialize( @validate_call - def get_function_blocks( + def get_function_callees_callers( self, function_id: StrictInt, _request_timeout: Union[ @@ -2378,10 +3253,9 @@ def get_function_blocks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionBlocksResponse: - """Get disassembly blocks related to the function + ) -> BaseResponseCalleesCallerFunctionsResponse: + """Get list of functions that call or are called by the specified function - Get disassembly blocks related to the function :param function_id: (required) :type function_id: int @@ -2407,7 +3281,7 @@ def get_function_blocks( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_blocks_serialize( + _param = self._get_function_callees_callers_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2416,9 +3290,8 @@ def get_function_blocks( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionBlocksResponse", + '200': "BaseResponseCalleesCallerFunctionsResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2432,7 +3305,7 @@ def get_function_blocks( @validate_call - def get_function_blocks_with_http_info( + def get_function_callees_callers_with_http_info( self, function_id: StrictInt, _request_timeout: Union[ @@ -2447,10 +3320,9 @@ def get_function_blocks_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionBlocksResponse]: - """Get disassembly blocks related to the function + ) -> ApiResponse[BaseResponseCalleesCallerFunctionsResponse]: + """Get list of functions that call or are called by the specified function - Get disassembly blocks related to the function :param function_id: (required) :type function_id: int @@ -2476,7 +3348,7 @@ def get_function_blocks_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_blocks_serialize( + _param = self._get_function_callees_callers_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2485,9 +3357,8 @@ def get_function_blocks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionBlocksResponse", + '200': "BaseResponseCalleesCallerFunctionsResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2501,7 +3372,7 @@ def get_function_blocks_with_http_info( @validate_call - def get_function_blocks_without_preload_content( + def get_function_callees_callers_without_preload_content( self, function_id: StrictInt, _request_timeout: Union[ @@ -2517,9 +3388,8 @@ def get_function_blocks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get disassembly blocks related to the function + """Get list of functions that call or are called by the specified function - Get disassembly blocks related to the function :param function_id: (required) :type function_id: int @@ -2545,7 +3415,7 @@ def get_function_blocks_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_blocks_serialize( + _param = self._get_function_callees_callers_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2554,9 +3424,8 @@ def get_function_blocks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionBlocksResponse", + '200': "BaseResponseCalleesCallerFunctionsResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2565,7 +3434,7 @@ def get_function_blocks_without_preload_content( return response_data.response - def _get_function_blocks_serialize( + def _get_function_callees_callers_serialize( self, function_id, _request_auth, @@ -2613,7 +3482,7 @@ def _get_function_blocks_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/blocks', + resource_path='/v2/functions/{function_id}/callees_callers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2630,9 +3499,9 @@ def _get_function_blocks_serialize( @validate_call - def get_function_callees_callers( + def get_function_callees_callers_bulk( self, - function_id: StrictInt, + function_ids: List[Optional[StrictInt]], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2645,12 +3514,12 @@ def get_function_callees_callers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseCalleesCallerFunctionsResponse: - """Get list of functions that call or are called by the specified function + ) -> BaseResponseListCalleesCallerFunctionsResponse: + """Get list of functions that call or are called for a list of functions - :param function_id: (required) - :type function_id: int + :param function_ids: (required) + :type function_ids: List[Optional[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 @@ -2673,8 +3542,8 @@ def get_function_callees_callers( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_serialize( - function_id=function_id, + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2682,7 +3551,7 @@ def get_function_callees_callers( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCalleesCallerFunctionsResponse", + '200': "BaseResponseListCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2697,9 +3566,9 @@ def get_function_callees_callers( @validate_call - def get_function_callees_callers_with_http_info( + def get_function_callees_callers_bulk_with_http_info( self, - function_id: StrictInt, + function_ids: List[Optional[StrictInt]], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2712,12 +3581,12 @@ def get_function_callees_callers_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseCalleesCallerFunctionsResponse]: - """Get list of functions that call or are called by the specified function + ) -> ApiResponse[BaseResponseListCalleesCallerFunctionsResponse]: + """Get list of functions that call or are called for a list of functions - :param function_id: (required) - :type function_id: int + :param function_ids: (required) + :type function_ids: List[Optional[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 @@ -2740,8 +3609,8 @@ def get_function_callees_callers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_serialize( - function_id=function_id, + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2749,7 +3618,7 @@ def get_function_callees_callers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCalleesCallerFunctionsResponse", + '200': "BaseResponseListCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2764,9 +3633,9 @@ def get_function_callees_callers_with_http_info( @validate_call - def get_function_callees_callers_without_preload_content( + def get_function_callees_callers_bulk_without_preload_content( self, - function_id: StrictInt, + function_ids: List[Optional[StrictInt]], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2780,11 +3649,11 @@ def get_function_callees_callers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get list of functions that call or are called by the specified function + """Get list of functions that call or are called for a list of functions - :param function_id: (required) - :type function_id: int + :param function_ids: (required) + :type function_ids: List[Optional[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 @@ -2807,8 +3676,8 @@ def get_function_callees_callers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_serialize( - function_id=function_id, + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2816,7 +3685,7 @@ def get_function_callees_callers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCalleesCallerFunctionsResponse", + '200': "BaseResponseListCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2826,9 +3695,9 @@ def get_function_callees_callers_without_preload_content( return response_data.response - def _get_function_callees_callers_serialize( + def _get_function_callees_callers_bulk_serialize( self, - function_id, + function_ids, _request_auth, _content_type, _headers, @@ -2838,6 +3707,7 @@ def _get_function_callees_callers_serialize( _host = None _collection_formats: Dict[str, str] = { + 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -2850,9 +3720,11 @@ def _get_function_callees_callers_serialize( _body_params: Optional[bytes] = None # process the path parameters - if function_id is not None: - _path_params['function_id'] = function_id # process the query parameters + if function_ids is not None: + + _query_params.append(('function_ids', function_ids)) + # process the header parameters # process the form parameters # process the body parameter @@ -2874,7 +3746,7 @@ def _get_function_callees_callers_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/callees_callers', + resource_path='/v2/functions/callees_callers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2891,9 +3763,9 @@ def _get_function_callees_callers_serialize( @validate_call - def get_function_callees_callers_bulk( + def get_function_capabilities( self, - function_ids: List[Optional[StrictInt]], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2906,12 +3778,12 @@ def get_function_callees_callers_bulk( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseListCalleesCallerFunctionsResponse: - """Get list of functions that call or are called for a list of functions + ) -> BaseResponseFunctionCapabilityResponse: + """Retrieve a functions capabilities - :param function_ids: (required) - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_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 @@ -2934,8 +3806,8 @@ def get_function_callees_callers_bulk( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_bulk_serialize( - function_ids=function_ids, + _param = self._get_function_capabilities_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2943,8 +3815,9 @@ def get_function_callees_callers_bulk( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCalleesCallerFunctionsResponse", + '200': "BaseResponseFunctionCapabilityResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2958,9 +3831,9 @@ def get_function_callees_callers_bulk( @validate_call - def get_function_callees_callers_bulk_with_http_info( + def get_function_capabilities_with_http_info( self, - function_ids: List[Optional[StrictInt]], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2973,12 +3846,12 @@ def get_function_callees_callers_bulk_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseListCalleesCallerFunctionsResponse]: - """Get list of functions that call or are called for a list of functions + ) -> ApiResponse[BaseResponseFunctionCapabilityResponse]: + """Retrieve a functions capabilities - :param function_ids: (required) - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_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 @@ -3001,8 +3874,8 @@ def get_function_callees_callers_bulk_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_bulk_serialize( - function_ids=function_ids, + _param = self._get_function_capabilities_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3010,8 +3883,9 @@ def get_function_callees_callers_bulk_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCalleesCallerFunctionsResponse", + '200': "BaseResponseFunctionCapabilityResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3025,9 +3899,9 @@ def get_function_callees_callers_bulk_with_http_info( @validate_call - def get_function_callees_callers_bulk_without_preload_content( + def get_function_capabilities_without_preload_content( self, - function_ids: List[Optional[StrictInt]], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3041,11 +3915,11 @@ def get_function_callees_callers_bulk_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get list of functions that call or are called for a list of functions + """Retrieve a functions capabilities - :param function_ids: (required) - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_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 @@ -3068,8 +3942,8 @@ def get_function_callees_callers_bulk_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_bulk_serialize( - function_ids=function_ids, + _param = self._get_function_capabilities_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3077,8 +3951,9 @@ def get_function_callees_callers_bulk_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCalleesCallerFunctionsResponse", + '200': "BaseResponseFunctionCapabilityResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3087,9 +3962,9 @@ def get_function_callees_callers_bulk_without_preload_content( return response_data.response - def _get_function_callees_callers_bulk_serialize( + def _get_function_capabilities_serialize( self, - function_ids, + function_id, _request_auth, _content_type, _headers, @@ -3099,7 +3974,6 @@ def _get_function_callees_callers_bulk_serialize( _host = None _collection_formats: Dict[str, str] = { - 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -3112,11 +3986,9 @@ def _get_function_callees_callers_bulk_serialize( _body_params: Optional[bytes] = None # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters - if function_ids is not None: - - _query_params.append(('function_ids', function_ids)) - # process the header parameters # process the form parameters # process the body parameter @@ -3138,7 +4010,7 @@ def _get_function_callees_callers_bulk_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/callees_callers', + resource_path='/v2/functions/{function_id}/capabilities', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3155,7 +4027,7 @@ def _get_function_callees_callers_bulk_serialize( @validate_call - def get_function_capabilities( + def get_function_details( self, function_id: StrictInt, _request_timeout: Union[ @@ -3170,8 +4042,8 @@ def get_function_capabilities( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionCapabilityResponse: - """Retrieve a functions capabilities + ) -> BaseResponseFunctionsDetailResponse: + """Get function details :param function_id: (required) @@ -3198,7 +4070,7 @@ def get_function_capabilities( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_capabilities_serialize( + _param = self._get_function_details_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3207,9 +4079,8 @@ def get_function_capabilities( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionCapabilityResponse", + '200': "BaseResponseFunctionsDetailResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3223,7 +4094,7 @@ def get_function_capabilities( @validate_call - def get_function_capabilities_with_http_info( + def get_function_details_with_http_info( self, function_id: StrictInt, _request_timeout: Union[ @@ -3238,8 +4109,8 @@ def get_function_capabilities_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionCapabilityResponse]: - """Retrieve a functions capabilities + ) -> ApiResponse[BaseResponseFunctionsDetailResponse]: + """Get function details :param function_id: (required) @@ -3266,7 +4137,7 @@ def get_function_capabilities_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_capabilities_serialize( + _param = self._get_function_details_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3275,9 +4146,8 @@ def get_function_capabilities_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionCapabilityResponse", + '200': "BaseResponseFunctionsDetailResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3291,7 +4161,7 @@ def get_function_capabilities_with_http_info( @validate_call - def get_function_capabilities_without_preload_content( + def get_function_details_without_preload_content( self, function_id: StrictInt, _request_timeout: Union[ @@ -3307,7 +4177,7 @@ def get_function_capabilities_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Retrieve a functions capabilities + """Get function details :param function_id: (required) @@ -3334,7 +4204,7 @@ def get_function_capabilities_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_capabilities_serialize( + _param = self._get_function_details_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3343,9 +4213,8 @@ def get_function_capabilities_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionCapabilityResponse", + '200': "BaseResponseFunctionsDetailResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3354,7 +4223,7 @@ def get_function_capabilities_without_preload_content( return response_data.response - def _get_function_capabilities_serialize( + def _get_function_details_serialize( self, function_id, _request_auth, @@ -3402,7 +4271,7 @@ def _get_function_capabilities_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/capabilities', + resource_path='/v2/functions/{function_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3419,9 +4288,12 @@ def _get_function_capabilities_serialize( @validate_call - def get_function_details( + def get_function_strings( self, function_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3434,12 +4306,19 @@ def get_function_details( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionsDetailResponse: - """Get function details + ) -> BaseResponseFunctionStringsResponse: + """Get string information found in the function + Get string information found in the function :param function_id: (required) :type function_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 search: Search is applied to string value + :type search: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3462,8 +4341,11 @@ def get_function_details( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_details_serialize( + _param = self._get_function_strings_serialize( function_id=function_id, + page=page, + page_size=page_size, + search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3471,7 +4353,7 @@ def get_function_details( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionsDetailResponse", + '200': "BaseResponseFunctionStringsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3486,9 +4368,12 @@ def get_function_details( @validate_call - def get_function_details_with_http_info( + def get_function_strings_with_http_info( self, function_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3501,12 +4386,19 @@ def get_function_details_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionsDetailResponse]: - """Get function details + ) -> ApiResponse[BaseResponseFunctionStringsResponse]: + """Get string information found in the function + Get string information found in the function :param function_id: (required) :type function_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 search: Search is applied to string value + :type search: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3529,8 +4421,11 @@ def get_function_details_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_details_serialize( + _param = self._get_function_strings_serialize( function_id=function_id, + page=page, + page_size=page_size, + search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3538,7 +4433,7 @@ def get_function_details_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionsDetailResponse", + '200': "BaseResponseFunctionStringsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3553,9 +4448,12 @@ def get_function_details_with_http_info( @validate_call - def get_function_details_without_preload_content( + def get_function_strings_without_preload_content( self, function_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3569,11 +4467,18 @@ def get_function_details_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get function details + """Get string information found in the function + Get string information found in the function :param function_id: (required) :type function_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 search: Search is applied to string value + :type search: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3596,8 +4501,11 @@ def get_function_details_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_details_serialize( + _param = self._get_function_strings_serialize( function_id=function_id, + page=page, + page_size=page_size, + search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3605,7 +4513,7 @@ def get_function_details_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionsDetailResponse", + '200': "BaseResponseFunctionStringsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3615,9 +4523,12 @@ def get_function_details_without_preload_content( return response_data.response - def _get_function_details_serialize( + def _get_function_strings_serialize( self, function_id, + page, + page_size, + search, _request_auth, _content_type, _headers, @@ -3642,6 +4553,18 @@ def _get_function_details_serialize( if function_id is not None: _path_params['function_id'] = function_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)) + + if search is not None: + + _query_params.append(('search', search)) + # process the header parameters # process the form parameters # process the body parameter @@ -3663,7 +4586,7 @@ def _get_function_details_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}', + resource_path='/v2/functions/{function_id}/strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3680,12 +4603,12 @@ def _get_function_details_serialize( @validate_call - def get_function_strings( + def get_function_strings_0( self, - function_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3698,18 +4621,18 @@ def get_function_strings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionStringsResponse: - """Get string information found in the function + ) -> ListFunctionStringsOutputBody: + """List strings for a function. - Get string information found in the function + Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int - :param page: The page number to retrieve. + :param page: Page number (1-indexed). :type page: int - :param page_size: Number of items per page. + :param page_size: Number of results per page. :type page_size: int - :param search: Search is applied to string value + :param search: Filter by string value (case-insensitive substring match). :type search: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3733,7 +4656,7 @@ def get_function_strings( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_strings_serialize( + _param = self._get_function_strings_0_serialize( function_id=function_id, page=page, page_size=page_size, @@ -3745,8 +4668,11 @@ def get_function_strings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionStringsResponse", - '422': "BaseResponse", + '200': "ListFunctionStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3760,12 +4686,12 @@ def get_function_strings( @validate_call - def get_function_strings_with_http_info( + def get_function_strings_0_with_http_info( self, - function_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3778,18 +4704,18 @@ def get_function_strings_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionStringsResponse]: - """Get string information found in the function + ) -> ApiResponse[ListFunctionStringsOutputBody]: + """List strings for a function. - Get string information found in the function + Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int - :param page: The page number to retrieve. + :param page: Page number (1-indexed). :type page: int - :param page_size: Number of items per page. + :param page_size: Number of results per page. :type page_size: int - :param search: Search is applied to string value + :param search: Filter by string value (case-insensitive substring match). :type search: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3813,7 +4739,7 @@ def get_function_strings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_strings_serialize( + _param = self._get_function_strings_0_serialize( function_id=function_id, page=page, page_size=page_size, @@ -3825,8 +4751,11 @@ def get_function_strings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionStringsResponse", - '422': "BaseResponse", + '200': "ListFunctionStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3840,12 +4769,12 @@ def get_function_strings_with_http_info( @validate_call - def get_function_strings_without_preload_content( + def get_function_strings_0_without_preload_content( self, - function_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(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3859,17 +4788,17 @@ def get_function_strings_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get string information found in the function + """List strings for a function. - Get string information found in the function + Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int - :param page: The page number to retrieve. + :param page: Page number (1-indexed). :type page: int - :param page_size: Number of items per page. + :param page_size: Number of results per page. :type page_size: int - :param search: Search is applied to string value + :param search: Filter by string value (case-insensitive substring match). :type search: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3893,7 +4822,7 @@ def get_function_strings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_strings_serialize( + _param = self._get_function_strings_0_serialize( function_id=function_id, page=page, page_size=page_size, @@ -3905,8 +4834,11 @@ def get_function_strings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionStringsResponse", - '422': "BaseResponse", + '200': "ListFunctionStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3915,7 +4847,7 @@ def get_function_strings_without_preload_content( return response_data.response - def _get_function_strings_serialize( + def _get_function_strings_0_serialize( self, function_id, page, @@ -3978,7 +4910,7 @@ def _get_function_strings_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/strings', + resource_path='/v3/functions/{function_id}/strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/strings_api.py b/revengai/api/strings_api.py deleted file mode 100644 index 49254f90..00000000 --- a/revengai/api/strings_api.py +++ /dev/null @@ -1,641 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field -from typing import Any, Dict -from typing_extensions import Annotated -from revengai.models.add_user_string_input_body import AddUserStringInputBody -from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody - -from revengai.api_client import ApiClient, RequestSerialized -from revengai.api_response import ApiResponse -from revengai.rest import RESTResponseType - - -class StringsApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def add_user_string_to_analysis( - self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - add_user_string_input_body: AddUserStringInputBody, - _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, - ) -> Dict[str, object]: - """Add a user-provided string to an analysis. - - Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - - :param analysis_id: Analysis ID (required) - :type analysis_id: int - :param add_user_string_input_body: (required) - :type add_user_string_input_body: AddUserStringInputBody - :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._add_user_string_to_analysis_serialize( - analysis_id=analysis_id, - add_user_string_input_body=add_user_string_input_body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Dict[str, object]", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", - } - 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 add_user_string_to_analysis_with_http_info( - self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - add_user_string_input_body: AddUserStringInputBody, - _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[Dict[str, object]]: - """Add a user-provided string to an analysis. - - Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - - :param analysis_id: Analysis ID (required) - :type analysis_id: int - :param add_user_string_input_body: (required) - :type add_user_string_input_body: AddUserStringInputBody - :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._add_user_string_to_analysis_serialize( - analysis_id=analysis_id, - add_user_string_input_body=add_user_string_input_body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Dict[str, object]", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", - } - 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 add_user_string_to_analysis_without_preload_content( - self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - add_user_string_input_body: AddUserStringInputBody, - _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: - """Add a user-provided string to an analysis. - - Attaches a user-provided string to an analysis at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - - :param analysis_id: Analysis ID (required) - :type analysis_id: int - :param add_user_string_input_body: (required) - :type add_user_string_input_body: AddUserStringInputBody - :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._add_user_string_to_analysis_serialize( - analysis_id=analysis_id, - add_user_string_input_body=add_user_string_input_body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Dict[str, object]", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _add_user_string_to_analysis_serialize( - self, - analysis_id, - add_user_string_input_body, - _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 - if add_user_string_input_body is not None: - _body_params = add_user_string_input_body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'APIKey' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v3/analyses/{analysis_id}/user-provided-strings', - 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 add_user_string_to_function( - self, - function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - add_user_string_to_function_input_body: AddUserStringToFunctionInputBody, - _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, - ) -> Dict[str, object]: - """Add a user-provided string to a function. - - Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - - :param function_id: Function ID (required) - :type function_id: int - :param add_user_string_to_function_input_body: (required) - :type add_user_string_to_function_input_body: AddUserStringToFunctionInputBody - :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._add_user_string_to_function_serialize( - function_id=function_id, - add_user_string_to_function_input_body=add_user_string_to_function_input_body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Dict[str, object]", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", - } - 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 add_user_string_to_function_with_http_info( - self, - function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - add_user_string_to_function_input_body: AddUserStringToFunctionInputBody, - _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[Dict[str, object]]: - """Add a user-provided string to a function. - - Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - - :param function_id: Function ID (required) - :type function_id: int - :param add_user_string_to_function_input_body: (required) - :type add_user_string_to_function_input_body: AddUserStringToFunctionInputBody - :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._add_user_string_to_function_serialize( - function_id=function_id, - add_user_string_to_function_input_body=add_user_string_to_function_input_body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Dict[str, object]", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", - } - 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 add_user_string_to_function_without_preload_content( - self, - function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - add_user_string_to_function_input_body: AddUserStringToFunctionInputBody, - _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: - """Add a user-provided string to a function. - - Attaches a user-provided string to a function at the given virtual address. The string is stored with source `USER` and complements strings discovered automatically during analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - - :param function_id: Function ID (required) - :type function_id: int - :param add_user_string_to_function_input_body: (required) - :type add_user_string_to_function_input_body: AddUserStringToFunctionInputBody - :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._add_user_string_to_function_serialize( - function_id=function_id, - add_user_string_to_function_input_body=add_user_string_to_function_input_body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "Dict[str, object]", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _add_user_string_to_function_serialize( - self, - function_id, - add_user_string_to_function_input_body, - _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 function_id is not None: - _path_params['function_id'] = function_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if add_user_string_to_function_input_body is not None: - _body_params = add_user_string_to_function_input_body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'APIKey' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v3/functions/{function_id}/user-provided-strings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index 67828c0e..48874aa7 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -13,6 +13,7 @@ # import models into model package from revengai.models.api_error import APIError +from revengai.models.add_callee_input_body import AddCalleeInputBody from revengai.models.add_user_string_input_body import AddUserStringInputBody from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse @@ -32,10 +33,14 @@ 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_log_message import AnalysisLogMessage +from revengai.models.analysis_logs import AnalysisLogs from revengai.models.analysis_record import AnalysisRecord from revengai.models.analysis_report import AnalysisReport from revengai.models.analysis_scope import AnalysisScope +from revengai.models.analysis_string_function import AnalysisStringFunction from revengai.models.analysis_string_input import AnalysisStringInput +from revengai.models.analysis_string_item import AnalysisStringItem from revengai.models.analysis_strings_response import AnalysisStringsResponse from revengai.models.analysis_strings_status_response import AnalysisStringsStatusResponse from revengai.models.analysis_tags import AnalysisTags @@ -258,6 +263,7 @@ from revengai.models.function_search_result import FunctionSearchResult from revengai.models.function_source_type import FunctionSourceType from revengai.models.function_string import FunctionString +from revengai.models.function_string_item import FunctionStringItem from revengai.models.function_strings_response import FunctionStringsResponse from revengai.models.function_task_response import FunctionTaskResponse from revengai.models.function_task_status import FunctionTaskStatus @@ -270,6 +276,7 @@ from revengai.models.generation_status_list import GenerationStatusList from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse from revengai.models.get_ai_decompilation_task import GetAiDecompilationTask +from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.get_public_user_response import GetPublicUserResponse from revengai.models.global_variable import GlobalVariable from revengai.models.history_entry import HistoryEntry @@ -283,7 +290,9 @@ from revengai.models.inverse_function_map_item import InverseFunctionMapItem from revengai.models.inverse_string_map_item import InverseStringMapItem from revengai.models.inverse_value import InverseValue +from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.models.list_collection_results import ListCollectionResults +from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody from revengai.models.logs import Logs from revengai.models.mitre_technique import MITRETechnique from revengai.models.matched_function import MatchedFunction diff --git a/revengai/models/add_callee_input_body.py b/revengai/models/add_callee_input_body.py new file mode 100644 index 00000000..354c90cd --- /dev/null +++ b/revengai/models/add_callee_input_body.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AddCalleeInputBody(BaseModel): + """ + AddCalleeInputBody + """ # noqa: E501 + callee_function_id: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Internal callee function ID; 0 means not provided") + callee_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="Callee name (for external calls)") + callee_vaddr: StrictInt = Field(description="Virtual address of the callee") + is_external: StrictBool = Field(description="Whether the callee is outside the binary") + thunked_vaddr: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Thunked virtual address") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["callee_function_id", "callee_name", "callee_vaddr", "is_external", "thunked_vaddr"] + + 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 AddCalleeInputBody 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddCalleeInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callee_function_id": obj.get("callee_function_id"), + "callee_name": obj.get("callee_name"), + "callee_vaddr": obj.get("callee_vaddr"), + "is_external": obj.get("is_external"), + "thunked_vaddr": obj.get("thunked_vaddr") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_log_message.py b/revengai/models/analysis_log_message.py new file mode 100644 index 00000000..67ace13e --- /dev/null +++ b/revengai/models/analysis_log_message.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisLogMessage(BaseModel): + """ + AnalysisLogMessage + """ # noqa: E501 + message: Optional[StrictStr] + time: Optional[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["message", "time"] + + 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 AnalysisLogMessage 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # 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 time (nullable) is None + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: + _dict['time'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisLogMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message"), + "time": obj.get("time") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_logs.py b/revengai/models/analysis_logs.py new file mode 100644 index 00000000..335e613b --- /dev/null +++ b/revengai/models/analysis_logs.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_log_message import AnalysisLogMessage +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisLogs(BaseModel): + """ + AnalysisLogs + """ # noqa: E501 + message_count: StrictInt + messages: Optional[List[AnalysisLogMessage]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["message_count", "messages"] + + 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 AnalysisLogs 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _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 messages (list) + _items = [] + if self.messages: + for _item_messages in self.messages: + if _item_messages: + _items.append(_item_messages.to_dict()) + _dict['messages'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if messages (nullable) is None + # and model_fields_set contains the field + if self.messages is None and "messages" in self.model_fields_set: + _dict['messages'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisLogs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message_count": obj.get("message_count"), + "messages": [AnalysisLogMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_string_function.py b/revengai/models/analysis_string_function.py new file mode 100644 index 00000000..7e6f5563 --- /dev/null +++ b/revengai/models/analysis_string_function.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisStringFunction(BaseModel): + """ + AnalysisStringFunction + """ # noqa: E501 + function_id: Optional[StrictInt] + function_vaddr: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["function_id", "function_vaddr"] + + 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 AnalysisStringFunction 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if function_id (nullable) is None + # and model_fields_set contains the field + if self.function_id is None and "function_id" in self.model_fields_set: + _dict['function_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisStringFunction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "function_id": obj.get("function_id"), + "function_vaddr": obj.get("function_vaddr") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_string_item.py b/revengai/models/analysis_string_item.py new file mode 100644 index 00000000..f836d755 --- /dev/null +++ b/revengai/models/analysis_string_item.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_string_function import AnalysisStringFunction +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisStringItem(BaseModel): + """ + AnalysisStringItem + """ # noqa: E501 + functions: Optional[List[AnalysisStringFunction]] + source: StrictStr + value: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["functions", "source", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnalysisStringItem 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _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 + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if functions (nullable) is None + # and model_fields_set contains the field + if self.functions is None and "functions" in self.model_fields_set: + _dict['functions'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisStringItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [AnalysisStringFunction.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "source": obj.get("source"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/dynamic_execution_status_response.py b/revengai/models/dynamic_execution_status_response.py index 8ffc7638..50021544 100644 --- a/revengai/models/dynamic_execution_status_response.py +++ b/revengai/models/dynamic_execution_status_response.py @@ -18,6 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_logs import AnalysisLogs from typing import Optional, Set from typing_extensions import Self @@ -26,9 +27,10 @@ class DynamicExecutionStatusResponse(BaseModel): DynamicExecutionStatusResponse """ # noqa: E501 error_message: Optional[StrictStr] = Field(default=None, description="Error detail, set when status is ERROR") + logs: AnalysisLogs = Field(description="Sandbox status log messages captured during the run. Contains a single \"No logs available\" message when none have been captured yet.") status: StrictStr = Field(description="Task status: UNINITIALISED, PENDING, RUNNING, COMPLETED, or ERROR") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["error_message", "status"] + __properties: ClassVar[List[str]] = ["error_message", "logs", "status"] model_config = ConfigDict( populate_by_name=True, @@ -71,6 +73,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of logs + if self.logs: + _dict['logs'] = self.logs.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -89,6 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "error_message": obj.get("error_message"), + "logs": AnalysisLogs.from_dict(obj["logs"]) if obj.get("logs") is not None else None, "status": obj.get("status") }) # store additional fields in additional_properties diff --git a/revengai/models/function_string_item.py b/revengai/models/function_string_item.py new file mode 100644 index 00000000..ad209ed0 --- /dev/null +++ b/revengai/models/function_string_item.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class FunctionStringItem(BaseModel): + """ + FunctionStringItem + """ # noqa: E501 + source: StrictStr + vaddr: StrictInt + value: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["source", "vaddr", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FunctionStringItem 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionStringItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source": obj.get("source"), + "vaddr": obj.get("vaddr"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/get_analysis_strings_status_output_body.py b/revengai/models/get_analysis_strings_status_output_body.py new file mode 100644 index 00000000..468da9be --- /dev/null +++ b/revengai/models/get_analysis_strings_status_output_body.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GetAnalysisStringsStatusOutputBody(BaseModel): + """ + GetAnalysisStringsStatusOutputBody + """ # noqa: E501 + status: StrictStr + additional_properties: Dict[str, Any] = {} + __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 GetAnalysisStringsStatusOutputBody 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAnalysisStringsStatusOutputBody 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") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/list_analysis_strings_output_body.py b/revengai/models/list_analysis_strings_output_body.py new file mode 100644 index 00000000..a7de48a8 --- /dev/null +++ b/revengai/models/list_analysis_strings_output_body.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_string_item import AnalysisStringItem +from typing import Optional, Set +from typing_extensions import Self + +class ListAnalysisStringsOutputBody(BaseModel): + """ + ListAnalysisStringsOutputBody + """ # noqa: E501 + strings: Optional[List[AnalysisStringItem]] + total_strings: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["strings", "total_strings"] + + 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 ListAnalysisStringsOutputBody 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _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 strings (list) + _items = [] + if self.strings: + for _item_strings in self.strings: + if _item_strings: + _items.append(_item_strings.to_dict()) + _dict['strings'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if strings (nullable) is None + # and model_fields_set contains the field + if self.strings is None and "strings" in self.model_fields_set: + _dict['strings'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListAnalysisStringsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "strings": [AnalysisStringItem.from_dict(_item) for _item in obj["strings"]] if obj.get("strings") is not None else None, + "total_strings": obj.get("total_strings") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/list_function_strings_output_body.py b/revengai/models/list_function_strings_output_body.py new file mode 100644 index 00000000..78b22f56 --- /dev/null +++ b/revengai/models/list_function_strings_output_body.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + 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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_string_item import FunctionStringItem +from typing import Optional, Set +from typing_extensions import Self + +class ListFunctionStringsOutputBody(BaseModel): + """ + ListFunctionStringsOutputBody + """ # noqa: E501 + strings: Optional[List[FunctionStringItem]] + total_strings: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["strings", "total_strings"] + + 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 ListFunctionStringsOutputBody 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _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 strings (list) + _items = [] + if self.strings: + for _item_strings in self.strings: + if _item_strings: + _items.append(_item_strings.to_dict()) + _dict['strings'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if strings (nullable) is None + # and model_fields_set contains the field + if self.strings is None and "strings" in self.model_fields_set: + _dict['strings'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListFunctionStringsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "strings": [FunctionStringItem.from_dict(_item) for _item in obj["strings"]] if obj.get("strings") is not None else None, + "total_strings": obj.get("total_strings") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + +