diff --git a/.sdk-version b/.sdk-version index 7b705cd..5d3a7e6 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.63.0 +v3.65.0 diff --git a/README.md b/README.md index 387198f..222cfff 100644 --- a/README.md +++ b/README.md @@ -118,9 +118,6 @@ Class | Method | HTTP request | Description *FunctionsAIDecompilationApi* | [**get_ai_decompilation_task_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_task_status) | **GET** /v2/functions/{function_id}/ai-decompilation/status | Check the status of a function ai decompilation *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_rating**](docs/FunctionsAIDecompilationApi.md#upsert_ai_decompilation_rating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation -*FunctionsBlockCommentsApi* | [**generate_block_comments_for_block_in_function**](docs/FunctionsBlockCommentsApi.md#generate_block_comments_for_block_in_function) | **POST** /v2/functions/{function_id}/block-comments/single | Generate block comments for a specific block in a function -*FunctionsBlockCommentsApi* | [**generate_block_comments_for_function**](docs/FunctionsBlockCommentsApi.md#generate_block_comments_for_function) | **POST** /v2/functions/{function_id}/block-comments | Generate block comments for a function -*FunctionsBlockCommentsApi* | [**generate_overview_comment_for_function**](docs/FunctionsBlockCommentsApi.md#generate_overview_comment_for_function) | **POST** /v2/functions/{function_id}/block-comments/overview | Generate overview comment for 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 @@ -141,10 +138,6 @@ Class | Method | HTTP request | Description *FunctionsDataTypesApi* | [**list_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#list_function_data_types_for_analysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types *FunctionsDataTypesApi* | [**list_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#list_function_data_types_for_functions) | **GET** /v2/functions/data_types | List Function Data Types *FunctionsDataTypesApi* | [**update_function_data_types**](docs/FunctionsDataTypesApi.md#update_function_data_types) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update Function Data Types -*FunctionsDecompilationApi* | [**create_decompilation_comment**](docs/FunctionsDecompilationApi.md#create_decompilation_comment) | **POST** /v2/functions/{function_id}/decompilation/comments | Create a comment for this function -*FunctionsDecompilationApi* | [**delete_decompilation_comment**](docs/FunctionsDecompilationApi.md#delete_decompilation_comment) | **DELETE** /v2/functions/{function_id}/decompilation/comments/{comment_id} | Delete a comment -*FunctionsDecompilationApi* | [**get_decompilation_comments**](docs/FunctionsDecompilationApi.md#get_decompilation_comments) | **GET** /v2/functions/{function_id}/decompilation/comments | Get comments for this function -*FunctionsDecompilationApi* | [**update_decompilation_comment**](docs/FunctionsDecompilationApi.md#update_decompilation_comment) | **PATCH** /v2/functions/{function_id}/decompilation/comments/{comment_id} | Update a comment *FunctionsRenamingHistoryApi* | [**batch_rename_function**](docs/FunctionsRenamingHistoryApi.md#batch_rename_function) | **POST** /v2/functions/rename/batch | Batch Rename Functions *FunctionsRenamingHistoryApi* | [**get_function_name_history**](docs/FunctionsRenamingHistoryApi.md#get_function_name_history) | **GET** /v2/functions/history/{function_id} | Get Function Name History *FunctionsRenamingHistoryApi* | [**rename_function_id**](docs/FunctionsRenamingHistoryApi.md#rename_function_id) | **POST** /v2/functions/rename/{function_id} | Rename Function @@ -216,8 +209,6 @@ Class | Method | HTTP request | Description - [BaseResponseBinaryDetailsResponse](docs/BaseResponseBinaryDetailsResponse.md) - [BaseResponseBinaryExternalsResponse](docs/BaseResponseBinaryExternalsResponse.md) - [BaseResponseBinarySearchResponse](docs/BaseResponseBinarySearchResponse.md) - - [BaseResponseBlockCommentsGenerationForFunctionResponse](docs/BaseResponseBlockCommentsGenerationForFunctionResponse.md) - - [BaseResponseBlockCommentsOverviewGenerationResponse](docs/BaseResponseBlockCommentsOverviewGenerationResponse.md) - [BaseResponseBool](docs/BaseResponseBool.md) - [BaseResponseCalleesCallerFunctionsResponse](docs/BaseResponseCalleesCallerFunctionsResponse.md) - [BaseResponseCapabilities](docs/BaseResponseCapabilities.md) @@ -285,8 +276,6 @@ Class | Method | HTTP request | Description - [BinarySearchResponse](docs/BinarySearchResponse.md) - [BinarySearchResult](docs/BinarySearchResult.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - - [Block](docs/Block.md) - - [BlockCommentsGenerationForFunctionResponse](docs/BlockCommentsGenerationForFunctionResponse.md) - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) - [CalleeFunctionInfo](docs/CalleeFunctionInfo.md) - [CalleesCallerFunctionsResponse](docs/CalleesCallerFunctionsResponse.md) diff --git a/docs/BaseResponseBlockCommentsGenerationForFunctionResponse.md b/docs/BaseResponseBlockCommentsGenerationForFunctionResponse.md deleted file mode 100644 index dbe3c85..0000000 --- a/docs/BaseResponseBlockCommentsGenerationForFunctionResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseBlockCommentsGenerationForFunctionResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**BlockCommentsGenerationForFunctionResponse**](BlockCommentsGenerationForFunctionResponse.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseBlockCommentsGenerationForFunctionResponse from a JSON string -base_response_block_comments_generation_for_function_response_instance = BaseResponseBlockCommentsGenerationForFunctionResponse.from_json(json) -# print the JSON string representation of the object -print(BaseResponseBlockCommentsGenerationForFunctionResponse.to_json()) - -# convert the object into a dict -base_response_block_comments_generation_for_function_response_dict = base_response_block_comments_generation_for_function_response_instance.to_dict() -# create an instance of BaseResponseBlockCommentsGenerationForFunctionResponse from a dict -base_response_block_comments_generation_for_function_response_from_dict = BaseResponseBlockCommentsGenerationForFunctionResponse.from_dict(base_response_block_comments_generation_for_function_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BaseResponseBlockCommentsOverviewGenerationResponse.md b/docs/BaseResponseBlockCommentsOverviewGenerationResponse.md deleted file mode 100644 index f5cd89b..0000000 --- a/docs/BaseResponseBlockCommentsOverviewGenerationResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseBlockCommentsOverviewGenerationResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | **object** | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_block_comments_overview_generation_response import BaseResponseBlockCommentsOverviewGenerationResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseBlockCommentsOverviewGenerationResponse from a JSON string -base_response_block_comments_overview_generation_response_instance = BaseResponseBlockCommentsOverviewGenerationResponse.from_json(json) -# print the JSON string representation of the object -print(BaseResponseBlockCommentsOverviewGenerationResponse.to_json()) - -# convert the object into a dict -base_response_block_comments_overview_generation_response_dict = base_response_block_comments_overview_generation_response_instance.to_dict() -# create an instance of BaseResponseBlockCommentsOverviewGenerationResponse from a dict -base_response_block_comments_overview_generation_response_from_dict = BaseResponseBlockCommentsOverviewGenerationResponse.from_dict(base_response_block_comments_overview_generation_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Block.md b/docs/Block.md deleted file mode 100644 index 8bd21ab..0000000 --- a/docs/Block.md +++ /dev/null @@ -1,29 +0,0 @@ -# Block - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**virtual_address** | **int** | | - -## Example - -```python -from revengai.models.block import Block - -# TODO update the JSON string below -json = "{}" -# create an instance of Block from a JSON string -block_instance = Block.from_json(json) -# print the JSON string representation of the object -print(Block.to_json()) - -# convert the object into a dict -block_dict = block_instance.to_dict() -# create an instance of Block from a dict -block_from_dict = Block.from_dict(block_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/BlockCommentsGenerationForFunctionResponse.md b/docs/BlockCommentsGenerationForFunctionResponse.md deleted file mode 100644 index 01bdbe4..0000000 --- a/docs/BlockCommentsGenerationForFunctionResponse.md +++ /dev/null @@ -1,29 +0,0 @@ -# BlockCommentsGenerationForFunctionResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**updated_blocks** | **int** | | - -## Example - -```python -from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BlockCommentsGenerationForFunctionResponse from a JSON string -block_comments_generation_for_function_response_instance = BlockCommentsGenerationForFunctionResponse.from_json(json) -# print the JSON string representation of the object -print(BlockCommentsGenerationForFunctionResponse.to_json()) - -# convert the object into a dict -block_comments_generation_for_function_response_dict = block_comments_generation_for_function_response_instance.to_dict() -# create an instance of BlockCommentsGenerationForFunctionResponse from a dict -block_comments_generation_for_function_response_from_dict = BlockCommentsGenerationForFunctionResponse.from_dict(block_comments_generation_for_function_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FunctionBlocksResponse.md b/docs/FunctionBlocksResponse.md index f22b327..630dd02 100644 --- a/docs/FunctionBlocksResponse.md +++ b/docs/FunctionBlocksResponse.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **blocks** | [**List[FunctionBlockResponse]**](FunctionBlockResponse.md) | Disassembly is broken into control flow blocks | **local_variables** | [**List[FunctionLocalVariableResponse]**](FunctionLocalVariableResponse.md) | Local variables associated with this function | **params** | [**List[FunctionParamResponse]**](FunctionParamResponse.md) | Params associated with this function | -**overview_comment** | **str** | | +**overview_comment** | **str** | | [optional] ## Example diff --git a/docs/FunctionsBlockCommentsApi.md b/docs/FunctionsBlockCommentsApi.md deleted file mode 100644 index 42e7f1d..0000000 --- a/docs/FunctionsBlockCommentsApi.md +++ /dev/null @@ -1,248 +0,0 @@ -# revengai.FunctionsBlockCommentsApi - -All URIs are relative to *https://api.reveng.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**generate_block_comments_for_block_in_function**](FunctionsBlockCommentsApi.md#generate_block_comments_for_block_in_function) | **POST** /v2/functions/{function_id}/block-comments/single | Generate block comments for a specific block in a function -[**generate_block_comments_for_function**](FunctionsBlockCommentsApi.md#generate_block_comments_for_function) | **POST** /v2/functions/{function_id}/block-comments | Generate block comments for a function -[**generate_overview_comment_for_function**](FunctionsBlockCommentsApi.md#generate_overview_comment_for_function) | **POST** /v2/functions/{function_id}/block-comments/overview | Generate overview comment for a function - - -# **generate_block_comments_for_block_in_function** -> BaseResponseBlockCommentsGenerationForFunctionResponse generate_block_comments_for_block_in_function(function_id, block) - -Generate block comments for a specific block in a function - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse -from revengai.models.block import Block -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.FunctionsBlockCommentsApi(api_client) - function_id = 56 # int | - block = revengai.Block() # Block | - - try: - # Generate block comments for a specific block in a function - api_response = api_instance.generate_block_comments_for_block_in_function(function_id, block) - print("The response of FunctionsBlockCommentsApi->generate_block_comments_for_block_in_function:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsBlockCommentsApi->generate_block_comments_for_block_in_function: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_id** | **int**| | - **block** | [**Block**](Block.md)| | - -### Return type - -[**BaseResponseBlockCommentsGenerationForFunctionResponse**](BaseResponseBlockCommentsGenerationForFunctionResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **generate_block_comments_for_function** -> BaseResponseBlockCommentsGenerationForFunctionResponse generate_block_comments_for_function(function_id) - -Generate block comments for a function - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse -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.FunctionsBlockCommentsApi(api_client) - function_id = 56 # int | - - try: - # Generate block comments for a function - api_response = api_instance.generate_block_comments_for_function(function_id) - print("The response of FunctionsBlockCommentsApi->generate_block_comments_for_function:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsBlockCommentsApi->generate_block_comments_for_function: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_id** | **int**| | - -### Return type - -[**BaseResponseBlockCommentsGenerationForFunctionResponse**](BaseResponseBlockCommentsGenerationForFunctionResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **generate_overview_comment_for_function** -> BaseResponseBlockCommentsOverviewGenerationResponse generate_overview_comment_for_function(function_id) - -Generate overview comment for a function - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_block_comments_overview_generation_response import BaseResponseBlockCommentsOverviewGenerationResponse -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.FunctionsBlockCommentsApi(api_client) - function_id = 56 # int | - - try: - # Generate overview comment for a function - api_response = api_instance.generate_overview_comment_for_function(function_id) - print("The response of FunctionsBlockCommentsApi->generate_overview_comment_for_function:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsBlockCommentsApi->generate_overview_comment_for_function: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_id** | **int**| | - -### Return type - -[**BaseResponseBlockCommentsOverviewGenerationResponse**](BaseResponseBlockCommentsOverviewGenerationResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/FunctionsDecompilationApi.md b/docs/FunctionsDecompilationApi.md deleted file mode 100644 index dfdcbd4..0000000 --- a/docs/FunctionsDecompilationApi.md +++ /dev/null @@ -1,395 +0,0 @@ -# revengai.FunctionsDecompilationApi - -All URIs are relative to *https://api.reveng.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_decompilation_comment**](FunctionsDecompilationApi.md#create_decompilation_comment) | **POST** /v2/functions/{function_id}/decompilation/comments | Create a comment for this function -[**delete_decompilation_comment**](FunctionsDecompilationApi.md#delete_decompilation_comment) | **DELETE** /v2/functions/{function_id}/decompilation/comments/{comment_id} | Delete a comment -[**get_decompilation_comments**](FunctionsDecompilationApi.md#get_decompilation_comments) | **GET** /v2/functions/{function_id}/decompilation/comments | Get comments for this function -[**update_decompilation_comment**](FunctionsDecompilationApi.md#update_decompilation_comment) | **PATCH** /v2/functions/{function_id}/decompilation/comments/{comment_id} | Update a comment - - -# **create_decompilation_comment** -> BaseResponseCommentResponse create_decompilation_comment(function_id, function_comment_create_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - -Create a comment for this function - -Creates a comment associated with a specified function). - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_comment_response import BaseResponseCommentResponse -from revengai.models.function_comment_create_request import FunctionCommentCreateRequest -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.FunctionsDecompilationApi(api_client) - function_id = 56 # int | - function_comment_create_request = revengai.FunctionCommentCreateRequest() # FunctionCommentCreateRequest | - endpoint_url = 'endpoint_url_example' # str | (optional) - local_cache_dir = 'local_cache_dir_example' # str | (optional) - local_cache_max_size_mb = 56 # int | (optional) - customer_samples_bucket = 'customer_samples_bucket_example' # str | (optional) - firmware_samples_bucket = 'firmware_samples_bucket_example' # str | (optional) - max_retry_attempts = 5 # int | (optional) (default to 5) - - try: - # Create a comment for this function - api_response = api_instance.create_decompilation_comment(function_id, function_comment_create_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - print("The response of FunctionsDecompilationApi->create_decompilation_comment:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDecompilationApi->create_decompilation_comment: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_id** | **int**| | - **function_comment_create_request** | [**FunctionCommentCreateRequest**](FunctionCommentCreateRequest.md)| | - **endpoint_url** | **str**| | [optional] - **local_cache_dir** | **str**| | [optional] - **local_cache_max_size_mb** | **int**| | [optional] - **customer_samples_bucket** | **str**| | [optional] - **firmware_samples_bucket** | **str**| | [optional] - **max_retry_attempts** | **int**| | [optional] [default to 5] - -### Return type - -[**BaseResponseCommentResponse**](BaseResponseCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Successful Response | - | -**422** | Invalid request parameters | - | -**400** | Bad Request | - | - -[[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) - -# **delete_decompilation_comment** -> BaseResponseBool delete_decompilation_comment(comment_id, function_id, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - -Delete a comment - -Deletes an existing comment. Users can only delete their own comments. - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_bool import BaseResponseBool -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.FunctionsDecompilationApi(api_client) - comment_id = 56 # int | - function_id = 56 # int | - endpoint_url = 'endpoint_url_example' # str | (optional) - local_cache_dir = 'local_cache_dir_example' # str | (optional) - local_cache_max_size_mb = 56 # int | (optional) - customer_samples_bucket = 'customer_samples_bucket_example' # str | (optional) - firmware_samples_bucket = 'firmware_samples_bucket_example' # str | (optional) - max_retry_attempts = 5 # int | (optional) (default to 5) - - try: - # Delete a comment - api_response = api_instance.delete_decompilation_comment(comment_id, function_id, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - print("The response of FunctionsDecompilationApi->delete_decompilation_comment:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDecompilationApi->delete_decompilation_comment: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **comment_id** | **int**| | - **function_id** | **int**| | - **endpoint_url** | **str**| | [optional] - **local_cache_dir** | **str**| | [optional] - **local_cache_max_size_mb** | **int**| | [optional] - **customer_samples_bucket** | **str**| | [optional] - **firmware_samples_bucket** | **str**| | [optional] - **max_retry_attempts** | **int**| | [optional] [default to 5] - -### Return type - -[**BaseResponseBool**](BaseResponseBool.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | -**403** | You can only delete your own comments | - | -**400** | Bad Request | - | - -[[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_decompilation_comments** -> BaseResponseListCommentResponse get_decompilation_comments(function_id, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - -Get comments for this function - -Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse -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.FunctionsDecompilationApi(api_client) - function_id = 56 # int | - endpoint_url = 'endpoint_url_example' # str | (optional) - local_cache_dir = 'local_cache_dir_example' # str | (optional) - local_cache_max_size_mb = 56 # int | (optional) - customer_samples_bucket = 'customer_samples_bucket_example' # str | (optional) - firmware_samples_bucket = 'firmware_samples_bucket_example' # str | (optional) - max_retry_attempts = 5 # int | (optional) (default to 5) - - try: - # Get comments for this function - api_response = api_instance.get_decompilation_comments(function_id, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - print("The response of FunctionsDecompilationApi->get_decompilation_comments:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDecompilationApi->get_decompilation_comments: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_id** | **int**| | - **endpoint_url** | **str**| | [optional] - **local_cache_dir** | **str**| | [optional] - **local_cache_max_size_mb** | **int**| | [optional] - **customer_samples_bucket** | **str**| | [optional] - **firmware_samples_bucket** | **str**| | [optional] - **max_retry_attempts** | **int**| | [optional] [default to 5] - -### Return type - -[**BaseResponseListCommentResponse**](BaseResponseListCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_decompilation_comment** -> BaseResponseCommentResponse update_decompilation_comment(comment_id, function_id, comment_update_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - -Update a comment - -Updates the content of an existing comment. Users can only update their own comments. - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_comment_response import BaseResponseCommentResponse -from revengai.models.comment_update_request import CommentUpdateRequest -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.FunctionsDecompilationApi(api_client) - comment_id = 56 # int | - function_id = 56 # int | - comment_update_request = revengai.CommentUpdateRequest() # CommentUpdateRequest | - endpoint_url = 'endpoint_url_example' # str | (optional) - local_cache_dir = 'local_cache_dir_example' # str | (optional) - local_cache_max_size_mb = 56 # int | (optional) - customer_samples_bucket = 'customer_samples_bucket_example' # str | (optional) - firmware_samples_bucket = 'firmware_samples_bucket_example' # str | (optional) - max_retry_attempts = 5 # int | (optional) (default to 5) - - try: - # Update a comment - api_response = api_instance.update_decompilation_comment(comment_id, function_id, comment_update_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) - print("The response of FunctionsDecompilationApi->update_decompilation_comment:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDecompilationApi->update_decompilation_comment: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **comment_id** | **int**| | - **function_id** | **int**| | - **comment_update_request** | [**CommentUpdateRequest**](CommentUpdateRequest.md)| | - **endpoint_url** | **str**| | [optional] - **local_cache_dir** | **str**| | [optional] - **local_cache_max_size_mb** | **int**| | [optional] - **customer_samples_bucket** | **str**| | [optional] - **firmware_samples_bucket** | **str**| | [optional] - **max_retry_attempts** | **int**| | [optional] [default to 5] - -### Return type - -[**BaseResponseCommentResponse**](BaseResponseCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | -**403** | You can only update your own comments | - | -**400** | Bad Request | - | - -[[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 2bb14b0..a41f889 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.63.0" +__version__ = "v3.65.0" # Define package exports __all__ = [ @@ -31,10 +31,8 @@ "ExternalSourcesApi", "FirmwareApi", "FunctionsAIDecompilationApi", - "FunctionsBlockCommentsApi", "FunctionsCoreApi", "FunctionsDataTypesApi", - "FunctionsDecompilationApi", "FunctionsRenamingHistoryApi", "ModelsApi", "SearchApi", @@ -105,8 +103,6 @@ "BaseResponseBinaryDetailsResponse", "BaseResponseBinaryExternalsResponse", "BaseResponseBinarySearchResponse", - "BaseResponseBlockCommentsGenerationForFunctionResponse", - "BaseResponseBlockCommentsOverviewGenerationResponse", "BaseResponseBool", "BaseResponseCalleesCallerFunctionsResponse", "BaseResponseCapabilities", @@ -174,8 +170,6 @@ "BinarySearchResponse", "BinarySearchResult", "BinaryTaskStatus", - "Block", - "BlockCommentsGenerationForFunctionResponse", "BulkDeleteAnalysesRequest", "CalleeFunctionInfo", "CalleesCallerFunctionsResponse", @@ -381,10 +375,8 @@ from revengai.api.external_sources_api import ExternalSourcesApi as ExternalSourcesApi from revengai.api.firmware_api import FirmwareApi as FirmwareApi from revengai.api.functions_ai_decompilation_api import FunctionsAIDecompilationApi as FunctionsAIDecompilationApi -from revengai.api.functions_block_comments_api import FunctionsBlockCommentsApi as FunctionsBlockCommentsApi from revengai.api.functions_core_api import FunctionsCoreApi as FunctionsCoreApi from revengai.api.functions_data_types_api import FunctionsDataTypesApi as FunctionsDataTypesApi -from revengai.api.functions_decompilation_api import FunctionsDecompilationApi as FunctionsDecompilationApi from revengai.api.functions_renaming_history_api import FunctionsRenamingHistoryApi as FunctionsRenamingHistoryApi from revengai.api.models_api import ModelsApi as ModelsApi from revengai.api.search_api import SearchApi as SearchApi @@ -459,8 +451,6 @@ from revengai.models.base_response_binary_details_response import BaseResponseBinaryDetailsResponse as BaseResponseBinaryDetailsResponse from revengai.models.base_response_binary_externals_response import BaseResponseBinaryExternalsResponse as BaseResponseBinaryExternalsResponse from revengai.models.base_response_binary_search_response import BaseResponseBinarySearchResponse as BaseResponseBinarySearchResponse -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse as BaseResponseBlockCommentsGenerationForFunctionResponse -from revengai.models.base_response_block_comments_overview_generation_response import BaseResponseBlockCommentsOverviewGenerationResponse as BaseResponseBlockCommentsOverviewGenerationResponse from revengai.models.base_response_bool import BaseResponseBool as BaseResponseBool from revengai.models.base_response_callees_caller_functions_response import BaseResponseCalleesCallerFunctionsResponse as BaseResponseCalleesCallerFunctionsResponse from revengai.models.base_response_capabilities import BaseResponseCapabilities as BaseResponseCapabilities @@ -528,8 +518,6 @@ from revengai.models.binary_search_response import BinarySearchResponse as BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult as BinarySearchResult from revengai.models.binary_task_status import BinaryTaskStatus as BinaryTaskStatus -from revengai.models.block import Block as Block -from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse as BlockCommentsGenerationForFunctionResponse from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest as BulkDeleteAnalysesRequest from revengai.models.callee_function_info import CalleeFunctionInfo as CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse as CalleesCallerFunctionsResponse diff --git a/revengai/api/__init__.py b/revengai/api/__init__.py index 8a7b133..a7cf63f 100644 --- a/revengai/api/__init__.py +++ b/revengai/api/__init__.py @@ -15,10 +15,8 @@ from revengai.api.external_sources_api import ExternalSourcesApi from revengai.api.firmware_api import FirmwareApi from revengai.api.functions_ai_decompilation_api import FunctionsAIDecompilationApi -from revengai.api.functions_block_comments_api import FunctionsBlockCommentsApi from revengai.api.functions_core_api import FunctionsCoreApi from revengai.api.functions_data_types_api import FunctionsDataTypesApi -from revengai.api.functions_decompilation_api import FunctionsDecompilationApi from revengai.api.functions_renaming_history_api import FunctionsRenamingHistoryApi from revengai.api.models_api import ModelsApi from revengai.api.search_api import SearchApi diff --git a/revengai/api/functions_block_comments_api.py b/revengai/api/functions_block_comments_api.py deleted file mode 100644 index e7e8c31..0000000 --- a/revengai/api/functions_block_comments_api.py +++ /dev/null @@ -1,849 +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 StrictInt -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse -from revengai.models.base_response_block_comments_overview_generation_response import BaseResponseBlockCommentsOverviewGenerationResponse -from revengai.models.block import Block - -from revengai.api_client import ApiClient, RequestSerialized -from revengai.api_response import ApiResponse -from revengai.rest import RESTResponseType - - -class FunctionsBlockCommentsApi: - """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 generate_block_comments_for_block_in_function( - self, - function_id: StrictInt, - block: Block, - _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, - ) -> BaseResponseBlockCommentsGenerationForFunctionResponse: - """Generate block comments for a specific block in a function - - - :param function_id: (required) - :type function_id: int - :param block: (required) - :type block: Block - :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._generate_block_comments_for_block_in_function_serialize( - function_id=function_id, - block=block, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsGenerationForFunctionResponse", - '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 generate_block_comments_for_block_in_function_with_http_info( - self, - function_id: StrictInt, - block: Block, - _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[BaseResponseBlockCommentsGenerationForFunctionResponse]: - """Generate block comments for a specific block in a function - - - :param function_id: (required) - :type function_id: int - :param block: (required) - :type block: Block - :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._generate_block_comments_for_block_in_function_serialize( - function_id=function_id, - block=block, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsGenerationForFunctionResponse", - '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 generate_block_comments_for_block_in_function_without_preload_content( - self, - function_id: StrictInt, - block: Block, - _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: - """Generate block comments for a specific block in a function - - - :param function_id: (required) - :type function_id: int - :param block: (required) - :type block: Block - :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._generate_block_comments_for_block_in_function_serialize( - function_id=function_id, - block=block, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsGenerationForFunctionResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _generate_block_comments_for_block_in_function_serialize( - self, - function_id, - block, - _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 block is not None: - _body_params = block - - - # 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/{function_id}/block-comments/single', - 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 generate_block_comments_for_function( - self, - function_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, - ) -> BaseResponseBlockCommentsGenerationForFunctionResponse: - """Generate block comments for a function - - - :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 - (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._generate_block_comments_for_function_serialize( - function_id=function_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsGenerationForFunctionResponse", - '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 generate_block_comments_for_function_with_http_info( - self, - function_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[BaseResponseBlockCommentsGenerationForFunctionResponse]: - """Generate block comments for a function - - - :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 - (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._generate_block_comments_for_function_serialize( - function_id=function_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsGenerationForFunctionResponse", - '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 generate_block_comments_for_function_without_preload_content( - self, - function_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: - """Generate block comments for a function - - - :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 - (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._generate_block_comments_for_function_serialize( - function_id=function_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsGenerationForFunctionResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _generate_block_comments_for_function_serialize( - self, - function_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 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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'APIKey' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/functions/{function_id}/block-comments', - 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 generate_overview_comment_for_function( - self, - function_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, - ) -> BaseResponseBlockCommentsOverviewGenerationResponse: - """Generate overview comment for a function - - - :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 - (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._generate_overview_comment_for_function_serialize( - function_id=function_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsOverviewGenerationResponse", - '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 generate_overview_comment_for_function_with_http_info( - self, - function_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[BaseResponseBlockCommentsOverviewGenerationResponse]: - """Generate overview comment for a function - - - :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 - (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._generate_overview_comment_for_function_serialize( - function_id=function_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsOverviewGenerationResponse", - '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 generate_overview_comment_for_function_without_preload_content( - self, - function_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: - """Generate overview comment for a function - - - :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 - (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._generate_overview_comment_for_function_serialize( - function_id=function_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBlockCommentsOverviewGenerationResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _generate_overview_comment_for_function_serialize( - self, - function_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 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 - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'APIKey' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v2/functions/{function_id}/block-comments/overview', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/revengai/api/functions_decompilation_api.py b/revengai/api/functions_decompilation_api.py deleted file mode 100644 index c8c21d6..0000000 --- a/revengai/api/functions_decompilation_api.py +++ /dev/null @@ -1,1607 +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, StrictInt, StrictStr -from typing import Optional -from typing_extensions import Annotated -from revengai.models.base_response_bool import BaseResponseBool -from revengai.models.base_response_comment_response import BaseResponseCommentResponse -from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse -from revengai.models.comment_update_request import CommentUpdateRequest -from revengai.models.function_comment_create_request import FunctionCommentCreateRequest - -from revengai.api_client import ApiClient, RequestSerialized -from revengai.api_response import ApiResponse -from revengai.rest import RESTResponseType - - -class FunctionsDecompilationApi: - """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 create_decompilation_comment( - self, - function_id: StrictInt, - function_comment_create_request: FunctionCommentCreateRequest, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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, - ) -> BaseResponseCommentResponse: - """Create a comment for this function - - Creates a comment associated with a specified function). - - :param function_id: (required) - :type function_id: int - :param function_comment_create_request: (required) - :type function_comment_create_request: FunctionCommentCreateRequest - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_decompilation_comment_serialize( - function_id=function_id, - function_comment_create_request=function_comment_create_request, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseCommentResponse", - '422': "BaseResponse", - '400': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def create_decompilation_comment_with_http_info( - self, - function_id: StrictInt, - function_comment_create_request: FunctionCommentCreateRequest, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseCommentResponse]: - """Create a comment for this function - - Creates a comment associated with a specified function). - - :param function_id: (required) - :type function_id: int - :param function_comment_create_request: (required) - :type function_comment_create_request: FunctionCommentCreateRequest - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_decompilation_comment_serialize( - function_id=function_id, - function_comment_create_request=function_comment_create_request, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseCommentResponse", - '422': "BaseResponse", - '400': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def create_decompilation_comment_without_preload_content( - self, - function_id: StrictInt, - function_comment_create_request: FunctionCommentCreateRequest, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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: - """Create a comment for this function - - Creates a comment associated with a specified function). - - :param function_id: (required) - :type function_id: int - :param function_comment_create_request: (required) - :type function_comment_create_request: FunctionCommentCreateRequest - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_decompilation_comment_serialize( - function_id=function_id, - function_comment_create_request=function_comment_create_request, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseCommentResponse", - '422': "BaseResponse", - '400': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_decompilation_comment_serialize( - self, - function_id, - function_comment_create_request, - endpoint_url, - local_cache_dir, - local_cache_max_size_mb, - customer_samples_bucket, - firmware_samples_bucket, - max_retry_attempts, - _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 - if endpoint_url is not None: - - _query_params.append(('endpoint_url', endpoint_url)) - - if local_cache_dir is not None: - - _query_params.append(('local_cache_dir', local_cache_dir)) - - if local_cache_max_size_mb is not None: - - _query_params.append(('local_cache_max_size_mb', local_cache_max_size_mb)) - - if customer_samples_bucket is not None: - - _query_params.append(('customer_samples_bucket', customer_samples_bucket)) - - if firmware_samples_bucket is not None: - - _query_params.append(('firmware_samples_bucket', firmware_samples_bucket)) - - if max_retry_attempts is not None: - - _query_params.append(('max_retry_attempts', max_retry_attempts)) - - # process the header parameters - # process the form parameters - # process the body parameter - if function_comment_create_request is not None: - _body_params = function_comment_create_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/{function_id}/decompilation/comments', - 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 delete_decompilation_comment( - self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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, - ) -> BaseResponseBool: - """Delete a comment - - Deletes an existing comment. Users can only delete their own comments. - - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) - :type function_id: int - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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._delete_decompilation_comment_serialize( - comment_id=comment_id, - function_id=function_id, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBool", - '422': "BaseResponse", - '403': "BaseResponse", - '400': "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 delete_decompilation_comment_with_http_info( - self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseBool]: - """Delete a comment - - Deletes an existing comment. Users can only delete their own comments. - - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) - :type function_id: int - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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._delete_decompilation_comment_serialize( - comment_id=comment_id, - function_id=function_id, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBool", - '422': "BaseResponse", - '403': "BaseResponse", - '400': "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 delete_decompilation_comment_without_preload_content( - self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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: - """Delete a comment - - Deletes an existing comment. Users can only delete their own comments. - - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) - :type function_id: int - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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._delete_decompilation_comment_serialize( - comment_id=comment_id, - function_id=function_id, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseBool", - '422': "BaseResponse", - '403': "BaseResponse", - '400': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_decompilation_comment_serialize( - self, - comment_id, - function_id, - endpoint_url, - local_cache_dir, - local_cache_max_size_mb, - customer_samples_bucket, - firmware_samples_bucket, - max_retry_attempts, - _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 comment_id is not None: - _path_params['comment_id'] = comment_id - if function_id is not None: - _path_params['function_id'] = function_id - # process the query parameters - if endpoint_url is not None: - - _query_params.append(('endpoint_url', endpoint_url)) - - if local_cache_dir is not None: - - _query_params.append(('local_cache_dir', local_cache_dir)) - - if local_cache_max_size_mb is not None: - - _query_params.append(('local_cache_max_size_mb', local_cache_max_size_mb)) - - if customer_samples_bucket is not None: - - _query_params.append(('customer_samples_bucket', customer_samples_bucket)) - - if firmware_samples_bucket is not None: - - _query_params.append(('firmware_samples_bucket', firmware_samples_bucket)) - - if max_retry_attempts is not None: - - _query_params.append(('max_retry_attempts', max_retry_attempts)) - - # 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/functions/{function_id}/decompilation/comments/{comment_id}', - 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_decompilation_comments( - self, - function_id: StrictInt, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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, - ) -> BaseResponseListCommentResponse: - """Get comments for this function - - Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - - :param function_id: (required) - :type function_id: int - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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_decompilation_comments_serialize( - function_id=function_id, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '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_decompilation_comments_with_http_info( - self, - function_id: StrictInt, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseListCommentResponse]: - """Get comments for this function - - Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - - :param function_id: (required) - :type function_id: int - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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_decompilation_comments_serialize( - function_id=function_id, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '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_decompilation_comments_without_preload_content( - self, - function_id: StrictInt, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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 comments for this function - - Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - - :param function_id: (required) - :type function_id: int - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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_decompilation_comments_serialize( - function_id=function_id, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_decompilation_comments_serialize( - self, - function_id, - endpoint_url, - local_cache_dir, - local_cache_max_size_mb, - customer_samples_bucket, - firmware_samples_bucket, - max_retry_attempts, - _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 - if endpoint_url is not None: - - _query_params.append(('endpoint_url', endpoint_url)) - - if local_cache_dir is not None: - - _query_params.append(('local_cache_dir', local_cache_dir)) - - if local_cache_max_size_mb is not None: - - _query_params.append(('local_cache_max_size_mb', local_cache_max_size_mb)) - - if customer_samples_bucket is not None: - - _query_params.append(('customer_samples_bucket', customer_samples_bucket)) - - if firmware_samples_bucket is not None: - - _query_params.append(('firmware_samples_bucket', firmware_samples_bucket)) - - if max_retry_attempts is not None: - - _query_params.append(('max_retry_attempts', max_retry_attempts)) - - # 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/functions/{function_id}/decompilation/comments', - 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 update_decompilation_comment( - self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - comment_update_request: CommentUpdateRequest, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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, - ) -> BaseResponseCommentResponse: - """Update a comment - - Updates the content of an existing comment. Users can only update their own comments. - - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) - :type function_id: int - :param comment_update_request: (required) - :type comment_update_request: CommentUpdateRequest - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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._update_decompilation_comment_serialize( - comment_id=comment_id, - function_id=function_id, - comment_update_request=comment_update_request, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCommentResponse", - '422': "BaseResponse", - '403': "BaseResponse", - '400': "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 update_decompilation_comment_with_http_info( - self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - comment_update_request: CommentUpdateRequest, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseCommentResponse]: - """Update a comment - - Updates the content of an existing comment. Users can only update their own comments. - - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) - :type function_id: int - :param comment_update_request: (required) - :type comment_update_request: CommentUpdateRequest - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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._update_decompilation_comment_serialize( - comment_id=comment_id, - function_id=function_id, - comment_update_request=comment_update_request, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCommentResponse", - '422': "BaseResponse", - '403': "BaseResponse", - '400': "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 update_decompilation_comment_without_preload_content( - self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - comment_update_request: CommentUpdateRequest, - endpoint_url: Optional[StrictStr] = None, - local_cache_dir: Optional[StrictStr] = None, - local_cache_max_size_mb: Optional[StrictInt] = None, - customer_samples_bucket: Optional[StrictStr] = None, - firmware_samples_bucket: Optional[StrictStr] = None, - max_retry_attempts: Optional[StrictInt] = 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: - """Update a comment - - Updates the content of an existing comment. Users can only update their own comments. - - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) - :type function_id: int - :param comment_update_request: (required) - :type comment_update_request: CommentUpdateRequest - :param endpoint_url: - :type endpoint_url: str - :param local_cache_dir: - :type local_cache_dir: str - :param local_cache_max_size_mb: - :type local_cache_max_size_mb: int - :param customer_samples_bucket: - :type customer_samples_bucket: str - :param firmware_samples_bucket: - :type firmware_samples_bucket: str - :param max_retry_attempts: - :type max_retry_attempts: 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._update_decompilation_comment_serialize( - comment_id=comment_id, - function_id=function_id, - comment_update_request=comment_update_request, - endpoint_url=endpoint_url, - local_cache_dir=local_cache_dir, - local_cache_max_size_mb=local_cache_max_size_mb, - customer_samples_bucket=customer_samples_bucket, - firmware_samples_bucket=firmware_samples_bucket, - max_retry_attempts=max_retry_attempts, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCommentResponse", - '422': "BaseResponse", - '403': "BaseResponse", - '400': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_decompilation_comment_serialize( - self, - comment_id, - function_id, - comment_update_request, - endpoint_url, - local_cache_dir, - local_cache_max_size_mb, - customer_samples_bucket, - firmware_samples_bucket, - max_retry_attempts, - _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 comment_id is not None: - _path_params['comment_id'] = comment_id - if function_id is not None: - _path_params['function_id'] = function_id - # process the query parameters - if endpoint_url is not None: - - _query_params.append(('endpoint_url', endpoint_url)) - - if local_cache_dir is not None: - - _query_params.append(('local_cache_dir', local_cache_dir)) - - if local_cache_max_size_mb is not None: - - _query_params.append(('local_cache_max_size_mb', local_cache_max_size_mb)) - - if customer_samples_bucket is not None: - - _query_params.append(('customer_samples_bucket', customer_samples_bucket)) - - if firmware_samples_bucket is not None: - - _query_params.append(('firmware_samples_bucket', firmware_samples_bucket)) - - if max_retry_attempts is not None: - - _query_params.append(('max_retry_attempts', max_retry_attempts)) - - # process the header parameters - # process the form parameters - # process the body parameter - if comment_update_request is not None: - _body_params = comment_update_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='PATCH', - resource_path='/v2/functions/{function_id}/decompilation/comments/{comment_id}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/revengai/api_client.py b/revengai/api_client.py index fe50c7f..c922072 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v3.63.0/python' + self.user_agent = 'OpenAPI-Generator/v3.65.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 8af19b8..79e178d 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.63.0\n"\ - "SDK Package Version: v3.63.0".\ + "Version of the API: v3.65.0\n"\ + "SDK Package Version: v3.65.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index e69db17..40001df 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -70,8 +70,6 @@ from revengai.models.base_response_binary_details_response import BaseResponseBinaryDetailsResponse from revengai.models.base_response_binary_externals_response import BaseResponseBinaryExternalsResponse from revengai.models.base_response_binary_search_response import BaseResponseBinarySearchResponse -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse -from revengai.models.base_response_block_comments_overview_generation_response import BaseResponseBlockCommentsOverviewGenerationResponse from revengai.models.base_response_bool import BaseResponseBool from revengai.models.base_response_callees_caller_functions_response import BaseResponseCalleesCallerFunctionsResponse from revengai.models.base_response_capabilities import BaseResponseCapabilities @@ -139,8 +137,6 @@ from revengai.models.binary_search_response import BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult from revengai.models.binary_task_status import BinaryTaskStatus -from revengai.models.block import Block -from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest from revengai.models.callee_function_info import CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse diff --git a/revengai/models/base_response_block_comments_generation_for_function_response.py b/revengai/models/base_response_block_comments_generation_for_function_response.py deleted file mode 100644 index 5f7d136..0000000 --- a/revengai/models/base_response_block_comments_generation_for_function_response.py +++ /dev/null @@ -1,125 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse -from revengai.models.error_model import ErrorModel -from revengai.models.meta_model import MetaModel -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseBlockCommentsGenerationForFunctionResponse(BaseModel): - """ - BaseResponseBlockCommentsGenerationForFunctionResponse - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[BlockCommentsGenerationForFunctionResponse] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseBlockCommentsGenerationForFunctionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseBlockCommentsGenerationForFunctionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": BlockCommentsGenerationForFunctionResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/base_response_block_comments_overview_generation_response.py b/revengai/models/base_response_block_comments_overview_generation_response.py deleted file mode 100644 index 3b918b0..0000000 --- a/revengai/models/base_response_block_comments_overview_generation_response.py +++ /dev/null @@ -1,116 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.meta_model import MetaModel -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseBlockCommentsOverviewGenerationResponse(BaseModel): - """ - BaseResponseBlockCommentsOverviewGenerationResponse - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[Dict[str, Any]] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseBlockCommentsOverviewGenerationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseBlockCommentsOverviewGenerationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": obj.get("data"), - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/block.py b/revengai/models/block.py deleted file mode 100644 index 987246d..0000000 --- a/revengai/models/block.py +++ /dev/null @@ -1,86 +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 - - -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 -from typing import Optional, Set -from typing_extensions import Self - -class Block(BaseModel): - """ - Block - """ # noqa: E501 - virtual_address: StrictInt - __properties: ClassVar[List[str]] = ["virtual_address"] - - 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 Block from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Block from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "virtual_address": obj.get("virtual_address") - }) - return _obj - - diff --git a/revengai/models/block_comments_generation_for_function_response.py b/revengai/models/block_comments_generation_for_function_response.py deleted file mode 100644 index 9d5852f..0000000 --- a/revengai/models/block_comments_generation_for_function_response.py +++ /dev/null @@ -1,86 +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 - - -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 -from typing import Optional, Set -from typing_extensions import Self - -class BlockCommentsGenerationForFunctionResponse(BaseModel): - """ - BlockCommentsGenerationForFunctionResponse - """ # noqa: E501 - updated_blocks: StrictInt - __properties: ClassVar[List[str]] = ["updated_blocks"] - - 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 BlockCommentsGenerationForFunctionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BlockCommentsGenerationForFunctionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "updated_blocks": obj.get("updated_blocks") - }) - return _obj - - diff --git a/revengai/models/function_blocks_response.py b/revengai/models/function_blocks_response.py index e5bbab4..a1bf01c 100644 --- a/revengai/models/function_blocks_response.py +++ b/revengai/models/function_blocks_response.py @@ -31,7 +31,7 @@ class FunctionBlocksResponse(BaseModel): blocks: List[FunctionBlockResponse] = Field(description="Disassembly is broken into control flow blocks") local_variables: List[FunctionLocalVariableResponse] = Field(description="Local variables associated with this function") params: List[FunctionParamResponse] = Field(description="Params associated with this function") - overview_comment: Optional[StrictStr] + overview_comment: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["blocks", "local_variables", "params", "overview_comment"] model_config = ConfigDict( diff --git a/test/test_base_response_block_comments_generation_for_function_response.py b/test/test_base_response_block_comments_generation_for_function_response.py deleted file mode 100644 index acdb722..0000000 --- a/test/test_base_response_block_comments_generation_for_function_response.py +++ /dev/null @@ -1,63 +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 unittest - -from revengai.models.base_response_block_comments_generation_for_function_response import BaseResponseBlockCommentsGenerationForFunctionResponse - -class TestBaseResponseBlockCommentsGenerationForFunctionResponse(unittest.TestCase): - """BaseResponseBlockCommentsGenerationForFunctionResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> BaseResponseBlockCommentsGenerationForFunctionResponse: - """Test BaseResponseBlockCommentsGenerationForFunctionResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BaseResponseBlockCommentsGenerationForFunctionResponse` - """ - model = BaseResponseBlockCommentsGenerationForFunctionResponse() - if include_optional: - return BaseResponseBlockCommentsGenerationForFunctionResponse( - status = True, - data = revengai.models.block_comments_generation_for_function_response.BlockCommentsGenerationForFunctionResponse( - updated_blocks = 56, ), - message = '', - errors = [ - revengai.models.error_model.ErrorModel( - code = '', - message = '', ) - ], - meta = revengai.models.meta_model.MetaModel( - pagination = revengai.models.pagination_model.PaginationModel( - page_size = 56, - page_number = 56, - has_next_page = True, ), ) - ) - else: - return BaseResponseBlockCommentsGenerationForFunctionResponse( - ) - """ - - def testBaseResponseBlockCommentsGenerationForFunctionResponse(self): - """Test BaseResponseBlockCommentsGenerationForFunctionResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_base_response_block_comments_overview_generation_response.py b/test/test_base_response_block_comments_overview_generation_response.py deleted file mode 100644 index 5ccd572..0000000 --- a/test/test_base_response_block_comments_overview_generation_response.py +++ /dev/null @@ -1,62 +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 unittest - -from revengai.models.base_response_block_comments_overview_generation_response import BaseResponseBlockCommentsOverviewGenerationResponse - -class TestBaseResponseBlockCommentsOverviewGenerationResponse(unittest.TestCase): - """BaseResponseBlockCommentsOverviewGenerationResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> BaseResponseBlockCommentsOverviewGenerationResponse: - """Test BaseResponseBlockCommentsOverviewGenerationResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BaseResponseBlockCommentsOverviewGenerationResponse` - """ - model = BaseResponseBlockCommentsOverviewGenerationResponse() - if include_optional: - return BaseResponseBlockCommentsOverviewGenerationResponse( - status = True, - data = revengai.models.block_comments_overview_generation_response.BlockCommentsOverviewGenerationResponse(), - message = '', - errors = [ - revengai.models.error_model.ErrorModel( - code = '', - message = '', ) - ], - meta = revengai.models.meta_model.MetaModel( - pagination = revengai.models.pagination_model.PaginationModel( - page_size = 56, - page_number = 56, - has_next_page = True, ), ) - ) - else: - return BaseResponseBlockCommentsOverviewGenerationResponse( - ) - """ - - def testBaseResponseBlockCommentsOverviewGenerationResponse(self): - """Test BaseResponseBlockCommentsOverviewGenerationResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_block.py b/test/test_block.py deleted file mode 100644 index 92d2ef3..0000000 --- a/test/test_block.py +++ /dev/null @@ -1,51 +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 unittest - -from revengai.models.block import Block - -class TestBlock(unittest.TestCase): - """Block unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Block: - """Test Block - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Block` - """ - model = Block() - if include_optional: - return Block( - virtual_address = 56 - ) - else: - return Block( - virtual_address = 56, - ) - """ - - def testBlock(self): - """Test Block""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_block_comments_generation_for_function_response.py b/test/test_block_comments_generation_for_function_response.py deleted file mode 100644 index ae76edb..0000000 --- a/test/test_block_comments_generation_for_function_response.py +++ /dev/null @@ -1,51 +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 unittest - -from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse - -class TestBlockCommentsGenerationForFunctionResponse(unittest.TestCase): - """BlockCommentsGenerationForFunctionResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> BlockCommentsGenerationForFunctionResponse: - """Test BlockCommentsGenerationForFunctionResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BlockCommentsGenerationForFunctionResponse` - """ - model = BlockCommentsGenerationForFunctionResponse() - if include_optional: - return BlockCommentsGenerationForFunctionResponse( - updated_blocks = 56 - ) - else: - return BlockCommentsGenerationForFunctionResponse( - updated_blocks = 56, - ) - """ - - def testBlockCommentsGenerationForFunctionResponse(self): - """Test BlockCommentsGenerationForFunctionResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_function_blocks_response.py b/test/test_function_blocks_response.py index 6041528..a91616d 100644 --- a/test/test_function_blocks_response.py +++ b/test/test_function_blocks_response.py @@ -102,7 +102,6 @@ def make_instance(self, include_optional) -> FunctionBlocksResponse: length = 56, name = '', ) ], - overview_comment = '', ) """ diff --git a/test/test_functions_block_comments_api.py b/test/test_functions_block_comments_api.py deleted file mode 100644 index 7cde561..0000000 --- a/test/test_functions_block_comments_api.py +++ /dev/null @@ -1,51 +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 unittest - -from revengai.api.functions_block_comments_api import FunctionsBlockCommentsApi - - -class TestFunctionsBlockCommentsApi(unittest.TestCase): - """FunctionsBlockCommentsApi unit test stubs""" - - def setUp(self) -> None: - self.api = FunctionsBlockCommentsApi() - - def tearDown(self) -> None: - pass - - def test_generate_block_comments_for_block_in_function(self) -> None: - """Test case for generate_block_comments_for_block_in_function - - Generate block comments for a specific block in a function - """ - pass - - def test_generate_block_comments_for_function(self) -> None: - """Test case for generate_block_comments_for_function - - Generate block comments for a function - """ - pass - - def test_generate_overview_comment_for_function(self) -> None: - """Test case for generate_overview_comment_for_function - - Generate overview comment for a function - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_functions_decompilation_api.py b/test/test_functions_decompilation_api.py deleted file mode 100644 index 029afd6..0000000 --- a/test/test_functions_decompilation_api.py +++ /dev/null @@ -1,58 +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 unittest - -from revengai.api.functions_decompilation_api import FunctionsDecompilationApi - - -class TestFunctionsDecompilationApi(unittest.TestCase): - """FunctionsDecompilationApi unit test stubs""" - - def setUp(self) -> None: - self.api = FunctionsDecompilationApi() - - def tearDown(self) -> None: - pass - - def test_create_decompilation_comment(self) -> None: - """Test case for create_decompilation_comment - - Create a comment for this function - """ - pass - - def test_delete_decompilation_comment(self) -> None: - """Test case for delete_decompilation_comment - - Delete a comment - """ - pass - - def test_get_decompilation_comments(self) -> None: - """Test case for get_decompilation_comments - - Get comments for this function - """ - pass - - def test_update_decompilation_comment(self) -> None: - """Test case for update_decompilation_comment - - Update a comment - """ - pass - - -if __name__ == '__main__': - unittest.main()