diff --git a/README.md b/README.md index c97e7fd..0cb97ce 100644 --- a/README.md +++ b/README.md @@ -154,9 +154,13 @@ Class | Method | HTTP request | Description *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 *FunctionsRenamingHistoryApi* | [**batch_rename_function**](docs/FunctionsRenamingHistoryApi.md#batch_rename_function) | **POST** /v2/functions/rename/batch | Batch Rename Functions +*FunctionsRenamingHistoryApi* | [**batch_rename_functions**](docs/FunctionsRenamingHistoryApi.md#batch_rename_functions) | **POST** /v3/functions/rename | Batch rename functions +*FunctionsRenamingHistoryApi* | [**get_function_history**](docs/FunctionsRenamingHistoryApi.md#get_function_history) | **GET** /v3/functions/{function_id}/history | Get function name history *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**](docs/FunctionsRenamingHistoryApi.md#rename_function) | **POST** /v3/functions/{function_id}/rename | Rename a function *FunctionsRenamingHistoryApi* | [**rename_function_id**](docs/FunctionsRenamingHistoryApi.md#rename_function_id) | **POST** /v2/functions/rename/{function_id} | Rename Function *FunctionsRenamingHistoryApi* | [**revert_function_name**](docs/FunctionsRenamingHistoryApi.md#revert_function_name) | **POST** /v2/functions/history/{function_id}/{history_id} | Revert the function name +*FunctionsRenamingHistoryApi* | [**revert_function_name_0**](docs/FunctionsRenamingHistoryApi.md#revert_function_name_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name *ModelsApi* | [**get_models**](docs/ModelsApi.md#get_models) | **GET** /v2/models | Gets models *ReportsApi* | [**create_pdf_report**](docs/ReportsApi.md#create_pdf_report) | **POST** /v3/analysis/{analysis_id}/pdf | Start PDF report generation *ReportsApi* | [**download_pdf_report**](docs/ReportsApi.md#download_pdf_report) | **GET** /v3/analysis/{analysis_id}/pdf/{task_id} | Download generated PDF report @@ -277,6 +281,9 @@ Class | Method | HTTP request | Description - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - [BaseResponseXrefResponse](docs/BaseResponseXrefResponse.md) - [Basic](docs/Basic.md) + - [BatchRenameInputBody](docs/BatchRenameInputBody.md) + - [BatchRenameItem](docs/BatchRenameItem.md) + - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [BinaryAdditionalDetailsDataResponse](docs/BinaryAdditionalDetailsDataResponse.md) @@ -412,6 +419,7 @@ Class | Method | HTTP request | Description - [GetMeResponse](docs/GetMeResponse.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GlobalVariable](docs/GlobalVariable.md) + - [HistoryEntry](docs/HistoryEntry.md) - [HttpRequest](docs/HttpRequest.md) - [IOC](docs/IOC.md) - [ISA](docs/ISA.md) @@ -457,11 +465,14 @@ Class | Method | HTTP request | Description - [RegenerateTarget](docs/RegenerateTarget.md) - [RegistryOperation](docs/RegistryOperation.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) + - [RenameInputBody](docs/RenameInputBody.md) + - [RenameOutputBody](docs/RenameOutputBody.md) - [ReplacementValue](docs/ReplacementValue.md) - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) - [ReportEvent](docs/ReportEvent.md) - [ReportInfo](docs/ReportInfo.md) - [ReportOptions](docs/ReportOptions.md) + - [RevertOutputBody](docs/RevertOutputBody.md) - [SBOM](docs/SBOM.md) - [SBOMPackage](docs/SBOMPackage.md) - [SandboxOptions](docs/SandboxOptions.md) diff --git a/docs/BatchRenameInputBody.md b/docs/BatchRenameInputBody.md new file mode 100644 index 0000000..e720638 --- /dev/null +++ b/docs/BatchRenameInputBody.md @@ -0,0 +1,30 @@ +# BatchRenameInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**functions** | [**List[BatchRenameItem]**](BatchRenameItem.md) | List of functions to rename | + +## Example + +```python +from revengai.models.batch_rename_input_body import BatchRenameInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchRenameInputBody from a JSON string +batch_rename_input_body_instance = BatchRenameInputBody.from_json(json) +# print the JSON string representation of the object +print(BatchRenameInputBody.to_json()) + +# convert the object into a dict +batch_rename_input_body_dict = batch_rename_input_body_instance.to_dict() +# create an instance of BatchRenameInputBody from a dict +batch_rename_input_body_from_dict = BatchRenameInputBody.from_dict(batch_rename_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchRenameItem.md b/docs/BatchRenameItem.md new file mode 100644 index 0000000..c0f2413 --- /dev/null +++ b/docs/BatchRenameItem.md @@ -0,0 +1,31 @@ +# BatchRenameItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_id** | **int** | Function ID to rename | +**new_mangled_name** | **str** | New mangled function name | [optional] +**new_name** | **str** | New function name | + +## Example + +```python +from revengai.models.batch_rename_item import BatchRenameItem + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchRenameItem from a JSON string +batch_rename_item_instance = BatchRenameItem.from_json(json) +# print the JSON string representation of the object +print(BatchRenameItem.to_json()) + +# convert the object into a dict +batch_rename_item_dict = batch_rename_item_instance.to_dict() +# create an instance of BatchRenameItem from a dict +batch_rename_item_from_dict = BatchRenameItem.from_dict(batch_rename_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchRenameOutputBody.md b/docs/BatchRenameOutputBody.md new file mode 100644 index 0000000..12a4ecf --- /dev/null +++ b/docs/BatchRenameOutputBody.md @@ -0,0 +1,30 @@ +# BatchRenameOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**renamed_count** | **int** | Number of functions renamed | + +## Example + +```python +from revengai.models.batch_rename_output_body import BatchRenameOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchRenameOutputBody from a JSON string +batch_rename_output_body_instance = BatchRenameOutputBody.from_json(json) +# print the JSON string representation of the object +print(BatchRenameOutputBody.to_json()) + +# convert the object into a dict +batch_rename_output_body_dict = batch_rename_output_body_instance.to_dict() +# create an instance of BatchRenameOutputBody from a dict +batch_rename_output_body_from_dict = BatchRenameOutputBody.from_dict(batch_rename_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FunctionsRenamingHistoryApi.md b/docs/FunctionsRenamingHistoryApi.md index eb83551..57d32bb 100644 --- a/docs/FunctionsRenamingHistoryApi.md +++ b/docs/FunctionsRenamingHistoryApi.md @@ -5,9 +5,13 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- [**batch_rename_function**](FunctionsRenamingHistoryApi.md#batch_rename_function) | **POST** /v2/functions/rename/batch | Batch Rename Functions +[**batch_rename_functions**](FunctionsRenamingHistoryApi.md#batch_rename_functions) | **POST** /v3/functions/rename | Batch rename functions +[**get_function_history**](FunctionsRenamingHistoryApi.md#get_function_history) | **GET** /v3/functions/{function_id}/history | Get function name history [**get_function_name_history**](FunctionsRenamingHistoryApi.md#get_function_name_history) | **GET** /v2/functions/history/{function_id} | Get Function Name History +[**rename_function**](FunctionsRenamingHistoryApi.md#rename_function) | **POST** /v3/functions/{function_id}/rename | Rename a function [**rename_function_id**](FunctionsRenamingHistoryApi.md#rename_function_id) | **POST** /v2/functions/rename/{function_id} | Rename Function [**revert_function_name**](FunctionsRenamingHistoryApi.md#revert_function_name) | **POST** /v2/functions/history/{function_id}/{history_id} | Revert the function name +[**revert_function_name_0**](FunctionsRenamingHistoryApi.md#revert_function_name_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name # **batch_rename_function** @@ -92,6 +96,181 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **batch_rename_functions** +> BatchRenameOutputBody batch_rename_functions(batch_rename_input_body) + +Batch rename functions + +Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.batch_rename_input_body import BatchRenameInputBody +from revengai.models.batch_rename_output_body import BatchRenameOutputBody +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.FunctionsRenamingHistoryApi(api_client) + batch_rename_input_body = revengai.BatchRenameInputBody() # BatchRenameInputBody | + + try: + # Batch rename functions + api_response = api_instance.batch_rename_functions(batch_rename_input_body) + print("The response of FunctionsRenamingHistoryApi->batch_rename_functions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsRenamingHistoryApi->batch_rename_functions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_rename_input_body** | [**BatchRenameInputBody**](BatchRenameInputBody.md)| | + +### Return type + +[**BatchRenameOutputBody**](BatchRenameOutputBody.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** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_function_history** +> List[HistoryEntry] get_function_history(function_id) + +Get function name history + +Returns the name change history for a function, newest first. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.history_entry import HistoryEntry +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.FunctionsRenamingHistoryApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get function name history + api_response = api_instance.get_function_history(function_id) + print("The response of FunctionsRenamingHistoryApi->get_function_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsRenamingHistoryApi->get_function_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**List[HistoryEntry]**](HistoryEntry.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_function_name_history** > BaseResponseListFunctionNameHistory get_function_name_history(function_id) @@ -172,6 +351,96 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **rename_function** +> RenameOutputBody rename_function(function_id, rename_input_body) + +Rename a function + +Renames a single function and records the change in history. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.rename_input_body import RenameInputBody +from revengai.models.rename_output_body import RenameOutputBody +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.FunctionsRenamingHistoryApi(api_client) + function_id = 56 # int | Function ID + rename_input_body = revengai.RenameInputBody() # RenameInputBody | + + try: + # Rename a function + api_response = api_instance.rename_function(function_id, rename_input_body) + print("The response of FunctionsRenamingHistoryApi->rename_function:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsRenamingHistoryApi->rename_function: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **rename_input_body** | [**RenameInputBody**](RenameInputBody.md)| | + +### Return type + +[**RenameOutputBody**](RenameOutputBody.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** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **rename_function_id** > BaseResponse rename_function_id(function_id, function_rename) @@ -338,3 +607,92 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **revert_function_name_0** +> RevertOutputBody revert_function_name_0(function_id, history_id) + +Revert function name + +Reverts a function's name to a previous value from its history. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.revert_output_body import RevertOutputBody +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.FunctionsRenamingHistoryApi(api_client) + function_id = 56 # int | Function ID + history_id = 56 # int | History ID to revert to + + try: + # Revert function name + api_response = api_instance.revert_function_name_0(function_id, history_id) + print("The response of FunctionsRenamingHistoryApi->revert_function_name_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsRenamingHistoryApi->revert_function_name_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **history_id** | **int**| History ID to revert to | + +### Return type + +[**RevertOutputBody**](RevertOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/HistoryEntry.md b/docs/HistoryEntry.md new file mode 100644 index 0000000..295f6d7 --- /dev/null +++ b/docs/HistoryEntry.md @@ -0,0 +1,35 @@ +# HistoryEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change_made_by** | **str** | Username of the user who made the change | +**created_at** | **datetime** | When this name change was recorded | +**function_name** | **str** | Function name at this point in history | +**history_id** | **int** | History record ID | +**is_debug** | **bool** | Whether the function had debug info | +**mangled_name** | **str** | Mangled function name | [optional] +**source_type** | **str** | Source of the rename (USER, SYSTEM, AI_UNSTRIP, etc.) | + +## Example + +```python +from revengai.models.history_entry import HistoryEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of HistoryEntry from a JSON string +history_entry_instance = HistoryEntry.from_json(json) +# print the JSON string representation of the object +print(HistoryEntry.to_json()) + +# convert the object into a dict +history_entry_dict = history_entry_instance.to_dict() +# create an instance of HistoryEntry from a dict +history_entry_from_dict = HistoryEntry.from_dict(history_entry_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/RenameInputBody.md b/docs/RenameInputBody.md new file mode 100644 index 0000000..ab12261 --- /dev/null +++ b/docs/RenameInputBody.md @@ -0,0 +1,31 @@ +# RenameInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**new_mangled_name** | **str** | New mangled function name | [optional] +**new_name** | **str** | New function name | + +## Example + +```python +from revengai.models.rename_input_body import RenameInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RenameInputBody from a JSON string +rename_input_body_instance = RenameInputBody.from_json(json) +# print the JSON string representation of the object +print(RenameInputBody.to_json()) + +# convert the object into a dict +rename_input_body_dict = rename_input_body_instance.to_dict() +# create an instance of RenameInputBody from a dict +rename_input_body_from_dict = RenameInputBody.from_dict(rename_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RenameOutputBody.md b/docs/RenameOutputBody.md new file mode 100644 index 0000000..c6707c5 --- /dev/null +++ b/docs/RenameOutputBody.md @@ -0,0 +1,30 @@ +# RenameOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**renamed_count** | **int** | Number of functions renamed | + +## Example + +```python +from revengai.models.rename_output_body import RenameOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RenameOutputBody from a JSON string +rename_output_body_instance = RenameOutputBody.from_json(json) +# print the JSON string representation of the object +print(RenameOutputBody.to_json()) + +# convert the object into a dict +rename_output_body_dict = rename_output_body_instance.to_dict() +# create an instance of RenameOutputBody from a dict +rename_output_body_from_dict = RenameOutputBody.from_dict(rename_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReportsApi.md b/docs/ReportsApi.md index 986bec7..c166085 100644 --- a/docs/ReportsApi.md +++ b/docs/ReportsApi.md @@ -14,12 +14,11 @@ Method | HTTP request | Description Start PDF report generation -Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. +Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. Idempotent: if a workflow is already running for this analysis and user, the same task_id is returned with `already_running: true` so the caller can rejoin the in-flight workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready ### Example @@ -92,7 +91,6 @@ Name | Type | Description | Notes **202** | Accepted | - | **403** | Forbidden | - | **404** | Not Found | - | -**409** | Conflict | - | **422** | Unprocessable Entity | - | **500** | Internal Server Error | - | diff --git a/docs/RevertOutputBody.md b/docs/RevertOutputBody.md new file mode 100644 index 0000000..3941a3d --- /dev/null +++ b/docs/RevertOutputBody.md @@ -0,0 +1,29 @@ +# RevertOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] + +## Example + +```python +from revengai.models.revert_output_body import RevertOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RevertOutputBody from a JSON string +revert_output_body_instance = RevertOutputBody.from_json(json) +# print the JSON string representation of the object +print(RevertOutputBody.to_json()) + +# convert the object into a dict +revert_output_body_dict = revert_output_body_instance.to_dict() +# create an instance of RevertOutputBody from a dict +revert_output_body_from_dict = RevertOutputBody.from_dict(revert_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index 59284f4..5e2ca8d 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -154,6 +154,9 @@ "BaseResponseVulnerabilities", "BaseResponseXrefResponse", "Basic", + "BatchRenameInputBody", + "BatchRenameItem", + "BatchRenameOutputBody", "BinariesRelatedStatusResponse", "BinariesTaskStatus", "BinaryAdditionalDetailsDataResponse", @@ -289,6 +292,7 @@ "GetMeResponse", "GetPublicUserResponse", "GlobalVariable", + "HistoryEntry", "HttpRequest", "IOC", "ISA", @@ -334,11 +338,14 @@ "RegenerateTarget", "RegistryOperation", "RelativeBinaryResponse", + "RenameInputBody", + "RenameOutputBody", "ReplacementValue", "ReportAnalysisResponse", "ReportEvent", "ReportInfo", "ReportOptions", + "RevertOutputBody", "SBOM", "SBOMPackage", "SandboxOptions", @@ -556,6 +563,9 @@ from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities as BaseResponseVulnerabilities from revengai.models.base_response_xref_response import BaseResponseXrefResponse as BaseResponseXrefResponse from revengai.models.basic import Basic as Basic +from revengai.models.batch_rename_input_body import BatchRenameInputBody as BatchRenameInputBody +from revengai.models.batch_rename_item import BatchRenameItem as BatchRenameItem +from revengai.models.batch_rename_output_body import BatchRenameOutputBody as BatchRenameOutputBody from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse as BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus as BinariesTaskStatus from revengai.models.binary_additional_details_data_response import BinaryAdditionalDetailsDataResponse as BinaryAdditionalDetailsDataResponse @@ -691,6 +701,7 @@ from revengai.models.get_me_response import GetMeResponse as GetMeResponse from revengai.models.get_public_user_response import GetPublicUserResponse as GetPublicUserResponse from revengai.models.global_variable import GlobalVariable as GlobalVariable +from revengai.models.history_entry import HistoryEntry as HistoryEntry from revengai.models.http_request import HttpRequest as HttpRequest from revengai.models.ioc import IOC as IOC from revengai.models.isa import ISA as ISA @@ -736,11 +747,14 @@ from revengai.models.regenerate_target import RegenerateTarget as RegenerateTarget from revengai.models.registry_operation import RegistryOperation as RegistryOperation from revengai.models.relative_binary_response import RelativeBinaryResponse as RelativeBinaryResponse +from revengai.models.rename_input_body import RenameInputBody as RenameInputBody +from revengai.models.rename_output_body import RenameOutputBody as RenameOutputBody from revengai.models.replacement_value import ReplacementValue as ReplacementValue from revengai.models.report_analysis_response import ReportAnalysisResponse as ReportAnalysisResponse from revengai.models.report_event import ReportEvent as ReportEvent from revengai.models.report_info import ReportInfo as ReportInfo from revengai.models.report_options import ReportOptions as ReportOptions +from revengai.models.revert_output_body import RevertOutputBody as RevertOutputBody from revengai.models.sbom import SBOM as SBOM from revengai.models.sbom_package import SBOMPackage as SBOMPackage from revengai.models.sandbox_options import SandboxOptions as SandboxOptions diff --git a/revengai/api/functions_renaming_history_api.py b/revengai/api/functions_renaming_history_api.py index 5b84707..e53140d 100644 --- a/revengai/api/functions_renaming_history_api.py +++ b/revengai/api/functions_renaming_history_api.py @@ -15,11 +15,19 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt +from pydantic import Field, StrictInt +from typing import List +from typing_extensions import Annotated from revengai.models.base_response import BaseResponse from revengai.models.base_response_list_function_name_history import BaseResponseListFunctionNameHistory +from revengai.models.batch_rename_input_body import BatchRenameInputBody +from revengai.models.batch_rename_output_body import BatchRenameOutputBody from revengai.models.function_rename import FunctionRename from revengai.models.functions_list_rename import FunctionsListRename +from revengai.models.history_entry import HistoryEntry +from revengai.models.rename_input_body import RenameInputBody +from revengai.models.rename_output_body import RenameOutputBody +from revengai.models.revert_output_body import RevertOutputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -317,9 +325,9 @@ def _batch_rename_function_serialize( @validate_call - def get_function_name_history( + def batch_rename_functions( self, - function_id: StrictInt, + batch_rename_input_body: BatchRenameInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -332,13 +340,13 @@ def get_function_name_history( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseListFunctionNameHistory: - """Get Function Name History + ) -> BatchRenameOutputBody: + """Batch rename functions - Gets the name history of a function using the function ID + Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_id: (required) - :type function_id: int + :param batch_rename_input_body: (required) + :type batch_rename_input_body: BatchRenameInputBody :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 @@ -361,8 +369,8 @@ def get_function_name_history( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_name_history_serialize( - function_id=function_id, + _param = self._batch_rename_functions_serialize( + batch_rename_input_body=batch_rename_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -370,8 +378,11 @@ def get_function_name_history( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListFunctionNameHistory", - '422': "BaseResponse", + '200': "BatchRenameOutputBody", + '400': "APIError", + '403': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -385,9 +396,9 @@ def get_function_name_history( @validate_call - def get_function_name_history_with_http_info( + def batch_rename_functions_with_http_info( self, - function_id: StrictInt, + batch_rename_input_body: BatchRenameInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -400,13 +411,13 @@ def get_function_name_history_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseListFunctionNameHistory]: - """Get Function Name History + ) -> ApiResponse[BatchRenameOutputBody]: + """Batch rename functions - Gets the name history of a function using the function ID + Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_id: (required) - :type function_id: int + :param batch_rename_input_body: (required) + :type batch_rename_input_body: BatchRenameInputBody :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 @@ -429,8 +440,8 @@ def get_function_name_history_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_name_history_serialize( - function_id=function_id, + _param = self._batch_rename_functions_serialize( + batch_rename_input_body=batch_rename_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -438,8 +449,11 @@ def get_function_name_history_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListFunctionNameHistory", - '422': "BaseResponse", + '200': "BatchRenameOutputBody", + '400': "APIError", + '403': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -453,9 +467,9 @@ def get_function_name_history_with_http_info( @validate_call - def get_function_name_history_without_preload_content( + def batch_rename_functions_without_preload_content( self, - function_id: StrictInt, + batch_rename_input_body: BatchRenameInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -469,12 +483,12 @@ def get_function_name_history_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Function Name History + """Batch rename functions - Gets the name history of a function using the function ID + Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param function_id: (required) - :type function_id: int + :param batch_rename_input_body: (required) + :type batch_rename_input_body: BatchRenameInputBody :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 @@ -497,8 +511,8 @@ def get_function_name_history_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_name_history_serialize( - function_id=function_id, + _param = self._batch_rename_functions_serialize( + batch_rename_input_body=batch_rename_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -506,8 +520,11 @@ def get_function_name_history_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListFunctionNameHistory", - '422': "BaseResponse", + '200': "BatchRenameOutputBody", + '400': "APIError", + '403': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -516,9 +533,9 @@ def get_function_name_history_without_preload_content( return response_data.response - def _get_function_name_history_serialize( + def _batch_rename_functions_serialize( self, - function_id, + batch_rename_input_body, _request_auth, _content_type, _headers, @@ -540,12 +557,12 @@ def _get_function_name_history_serialize( _body_params: Optional[bytes] = None # process the path parameters - if function_id is not None: - _path_params['function_id'] = function_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if batch_rename_input_body is not None: + _body_params = batch_rename_input_body # set the HTTP header `Accept` @@ -556,6 +573,19 @@ def _get_function_name_history_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -563,8 +593,8 @@ def _get_function_name_history_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v2/functions/history/{function_id}', + method='POST', + resource_path='/v3/functions/rename', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -581,10 +611,9 @@ def _get_function_name_history_serialize( @validate_call - def rename_function_id( + def get_function_history( self, - function_id: StrictInt, - function_rename: FunctionRename, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -597,15 +626,13 @@ def rename_function_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponse: - """Rename Function + ) -> List[HistoryEntry]: + """Get function name history - Renames a function using the function ID Will record name change history + Returns the name change history for a function, newest first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int - :param function_rename: (required) - :type function_rename: FunctionRename :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 @@ -628,9 +655,8 @@ def rename_function_id( :return: Returns the result object. """ # noqa: E501 - _param = self._rename_function_id_serialize( + _param = self._get_function_history_serialize( function_id=function_id, - function_rename=function_rename, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -638,8 +664,11 @@ def rename_function_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponse", - '422': "BaseResponse", + '200': "List[HistoryEntry]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -653,10 +682,9 @@ def rename_function_id( @validate_call - def rename_function_id_with_http_info( + def get_function_history_with_http_info( self, - function_id: StrictInt, - function_rename: FunctionRename, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -669,15 +697,13 @@ def rename_function_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponse]: - """Rename Function + ) -> ApiResponse[List[HistoryEntry]]: + """Get function name history - Renames a function using the function ID Will record name change history + Returns the name change history for a function, newest first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int - :param function_rename: (required) - :type function_rename: FunctionRename :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 @@ -700,9 +726,8 @@ def rename_function_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._rename_function_id_serialize( + _param = self._get_function_history_serialize( function_id=function_id, - function_rename=function_rename, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -710,8 +735,11 @@ def rename_function_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponse", - '422': "BaseResponse", + '200': "List[HistoryEntry]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -725,10 +753,9 @@ def rename_function_id_with_http_info( @validate_call - def rename_function_id_without_preload_content( + def get_function_history_without_preload_content( self, - function_id: StrictInt, - function_rename: FunctionRename, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -742,14 +769,12 @@ def rename_function_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Rename Function + """Get function name history - Renames a function using the function ID Will record name change history + Returns the name change history for a function, newest first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int - :param function_rename: (required) - :type function_rename: FunctionRename :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 @@ -772,9 +797,8 @@ def rename_function_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._rename_function_id_serialize( + _param = self._get_function_history_serialize( function_id=function_id, - function_rename=function_rename, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -782,8 +806,11 @@ def rename_function_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponse", - '422': "BaseResponse", + '200': "List[HistoryEntry]", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -792,10 +819,9 @@ def rename_function_id_without_preload_content( return response_data.response - def _rename_function_id_serialize( + def _get_function_history_serialize( self, function_id, - function_rename, _request_auth, _content_type, _headers, @@ -823,8 +849,6 @@ def _rename_function_id_serialize( # process the header parameters # process the form parameters # process the body parameter - if function_rename is not None: - _body_params = function_rename # set the HTTP header `Accept` @@ -835,19 +859,6 @@ def _rename_function_id_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -855,8 +866,8 @@ def _rename_function_id_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/functions/rename/{function_id}', + method='GET', + resource_path='/v3/functions/{function_id}/history', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -873,10 +884,9 @@ def _rename_function_id_serialize( @validate_call - def revert_function_name( + def get_function_name_history( self, function_id: StrictInt, - history_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -889,15 +899,13 @@ def revert_function_name( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponse: - """Revert the function name + ) -> BaseResponseListFunctionNameHistory: + """Get Function Name History - Reverts the function name to a previous name using the function ID and history ID + Gets the name history of a function using the function ID :param function_id: (required) :type function_id: int - :param history_id: (required) - :type history_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 @@ -920,9 +928,8 @@ def revert_function_name( :return: Returns the result object. """ # noqa: E501 - _param = self._revert_function_name_serialize( + _param = self._get_function_name_history_serialize( function_id=function_id, - history_id=history_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -930,7 +937,7 @@ def revert_function_name( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponse", + '200': "BaseResponseListFunctionNameHistory", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -945,10 +952,9 @@ def revert_function_name( @validate_call - def revert_function_name_with_http_info( + def get_function_name_history_with_http_info( self, function_id: StrictInt, - history_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -961,15 +967,13 @@ def revert_function_name_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponse]: - """Revert the function name + ) -> ApiResponse[BaseResponseListFunctionNameHistory]: + """Get Function Name History - Reverts the function name to a previous name using the function ID and history ID + Gets the name history of a function using the function ID :param function_id: (required) :type function_id: int - :param history_id: (required) - :type history_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 @@ -992,9 +996,8 @@ def revert_function_name_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._revert_function_name_serialize( + _param = self._get_function_name_history_serialize( function_id=function_id, - history_id=history_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1002,7 +1005,7 @@ def revert_function_name_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponse", + '200': "BaseResponseListFunctionNameHistory", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1017,10 +1020,9 @@ def revert_function_name_with_http_info( @validate_call - def revert_function_name_without_preload_content( + def get_function_name_history_without_preload_content( self, function_id: StrictInt, - history_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1034,14 +1036,12 @@ def revert_function_name_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Revert the function name + """Get Function Name History - Reverts the function name to a previous name using the function ID and history ID + Gets the name history of a function using the function ID :param function_id: (required) :type function_id: int - :param history_id: (required) - :type history_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 @@ -1064,9 +1064,8 @@ def revert_function_name_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._revert_function_name_serialize( + _param = self._get_function_name_history_serialize( function_id=function_id, - history_id=history_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1074,7 +1073,7 @@ def revert_function_name_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponse", + '200': "BaseResponseListFunctionNameHistory", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1084,10 +1083,9 @@ def revert_function_name_without_preload_content( return response_data.response - def _revert_function_name_serialize( + def _get_function_name_history_serialize( self, function_id, - history_id, _request_auth, _content_type, _headers, @@ -1111,8 +1109,6 @@ def _revert_function_name_serialize( # process the path parameters if function_id is not None: _path_params['function_id'] = function_id - if history_id is not None: - _path_params['history_id'] = history_id # process the query parameters # process the header parameters # process the form parameters @@ -1134,8 +1130,1168 @@ def _revert_function_name_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/functions/history/{function_id}/{history_id}', + method='GET', + resource_path='/v2/functions/history/{function_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 rename_function( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + rename_input_body: RenameInputBody, + _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, + ) -> RenameOutputBody: + """Rename a function + + Renames a single function and records the change in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param rename_input_body: (required) + :type rename_input_body: RenameInputBody + :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._rename_function_serialize( + function_id=function_id, + rename_input_body=rename_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RenameOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def rename_function_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + rename_input_body: RenameInputBody, + _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[RenameOutputBody]: + """Rename a function + + Renames a single function and records the change in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param rename_input_body: (required) + :type rename_input_body: RenameInputBody + :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._rename_function_serialize( + function_id=function_id, + rename_input_body=rename_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RenameOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def rename_function_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + rename_input_body: RenameInputBody, + _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: + """Rename a function + + Renames a single function and records the change in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param rename_input_body: (required) + :type rename_input_body: RenameInputBody + :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._rename_function_serialize( + function_id=function_id, + rename_input_body=rename_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RenameOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rename_function_serialize( + self, + function_id, + rename_input_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if rename_input_body is not None: + _body_params = rename_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/functions/{function_id}/rename', + 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 rename_function_id( + self, + function_id: StrictInt, + function_rename: FunctionRename, + _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, + ) -> BaseResponse: + """Rename Function + + Renames a function using the function ID Will record name change history + + :param function_id: (required) + :type function_id: int + :param function_rename: (required) + :type function_rename: FunctionRename + :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._rename_function_id_serialize( + function_id=function_id, + function_rename=function_rename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponse", + '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 rename_function_id_with_http_info( + self, + function_id: StrictInt, + function_rename: FunctionRename, + _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[BaseResponse]: + """Rename Function + + Renames a function using the function ID Will record name change history + + :param function_id: (required) + :type function_id: int + :param function_rename: (required) + :type function_rename: FunctionRename + :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._rename_function_id_serialize( + function_id=function_id, + function_rename=function_rename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponse", + '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 rename_function_id_without_preload_content( + self, + function_id: StrictInt, + function_rename: FunctionRename, + _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: + """Rename Function + + Renames a function using the function ID Will record name change history + + :param function_id: (required) + :type function_id: int + :param function_rename: (required) + :type function_rename: FunctionRename + :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._rename_function_id_serialize( + function_id=function_id, + function_rename=function_rename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rename_function_id_serialize( + self, + function_id, + function_rename, + _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 function_rename is not None: + _body_params = function_rename + + + # 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/rename/{function_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 revert_function_name( + self, + function_id: StrictInt, + history_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, + ) -> BaseResponse: + """Revert the function name + + Reverts the function name to a previous name using the function ID and history ID + + :param function_id: (required) + :type function_id: int + :param history_id: (required) + :type history_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._revert_function_name_serialize( + function_id=function_id, + history_id=history_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponse", + '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 revert_function_name_with_http_info( + self, + function_id: StrictInt, + history_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[BaseResponse]: + """Revert the function name + + Reverts the function name to a previous name using the function ID and history ID + + :param function_id: (required) + :type function_id: int + :param history_id: (required) + :type history_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._revert_function_name_serialize( + function_id=function_id, + history_id=history_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponse", + '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 revert_function_name_without_preload_content( + self, + function_id: StrictInt, + history_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: + """Revert the function name + + Reverts the function name to a previous name using the function ID and history ID + + :param function_id: (required) + :type function_id: int + :param history_id: (required) + :type history_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._revert_function_name_serialize( + function_id=function_id, + history_id=history_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _revert_function_name_serialize( + self, + function_id, + history_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 + if history_id is not None: + _path_params['history_id'] = history_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/history/{function_id}/{history_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 revert_function_name_0( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + history_id: Annotated[int, Field(strict=True, ge=1, description="History ID to revert to")], + _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, + ) -> RevertOutputBody: + """Revert function name + + Reverts a function's name to a previous value from its history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param history_id: History ID to revert to (required) + :type history_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._revert_function_name_0_serialize( + function_id=function_id, + history_id=history_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': "RevertOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def revert_function_name_0_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + history_id: Annotated[int, Field(strict=True, ge=1, description="History ID to revert to")], + _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[RevertOutputBody]: + """Revert function name + + Reverts a function's name to a previous value from its history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param history_id: History ID to revert to (required) + :type history_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._revert_function_name_0_serialize( + function_id=function_id, + history_id=history_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': "RevertOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def revert_function_name_0_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + history_id: Annotated[int, Field(strict=True, ge=1, description="History ID to revert to")], + _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: + """Revert function name + + Reverts a function's name to a previous value from its history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param history_id: History ID to revert to (required) + :type history_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._revert_function_name_0_serialize( + function_id=function_id, + history_id=history_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': "RevertOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _revert_function_name_0_serialize( + self, + function_id, + history_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 + if history_id is not None: + _path_params['history_id'] = history_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='/v3/functions/{function_id}/history/{history_id}/revert', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/reports_api.py b/revengai/api/reports_api.py index 756b6a5..fe3f95c 100644 --- a/revengai/api/reports_api.py +++ b/revengai/api/reports_api.py @@ -57,7 +57,7 @@ def create_pdf_report( ) -> GeneratePDFOutputBody: """Start PDF report generation - Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. Idempotent: if a workflow is already running for this analysis and user, the same task_id is returned with `already_running: true` so the caller can rejoin the in-flight workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -95,7 +95,6 @@ def create_pdf_report( '202': "GeneratePDFOutputBody", '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -129,7 +128,7 @@ def create_pdf_report_with_http_info( ) -> ApiResponse[GeneratePDFOutputBody]: """Start PDF report generation - Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. Idempotent: if a workflow is already running for this analysis and user, the same task_id is returned with `already_running: true` so the caller can rejoin the in-flight workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -167,7 +166,6 @@ def create_pdf_report_with_http_info( '202': "GeneratePDFOutputBody", '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -201,7 +199,7 @@ def create_pdf_report_without_preload_content( ) -> RESTResponseType: """Start PDF report generation - Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + Starts an asynchronous PDF report generation workflow for the given analysis. Returns a deterministic task_id used to poll status and download the resulting PDF. Idempotent: if a workflow is already running for this analysis and user, the same task_id is returned with `already_running: true` so the caller can rejoin the in-flight workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -239,7 +237,6 @@ def create_pdf_report_without_preload_content( '202': "GeneratePDFOutputBody", '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index 7d9f6a7..930a188 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -120,6 +120,9 @@ from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities from revengai.models.base_response_xref_response import BaseResponseXrefResponse from revengai.models.basic import Basic +from revengai.models.batch_rename_input_body import BatchRenameInputBody +from revengai.models.batch_rename_item import BatchRenameItem +from revengai.models.batch_rename_output_body import BatchRenameOutputBody from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus from revengai.models.binary_additional_details_data_response import BinaryAdditionalDetailsDataResponse @@ -255,6 +258,7 @@ from revengai.models.get_me_response import GetMeResponse from revengai.models.get_public_user_response import GetPublicUserResponse from revengai.models.global_variable import GlobalVariable +from revengai.models.history_entry import HistoryEntry from revengai.models.http_request import HttpRequest from revengai.models.ioc import IOC from revengai.models.isa import ISA @@ -300,11 +304,14 @@ from revengai.models.regenerate_target import RegenerateTarget from revengai.models.registry_operation import RegistryOperation from revengai.models.relative_binary_response import RelativeBinaryResponse +from revengai.models.rename_input_body import RenameInputBody +from revengai.models.rename_output_body import RenameOutputBody from revengai.models.replacement_value import ReplacementValue from revengai.models.report_analysis_response import ReportAnalysisResponse from revengai.models.report_event import ReportEvent from revengai.models.report_info import ReportInfo from revengai.models.report_options import ReportOptions +from revengai.models.revert_output_body import RevertOutputBody from revengai.models.sbom import SBOM from revengai.models.sbom_package import SBOMPackage from revengai.models.sandbox_options import SandboxOptions diff --git a/revengai/models/batch_rename_input_body.py b/revengai/models/batch_rename_input_body.py new file mode 100644 index 0000000..68533dc --- /dev/null +++ b/revengai/models/batch_rename_input_body.py @@ -0,0 +1,117 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.batch_rename_item import BatchRenameItem +from typing import Optional, Set +from typing_extensions import Self + +class BatchRenameInputBody(BaseModel): + """ + BatchRenameInputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + functions: Optional[Annotated[List[BatchRenameItem], Field(min_length=1, max_length=1000)]] = Field(description="List of functions to rename") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "functions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchRenameInputBody 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. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "var_schema", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if functions (nullable) is None + # and model_fields_set contains the field + if self.functions is None and "functions" in self.model_fields_set: + _dict['functions'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchRenameInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$schema": obj.get("$schema"), + "functions": [BatchRenameItem.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_rename_item.py b/revengai/models/batch_rename_item.py new file mode 100644 index 0000000..2abf120 --- /dev/null +++ b/revengai/models/batch_rename_item.py @@ -0,0 +1,104 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class BatchRenameItem(BaseModel): + """ + BatchRenameItem + """ # noqa: E501 + function_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Function ID to rename") + new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="New mangled function name") + new_name: Annotated[str, Field(min_length=1, strict=True, max_length=512)] = Field(description="New function name") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["function_id", "new_mangled_name", "new_name"] + + 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 BatchRenameItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchRenameItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "function_id": obj.get("function_id"), + "new_mangled_name": obj.get("new_mangled_name"), + "new_name": obj.get("new_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_rename_output_body.py b/revengai/models/batch_rename_output_body.py new file mode 100644 index 0000000..340537a --- /dev/null +++ b/revengai/models/batch_rename_output_body.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BatchRenameOutputBody(BaseModel): + """ + BatchRenameOutputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + renamed_count: StrictInt = Field(description="Number of functions renamed") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "renamed_count"] + + 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 BatchRenameOutputBody 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. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "var_schema", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchRenameOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$schema": obj.get("$schema"), + "renamed_count": obj.get("renamed_count") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/history_entry.py b/revengai/models/history_entry.py new file mode 100644 index 0000000..a053593 --- /dev/null +++ b/revengai/models/history_entry.py @@ -0,0 +1,112 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HistoryEntry(BaseModel): + """ + HistoryEntry + """ # noqa: E501 + change_made_by: StrictStr = Field(description="Username of the user who made the change") + created_at: datetime = Field(description="When this name change was recorded") + function_name: StrictStr = Field(description="Function name at this point in history") + history_id: StrictInt = Field(description="History record ID") + is_debug: StrictBool = Field(description="Whether the function had debug info") + mangled_name: Optional[StrictStr] = Field(default=None, description="Mangled function name") + source_type: StrictStr = Field(description="Source of the rename (USER, SYSTEM, AI_UNSTRIP, etc.)") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["change_made_by", "created_at", "function_name", "history_id", "is_debug", "mangled_name", "source_type"] + + 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 HistoryEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HistoryEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "change_made_by": obj.get("change_made_by"), + "created_at": obj.get("created_at"), + "function_name": obj.get("function_name"), + "history_id": obj.get("history_id"), + "is_debug": obj.get("is_debug"), + "mangled_name": obj.get("mangled_name"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/rename_input_body.py b/revengai/models/rename_input_body.py new file mode 100644 index 0000000..a9ce3e1 --- /dev/null +++ b/revengai/models/rename_input_body.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RenameInputBody(BaseModel): + """ + RenameInputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="New mangled function name") + new_name: Annotated[str, Field(min_length=1, strict=True, max_length=512)] = Field(description="New function name") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "new_mangled_name", "new_name"] + + 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 RenameInputBody 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. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "var_schema", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RenameInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$schema": obj.get("$schema"), + "new_mangled_name": obj.get("new_mangled_name"), + "new_name": obj.get("new_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/rename_output_body.py b/revengai/models/rename_output_body.py new file mode 100644 index 0000000..3b6ba53 --- /dev/null +++ b/revengai/models/rename_output_body.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RenameOutputBody(BaseModel): + """ + RenameOutputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + renamed_count: StrictInt = Field(description="Number of functions renamed") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "renamed_count"] + + 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 RenameOutputBody 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. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "var_schema", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RenameOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$schema": obj.get("$schema"), + "renamed_count": obj.get("renamed_count") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/revert_output_body.py b/revengai/models/revert_output_body.py new file mode 100644 index 0000000..806215f --- /dev/null +++ b/revengai/models/revert_output_body.py @@ -0,0 +1,101 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RevertOutputBody(BaseModel): + """ + RevertOutputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema"] + + 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 RevertOutputBody 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. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "var_schema", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RevertOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$schema": obj.get("$schema") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + +