diff --git a/.sdk-version b/.sdk-version index 096c445..8e4ae25 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.81.1 +v3.82.0 diff --git a/README.md b/README.md index 0a7fffd..c648aa9 100644 --- a/README.md +++ b/README.md @@ -113,14 +113,25 @@ Class | Method | HTTP request | Description *ExternalSourcesApi* | [**get_vt_task_status**](docs/ExternalSourcesApi.md#get_vt_task_status) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval *FirmwareApi* | [**get_binaries_for_firmware_task**](docs/FirmwareApi.md#get_binaries_for_firmware_task) | **GET** /v2/firmware/get-binaries/{task_id} | Upload firmware for unpacking *FirmwareApi* | [**upload_firmware**](docs/FirmwareApi.md#upload_firmware) | **POST** /v2/firmware | Upload firmware for unpacking +*FunctionsAIDecompilationApi* | [**create_ai_decompilation**](docs/FunctionsAIDecompilationApi.md#create_ai_decompilation) | **POST** /v3/functions/{function_id}/ai-decompilation | Start AI decompilation *FunctionsAIDecompilationApi* | [**create_ai_decompilation_comment**](docs/FunctionsAIDecompilationApi.md#create_ai_decompilation_comment) | **POST** /v2/functions/{function_id}/ai-decompilation/comments | Create a comment for this function *FunctionsAIDecompilationApi* | [**create_ai_decompilation_task**](docs/FunctionsAIDecompilationApi.md#create_ai_decompilation_task) | **POST** /v2/functions/{function_id}/ai-decompilation | Begins AI Decompilation Process *FunctionsAIDecompilationApi* | [**delete_ai_decompilation_comment**](docs/FunctionsAIDecompilationApi.md#delete_ai_decompilation_comment) | **DELETE** /v2/functions/{function_id}/ai-decompilation/comments/{comment_id} | Delete a comment +*FunctionsAIDecompilationApi* | [**get_ai_decompilation**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation) | **GET** /v3/functions/{function_id}/ai-decompilation | Get AI decompilation result *FunctionsAIDecompilationApi* | [**get_ai_decompilation_comments**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_comments) | **GET** /v2/functions/{function_id}/ai-decompilation/comments | Get comments for this function +*FunctionsAIDecompilationApi* | [**get_ai_decompilation_inline_comments**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_inline_comments) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments | Get AI decompilation inline comments +*FunctionsAIDecompilationApi* | [**get_ai_decompilation_inline_comments_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_inline_comments_status) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments/status | Get inline comments generation workflow status *FunctionsAIDecompilationApi* | [**get_ai_decompilation_rating**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_rating) | **GET** /v2/functions/{function_id}/ai-decompilation/rating | Get rating for AI decompilation +*FunctionsAIDecompilationApi* | [**get_ai_decompilation_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_status) | **GET** /v3/functions/{function_id}/ai-decompilation/status | Get AI decompilation workflow status +*FunctionsAIDecompilationApi* | [**get_ai_decompilation_summary**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_summary) | **GET** /v3/functions/{function_id}/ai-decompilation/summary | Get AI decompilation summary +*FunctionsAIDecompilationApi* | [**get_ai_decompilation_summary_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_summary_status) | **GET** /v3/functions/{function_id}/ai-decompilation/summary/status | Get summary generation workflow status *FunctionsAIDecompilationApi* | [**get_ai_decompilation_task_result**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_task_result) | **GET** /v2/functions/{function_id}/ai-decompilation | Polls AI Decompilation Process *FunctionsAIDecompilationApi* | [**get_ai_decompilation_task_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_task_status) | **GET** /v2/functions/{function_id}/ai-decompilation/status | Check the status of a function ai decompilation +*FunctionsAIDecompilationApi* | [**get_ai_decompilation_tokenised**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_tokenised) | **GET** /v3/functions/{function_id}/ai-decompilation/tokenised | Get tokenised AI decompilation with function mapping +*FunctionsAIDecompilationApi* | [**regenerate_ai_decompilation_inline_comments**](docs/FunctionsAIDecompilationApi.md#regenerate_ai_decompilation_inline_comments) | **POST** /v3/functions/{function_id}/ai-decompilation/inline-comments | Regenerate AI decompilation inline comments +*FunctionsAIDecompilationApi* | [**regenerate_ai_decompilation_summary**](docs/FunctionsAIDecompilationApi.md#regenerate_ai_decompilation_summary) | **POST** /v3/functions/{function_id}/ai-decompilation/summary | Regenerate AI decompilation summary *FunctionsAIDecompilationApi* | [**update_ai_decompilation_comment**](docs/FunctionsAIDecompilationApi.md#update_ai_decompilation_comment) | **PATCH** /v2/functions/{function_id}/ai-decompilation/comments/{comment_id} | Update a comment +*FunctionsAIDecompilationApi* | [**upsert_ai_decompilation_overrides**](docs/FunctionsAIDecompilationApi.md#upsert_ai_decompilation_overrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides *FunctionsAIDecompilationApi* | [**upsert_ai_decompilation_rating**](docs/FunctionsAIDecompilationApi.md#upsert_ai_decompilation_rating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation *FunctionsCoreApi* | [**ai_unstrip**](docs/FunctionsCoreApi.md#ai_unstrip) | **POST** /v2/analyses/{analysis_id}/functions/ai-unstrip | Performs matching and auto-unstrip for an analysis and its functions *FunctionsCoreApi* | [**analysis_function_matching**](docs/FunctionsCoreApi.md#analysis_function_matching) | **POST** /v2/analyses/{analysis_id}/functions/matches | Perform matching for the functions of an analysis @@ -297,6 +308,7 @@ Class | Method | HTTP request | Description - [CommentBase](docs/CommentBase.md) - [CommentResponse](docs/CommentResponse.md) - [CommentUpdateRequest](docs/CommentUpdateRequest.md) + - [CommentsData](docs/CommentsData.md) - [ConfigResponse](docs/ConfigResponse.md) - [ConfirmToolInputBody](docs/ConfirmToolInputBody.md) - [Connection](docs/Connection.md) @@ -304,9 +316,11 @@ Class | Method | HTTP request | Description - [Conversation](docs/Conversation.md) - [ConversationContext](docs/ConversationContext.md) - [ConversationWithEvents](docs/ConversationWithEvents.md) + - [CreateAIDecompOutputBody](docs/CreateAIDecompOutputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) - [Created](docs/Created.md) - [DecompilationCommentContext](docs/DecompilationCommentContext.md) + - [DecompilationData](docs/DecompilationData.md) - [DieMatch](docs/DieMatch.md) - [DnsQuery](docs/DnsQuery.md) - [DrakvufFileMetadata](docs/DrakvufFileMetadata.md) @@ -399,6 +413,7 @@ Class | Method | HTTP request | Description - [ISA](docs/ISA.md) - [IconModel](docs/IconModel.md) - [ImportModel](docs/ImportModel.md) + - [InlineComment](docs/InlineComment.md) - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) - [InverseFunctionMapItem](docs/InverseFunctionMapItem.md) - [InverseStringMapItem](docs/InverseStringMapItem.md) @@ -417,6 +432,7 @@ Class | Method | HTTP request | Description - [NameConfidence](docs/NameConfidence.md) - [NameSourceType](docs/NameSourceType.md) - [NetworkActivity](docs/NetworkActivity.md) + - [NumericAddr](docs/NumericAddr.md) - [Order](docs/Order.md) - [PDBDebugModel](docs/PDBDebugModel.md) - [PEModel](docs/PEModel.md) @@ -427,14 +443,17 @@ Class | Method | HTTP request | Description - [ProcessMemdumps](docs/ProcessMemdumps.md) - [ProcessNode](docs/ProcessNode.md) - [ProcessTree](docs/ProcessTree.md) + - [ProgressMessage](docs/ProgressMessage.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) - [QueuePositionResponse](docs/QueuePositionResponse.md) - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) - [ReAnalysisForm](docs/ReAnalysisForm.md) - [Recent](docs/Recent.md) + - [RegenerateOutputBody](docs/RegenerateOutputBody.md) - [RegenerateTarget](docs/RegenerateTarget.md) - [RegistryOperation](docs/RegistryOperation.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) + - [ReplacementValue](docs/ReplacementValue.md) - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) - [ReportEvent](docs/ReportEvent.md) - [ReportInfo](docs/ReportInfo.md) @@ -482,6 +501,7 @@ Class | Method | HTTP request | Description - [Structure](docs/Structure.md) - [StructureMember](docs/StructureMember.md) - [SubmitUserFeedbackRequest](docs/SubmitUserFeedbackRequest.md) + - [SummaryData](docs/SummaryData.md) - [Symbols](docs/Symbols.md) - [Tag](docs/Tag.md) - [TagItem](docs/TagItem.md) @@ -492,6 +512,7 @@ Class | Method | HTTP request | Description - [TaskStatus](docs/TaskStatus.md) - [TaskStatusResponse](docs/TaskStatusResponse.md) - [TimestampModel](docs/TimestampModel.md) + - [TokenisedData](docs/TokenisedData.md) - [TriageFunctionResponse](docs/TriageFunctionResponse.md) - [TriageReportResponse](docs/TriageReportResponse.md) - [Ttp](docs/Ttp.md) @@ -500,9 +521,12 @@ Class | Method | HTTP request | Description - [UploadFileType](docs/UploadFileType.md) - [UploadResponse](docs/UploadResponse.md) - [UpsertAiDecomplationRatingRequest](docs/UpsertAiDecomplationRatingRequest.md) + - [UpsertOverridesData](docs/UpsertOverridesData.md) + - [UpsertOverridesInputBody](docs/UpsertOverridesInputBody.md) - [UserActivityResponse](docs/UserActivityResponse.md) - [Vulnerabilities](docs/Vulnerabilities.md) - [Vulnerability](docs/Vulnerability.md) + - [WorkflowProgress](docs/WorkflowProgress.md) - [Workspace](docs/Workspace.md) - [XrefFromResponse](docs/XrefFromResponse.md) - [XrefResponse](docs/XrefResponse.md) diff --git a/docs/CommentsData.md b/docs/CommentsData.md new file mode 100644 index 0000000..3bfffa2 --- /dev/null +++ b/docs/CommentsData.md @@ -0,0 +1,31 @@ +# CommentsData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**inline_comments** | [**List[InlineComment]**](InlineComment.md) | Structured inline comments with line numbers | +**task_status** | **str** | Task status | + +## Example + +```python +from revengai.models.comments_data import CommentsData + +# TODO update the JSON string below +json = "{}" +# create an instance of CommentsData from a JSON string +comments_data_instance = CommentsData.from_json(json) +# print the JSON string representation of the object +print(CommentsData.to_json()) + +# convert the object into a dict +comments_data_dict = comments_data_instance.to_dict() +# create an instance of CommentsData from a dict +comments_data_from_dict = CommentsData.from_dict(comments_data_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/CreateAIDecompOutputBody.md b/docs/CreateAIDecompOutputBody.md new file mode 100644 index 0000000..ad46330 --- /dev/null +++ b/docs/CreateAIDecompOutputBody.md @@ -0,0 +1,30 @@ +# CreateAIDecompOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**status** | **bool** | | + +## Example + +```python +from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAIDecompOutputBody from a JSON string +create_ai_decomp_output_body_instance = CreateAIDecompOutputBody.from_json(json) +# print the JSON string representation of the object +print(CreateAIDecompOutputBody.to_json()) + +# convert the object into a dict +create_ai_decomp_output_body_dict = create_ai_decomp_output_body_instance.to_dict() +# create an instance of CreateAIDecompOutputBody from a dict +create_ai_decomp_output_body_from_dict = CreateAIDecompOutputBody.from_dict(create_ai_decomp_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/DecompilationData.md b/docs/DecompilationData.md new file mode 100644 index 0000000..7ac4ee9 --- /dev/null +++ b/docs/DecompilationData.md @@ -0,0 +1,31 @@ +# DecompilationData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**decompilation** | **str** | Source code with placeholders replaced | [optional] +**status** | **str** | Task status | + +## Example + +```python +from revengai.models.decompilation_data import DecompilationData + +# TODO update the JSON string below +json = "{}" +# create an instance of DecompilationData from a JSON string +decompilation_data_instance = DecompilationData.from_json(json) +# print the JSON string representation of the object +print(DecompilationData.to_json()) + +# convert the object into a dict +decompilation_data_dict = decompilation_data_instance.to_dict() +# create an instance of DecompilationData from a dict +decompilation_data_from_dict = DecompilationData.from_dict(decompilation_data_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/FunctionsAIDecompilationApi.md b/docs/FunctionsAIDecompilationApi.md index 1a292d1..05840c5 100644 --- a/docs/FunctionsAIDecompilationApi.md +++ b/docs/FunctionsAIDecompilationApi.md @@ -4,17 +4,119 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**create_ai_decompilation**](FunctionsAIDecompilationApi.md#create_ai_decompilation) | **POST** /v3/functions/{function_id}/ai-decompilation | Start AI decompilation [**create_ai_decompilation_comment**](FunctionsAIDecompilationApi.md#create_ai_decompilation_comment) | **POST** /v2/functions/{function_id}/ai-decompilation/comments | Create a comment for this function [**create_ai_decompilation_task**](FunctionsAIDecompilationApi.md#create_ai_decompilation_task) | **POST** /v2/functions/{function_id}/ai-decompilation | Begins AI Decompilation Process [**delete_ai_decompilation_comment**](FunctionsAIDecompilationApi.md#delete_ai_decompilation_comment) | **DELETE** /v2/functions/{function_id}/ai-decompilation/comments/{comment_id} | Delete a comment +[**get_ai_decompilation**](FunctionsAIDecompilationApi.md#get_ai_decompilation) | **GET** /v3/functions/{function_id}/ai-decompilation | Get AI decompilation result [**get_ai_decompilation_comments**](FunctionsAIDecompilationApi.md#get_ai_decompilation_comments) | **GET** /v2/functions/{function_id}/ai-decompilation/comments | Get comments for this function +[**get_ai_decompilation_inline_comments**](FunctionsAIDecompilationApi.md#get_ai_decompilation_inline_comments) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments | Get AI decompilation inline comments +[**get_ai_decompilation_inline_comments_status**](FunctionsAIDecompilationApi.md#get_ai_decompilation_inline_comments_status) | **GET** /v3/functions/{function_id}/ai-decompilation/inline-comments/status | Get inline comments generation workflow status [**get_ai_decompilation_rating**](FunctionsAIDecompilationApi.md#get_ai_decompilation_rating) | **GET** /v2/functions/{function_id}/ai-decompilation/rating | Get rating for AI decompilation +[**get_ai_decompilation_status**](FunctionsAIDecompilationApi.md#get_ai_decompilation_status) | **GET** /v3/functions/{function_id}/ai-decompilation/status | Get AI decompilation workflow status +[**get_ai_decompilation_summary**](FunctionsAIDecompilationApi.md#get_ai_decompilation_summary) | **GET** /v3/functions/{function_id}/ai-decompilation/summary | Get AI decompilation summary +[**get_ai_decompilation_summary_status**](FunctionsAIDecompilationApi.md#get_ai_decompilation_summary_status) | **GET** /v3/functions/{function_id}/ai-decompilation/summary/status | Get summary generation workflow status [**get_ai_decompilation_task_result**](FunctionsAIDecompilationApi.md#get_ai_decompilation_task_result) | **GET** /v2/functions/{function_id}/ai-decompilation | Polls AI Decompilation Process [**get_ai_decompilation_task_status**](FunctionsAIDecompilationApi.md#get_ai_decompilation_task_status) | **GET** /v2/functions/{function_id}/ai-decompilation/status | Check the status of a function ai decompilation +[**get_ai_decompilation_tokenised**](FunctionsAIDecompilationApi.md#get_ai_decompilation_tokenised) | **GET** /v3/functions/{function_id}/ai-decompilation/tokenised | Get tokenised AI decompilation with function mapping +[**regenerate_ai_decompilation_inline_comments**](FunctionsAIDecompilationApi.md#regenerate_ai_decompilation_inline_comments) | **POST** /v3/functions/{function_id}/ai-decompilation/inline-comments | Regenerate AI decompilation inline comments +[**regenerate_ai_decompilation_summary**](FunctionsAIDecompilationApi.md#regenerate_ai_decompilation_summary) | **POST** /v3/functions/{function_id}/ai-decompilation/summary | Regenerate AI decompilation summary [**update_ai_decompilation_comment**](FunctionsAIDecompilationApi.md#update_ai_decompilation_comment) | **PATCH** /v2/functions/{function_id}/ai-decompilation/comments/{comment_id} | Update a comment +[**upsert_ai_decompilation_overrides**](FunctionsAIDecompilationApi.md#upsert_ai_decompilation_overrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides [**upsert_ai_decompilation_rating**](FunctionsAIDecompilationApi.md#upsert_ai_decompilation_rating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation +# **create_ai_decompilation** +> CreateAIDecompOutputBody create_ai_decompilation(function_id, context_aware=context_aware) + +Start AI decompilation + +Begins the AI decompilation process for a function. Charges team credits and starts the workflow. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + context_aware = False # bool | Use context-aware decompilation (optional) (default to False) + + try: + # Start AI decompilation + api_response = api_instance.create_ai_decompilation(function_id, context_aware=context_aware) + print("The response of FunctionsAIDecompilationApi->create_ai_decompilation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->create_ai_decompilation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **context_aware** | **bool**| Use context-aware decompilation | [optional] [default to False] + +### Return type + +[**CreateAIDecompOutputBody**](CreateAIDecompOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_ai_decompilation_comment** > BaseResponseCommentResponse create_ai_decompilation_comment(function_id, function_comment_create_request) @@ -267,6 +369,94 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_ai_decompilation** +> DecompilationData get_ai_decompilation(function_id) + +Get AI decompilation result + +Returns the decompilation source code. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.decompilation_data import DecompilationData +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get AI decompilation result + api_response = api_instance.get_ai_decompilation(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**DecompilationData**](DecompilationData.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_ai_decompilation_comments** > BaseResponseListCommentResponse get_ai_decompilation_comments(function_id) @@ -347,10 +537,16 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_ai_decompilation_rating** -> BaseResponseUnionGetAiDecompilationRatingResponseNoneType get_ai_decompilation_rating(function_id) +# **get_ai_decompilation_inline_comments** +> CommentsData get_ai_decompilation_inline_comments(function_id) -Get rating for AI decompilation +Get AI decompilation inline comments + +Returns the commented source if available. Returns pending status if comments are still being generated. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example @@ -358,7 +554,7 @@ Get rating for AI decompilation ```python import revengai -from revengai.models.base_response_union_get_ai_decompilation_rating_response_none_type import BaseResponseUnionGetAiDecompilationRatingResponseNoneType +from revengai.models.comments_data import CommentsData from revengai.rest import ApiException from pprint import pprint @@ -383,15 +579,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) - function_id = 56 # int | The ID of the function for which to get the rating + function_id = 56 # int | Function ID try: - # Get rating for AI decompilation - api_response = api_instance.get_ai_decompilation_rating(function_id) - print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_rating:\n") + # Get AI decompilation inline comments + api_response = api_instance.get_ai_decompilation_inline_comments(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_inline_comments:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_rating: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_inline_comments: %s\n" % e) ``` @@ -401,11 +597,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_id** | **int**| The ID of the function for which to get the rating | + **function_id** | **int**| Function ID | ### Return type -[**BaseResponseUnionGetAiDecompilationRatingResponseNoneType**](BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md) +[**CommentsData**](CommentsData.md) ### Authorization @@ -420,17 +616,24 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | +**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_ai_decompilation_task_result** -> BaseResponseGetAiDecompilationTask get_ai_decompilation_task_result(function_id, summarise=summarise, generate_inline_comments=generate_inline_comments, force_regenerate=force_regenerate) +# **get_ai_decompilation_inline_comments_status** +> WorkflowProgress get_ai_decompilation_inline_comments_status(function_id) -Polls AI Decompilation Process +Get inline comments generation workflow status -Polls the AI Decompilation Process +Returns fine-grained progress of the inline comments generation workflow. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example @@ -438,8 +641,7 @@ Polls the AI Decompilation Process ```python import revengai -from revengai.models.base_response_get_ai_decompilation_task import BaseResponseGetAiDecompilationTask -from revengai.models.regenerate_target import RegenerateTarget +from revengai.models.workflow_progress import WorkflowProgress from revengai.rest import ApiException from pprint import pprint @@ -464,18 +666,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) - function_id = 56 # int | The ID of the function being decompiled - summarise = True # bool | Generate a summary for the decompilation (optional) (default to True) - generate_inline_comments = True # bool | Generate inline comments for the decompilation (optional) (default to True) - force_regenerate = [] # List[RegenerateTarget] | Force regeneration of summary and/or comments. (optional) (default to []) + function_id = 56 # int | Function ID try: - # Polls AI Decompilation Process - api_response = api_instance.get_ai_decompilation_task_result(function_id, summarise=summarise, generate_inline_comments=generate_inline_comments, force_regenerate=force_regenerate) - print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_task_result:\n") + # Get inline comments generation workflow status + api_response = api_instance.get_ai_decompilation_inline_comments_status(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_inline_comments_status:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_task_result: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_inline_comments_status: %s\n" % e) ``` @@ -485,14 +684,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_id** | **int**| The ID of the function being decompiled | - **summarise** | **bool**| Generate a summary for the decompilation | [optional] [default to True] - **generate_inline_comments** | **bool**| Generate inline comments for the decompilation | [optional] [default to True] - **force_regenerate** | [**List[RegenerateTarget]**](RegenerateTarget.md)| Force regeneration of summary and/or comments. | [optional] [default to []] + **function_id** | **int**| Function ID | ### Return type -[**BaseResponseGetAiDecompilationTask**](BaseResponseGetAiDecompilationTask.md) +[**WorkflowProgress**](WorkflowProgress.md) ### Authorization @@ -507,16 +703,18 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | +**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_ai_decompilation_task_status** -> BaseResponseFunctionTaskResponse get_ai_decompilation_task_status(function_id) +# **get_ai_decompilation_rating** +> BaseResponseUnionGetAiDecompilationRatingResponseNoneType get_ai_decompilation_rating(function_id) -Check the status of a function ai decompilation +Get rating for AI decompilation ### Example @@ -524,7 +722,7 @@ Check the status of a function ai decompilation ```python import revengai -from revengai.models.base_response_function_task_response import BaseResponseFunctionTaskResponse +from revengai.models.base_response_union_get_ai_decompilation_rating_response_none_type import BaseResponseUnionGetAiDecompilationRatingResponseNoneType from revengai.rest import ApiException from pprint import pprint @@ -549,15 +747,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) - function_id = 56 # int | The ID of the function being checked + function_id = 56 # int | The ID of the function for which to get the rating try: - # Check the status of a function ai decompilation - api_response = api_instance.get_ai_decompilation_task_status(function_id) - print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_task_status:\n") + # Get rating for AI decompilation + api_response = api_instance.get_ai_decompilation_rating(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_rating:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_task_status: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_rating: %s\n" % e) ``` @@ -567,11 +765,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_id** | **int**| The ID of the function being checked | + **function_id** | **int**| The ID of the function for which to get the rating | ### Return type -[**BaseResponseFunctionTaskResponse**](BaseResponseFunctionTaskResponse.md) +[**BaseResponseUnionGetAiDecompilationRatingResponseNoneType**](BaseResponseUnionGetAiDecompilationRatingResponseNoneType.md) ### Authorization @@ -591,12 +789,16 @@ 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) -# **update_ai_decompilation_comment** -> BaseResponseCommentResponse update_ai_decompilation_comment(comment_id, function_id, comment_update_request) +# **get_ai_decompilation_status** +> WorkflowProgress get_ai_decompilation_status(function_id) -Update a comment +Get AI decompilation workflow status -Updates the content of an existing comment. Users can only update their own comments. +Returns fine-grained progress of the running workflow including current step, total steps, and messages. Falls back to the database task status when no workflow is running. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example @@ -604,8 +806,7 @@ Updates the content of an existing comment. Users can only update their own comm ```python import revengai -from revengai.models.base_response_comment_response import BaseResponseCommentResponse -from revengai.models.comment_update_request import CommentUpdateRequest +from revengai.models.workflow_progress import WorkflowProgress from revengai.rest import ApiException from pprint import pprint @@ -630,17 +831,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) - comment_id = 56 # int | - function_id = 56 # int | - comment_update_request = revengai.CommentUpdateRequest() # CommentUpdateRequest | + function_id = 56 # int | Function ID try: - # Update a comment - api_response = api_instance.update_ai_decompilation_comment(comment_id, function_id, comment_update_request) - print("The response of FunctionsAIDecompilationApi->update_ai_decompilation_comment:\n") + # Get AI decompilation workflow status + api_response = api_instance.get_ai_decompilation_status(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_status:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->update_ai_decompilation_comment: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_status: %s\n" % e) ``` @@ -650,13 +849,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **comment_id** | **int**| | - **function_id** | **int**| | - **comment_update_request** | [**CommentUpdateRequest**](CommentUpdateRequest.md)| | + **function_id** | **int**| Function ID | ### Return type -[**BaseResponseCommentResponse**](BaseResponseCommentResponse.md) +[**WorkflowProgress**](WorkflowProgress.md) ### Authorization @@ -664,17 +861,799 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | -**403** | You can only update your own comments | - | -**400** | Bad Request | - | +**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_ai_decompilation_summary** +> SummaryData get_ai_decompilation_summary(function_id) + +Get AI decompilation summary + +Returns the summary if available. Returns pending status if summary is still being generated. + +**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.summary_data import SummaryData +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get AI decompilation summary + api_response = api_instance.get_ai_decompilation_summary(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_summary: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**SummaryData**](SummaryData.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_ai_decompilation_summary_status** +> WorkflowProgress get_ai_decompilation_summary_status(function_id) + +Get summary generation workflow status + +Returns fine-grained progress of the summary generation workflow. + +**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.workflow_progress import WorkflowProgress +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get summary generation workflow status + api_response = api_instance.get_ai_decompilation_summary_status(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_summary_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_summary_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**WorkflowProgress**](WorkflowProgress.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_ai_decompilation_task_result** +> BaseResponseGetAiDecompilationTask get_ai_decompilation_task_result(function_id, summarise=summarise, generate_inline_comments=generate_inline_comments, force_regenerate=force_regenerate) + +Polls AI Decompilation Process + +Polls the AI Decompilation Process + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_get_ai_decompilation_task import BaseResponseGetAiDecompilationTask +from revengai.models.regenerate_target import RegenerateTarget +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | The ID of the function being decompiled + summarise = True # bool | Generate a summary for the decompilation (optional) (default to True) + generate_inline_comments = True # bool | Generate inline comments for the decompilation (optional) (default to True) + force_regenerate = [] # List[RegenerateTarget] | Force regeneration of summary and/or comments. (optional) (default to []) + + try: + # Polls AI Decompilation Process + api_response = api_instance.get_ai_decompilation_task_result(function_id, summarise=summarise, generate_inline_comments=generate_inline_comments, force_regenerate=force_regenerate) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_task_result:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_task_result: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| The ID of the function being decompiled | + **summarise** | **bool**| Generate a summary for the decompilation | [optional] [default to True] + **generate_inline_comments** | **bool**| Generate inline comments for the decompilation | [optional] [default to True] + **force_regenerate** | [**List[RegenerateTarget]**](RegenerateTarget.md)| Force regeneration of summary and/or comments. | [optional] [default to []] + +### Return type + +[**BaseResponseGetAiDecompilationTask**](BaseResponseGetAiDecompilationTask.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | +**403** | Forbidden | - | + +[[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_ai_decompilation_task_status** +> BaseResponseFunctionTaskResponse get_ai_decompilation_task_status(function_id) + +Check the status of a function ai decompilation + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_function_task_response import BaseResponseFunctionTaskResponse +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | The ID of the function being checked + + try: + # Check the status of a function ai decompilation + api_response = api_instance.get_ai_decompilation_task_status(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_task_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_task_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| The ID of the function being checked | + +### Return type + +[**BaseResponseFunctionTaskResponse**](BaseResponseFunctionTaskResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_ai_decompilation_tokenised** +> TokenisedData get_ai_decompilation_tokenised(function_id) + +Get tokenised AI decompilation with function mapping + +Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.tokenised_data import TokenisedData +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get tokenised AI decompilation with function mapping + api_response = api_instance.get_ai_decompilation_tokenised(function_id) + print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_tokenised:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_tokenised: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**TokenisedData**](TokenisedData.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) + +# **regenerate_ai_decompilation_inline_comments** +> RegenerateOutputBody regenerate_ai_decompilation_inline_comments(function_id) + +Regenerate AI decompilation inline comments + +Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. + +**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.regenerate_output_body import RegenerateOutputBody +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + + try: + # Regenerate AI decompilation inline comments + api_response = api_instance.regenerate_ai_decompilation_inline_comments(function_id) + print("The response of FunctionsAIDecompilationApi->regenerate_ai_decompilation_inline_comments:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->regenerate_ai_decompilation_inline_comments: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**RegenerateOutputBody**](RegenerateOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**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) + +# **regenerate_ai_decompilation_summary** +> RegenerateOutputBody regenerate_ai_decompilation_summary(function_id) + +Regenerate AI decompilation summary + +Starts a new summary generation workflow for the function. Requires an existing decompilation. + +**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.regenerate_output_body import RegenerateOutputBody +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + + try: + # Regenerate AI decompilation summary + api_response = api_instance.regenerate_ai_decompilation_summary(function_id) + print("The response of FunctionsAIDecompilationApi->regenerate_ai_decompilation_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->regenerate_ai_decompilation_summary: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**RegenerateOutputBody**](RegenerateOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**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) + +# **update_ai_decompilation_comment** +> BaseResponseCommentResponse update_ai_decompilation_comment(comment_id, function_id, comment_update_request) + +Update a comment + +Updates the content of an existing comment. Users can only update their own comments. + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_comment_response import BaseResponseCommentResponse +from revengai.models.comment_update_request import CommentUpdateRequest +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsAIDecompilationApi(api_client) + comment_id = 56 # int | + function_id = 56 # int | + comment_update_request = revengai.CommentUpdateRequest() # CommentUpdateRequest | + + try: + # Update a comment + api_response = api_instance.update_ai_decompilation_comment(comment_id, function_id, comment_update_request) + print("The response of FunctionsAIDecompilationApi->update_ai_decompilation_comment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->update_ai_decompilation_comment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **comment_id** | **int**| | + **function_id** | **int**| | + **comment_update_request** | [**CommentUpdateRequest**](CommentUpdateRequest.md)| | + +### Return type + +[**BaseResponseCommentResponse**](BaseResponseCommentResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | +**403** | You can only update your own comments | - | +**400** | Bad Request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upsert_ai_decompilation_overrides** +> UpsertOverridesData upsert_ai_decompilation_overrides(function_id, upsert_overrides_input_body) + +Upsert variable/function name overrides + +Applies user-provided name overrides to placeholder tokens in the decompilation. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.upsert_overrides_data import UpsertOverridesData +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody +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.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + upsert_overrides_input_body = revengai.UpsertOverridesInputBody() # UpsertOverridesInputBody | + + try: + # Upsert variable/function name overrides + api_response = api_instance.upsert_ai_decompilation_overrides(function_id, upsert_overrides_input_body) + print("The response of FunctionsAIDecompilationApi->upsert_ai_decompilation_overrides:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->upsert_ai_decompilation_overrides: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **upsert_overrides_input_body** | [**UpsertOverridesInputBody**](UpsertOverridesInputBody.md)| | + +### Return type + +[**UpsertOverridesData**](UpsertOverridesData.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 | - | +**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/InlineComment.md b/docs/InlineComment.md new file mode 100644 index 0000000..79e5b73 --- /dev/null +++ b/docs/InlineComment.md @@ -0,0 +1,30 @@ +# InlineComment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **str** | | +**line** | **int** | | + +## Example + +```python +from revengai.models.inline_comment import InlineComment + +# TODO update the JSON string below +json = "{}" +# create an instance of InlineComment from a JSON string +inline_comment_instance = InlineComment.from_json(json) +# print the JSON string representation of the object +print(InlineComment.to_json()) + +# convert the object into a dict +inline_comment_dict = inline_comment_instance.to_dict() +# create an instance of InlineComment from a dict +inline_comment_from_dict = InlineComment.from_dict(inline_comment_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/NumericAddr.md b/docs/NumericAddr.md new file mode 100644 index 0000000..0bf79c3 --- /dev/null +++ b/docs/NumericAddr.md @@ -0,0 +1,29 @@ +# NumericAddr + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | + +## Example + +```python +from revengai.models.numeric_addr import NumericAddr + +# TODO update the JSON string below +json = "{}" +# create an instance of NumericAddr from a JSON string +numeric_addr_instance = NumericAddr.from_json(json) +# print the JSON string representation of the object +print(NumericAddr.to_json()) + +# convert the object into a dict +numeric_addr_dict = numeric_addr_instance.to_dict() +# create an instance of NumericAddr from a dict +numeric_addr_from_dict = NumericAddr.from_dict(numeric_addr_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/ProgressMessage.md b/docs/ProgressMessage.md new file mode 100644 index 0000000..e17dccb --- /dev/null +++ b/docs/ProgressMessage.md @@ -0,0 +1,32 @@ +# ProgressMessage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**level** | **str** | Severity level | +**step** | **str** | Step name when the message was emitted | +**text** | **str** | Message text | +**timestamp** | **datetime** | When the message was emitted | + +## Example + +```python +from revengai.models.progress_message import ProgressMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of ProgressMessage from a JSON string +progress_message_instance = ProgressMessage.from_json(json) +# print the JSON string representation of the object +print(ProgressMessage.to_json()) + +# convert the object into a dict +progress_message_dict = progress_message_instance.to_dict() +# create an instance of ProgressMessage from a dict +progress_message_from_dict = ProgressMessage.from_dict(progress_message_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RegenerateOutputBody.md b/docs/RegenerateOutputBody.md new file mode 100644 index 0000000..2cb8e95 --- /dev/null +++ b/docs/RegenerateOutputBody.md @@ -0,0 +1,30 @@ +# RegenerateOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**status** | **bool** | | + +## Example + +```python +from revengai.models.regenerate_output_body import RegenerateOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RegenerateOutputBody from a JSON string +regenerate_output_body_instance = RegenerateOutputBody.from_json(json) +# print the JSON string representation of the object +print(RegenerateOutputBody.to_json()) + +# convert the object into a dict +regenerate_output_body_dict = regenerate_output_body_instance.to_dict() +# create an instance of RegenerateOutputBody from a dict +regenerate_output_body_from_dict = RegenerateOutputBody.from_dict(regenerate_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/ReplacementValue.md b/docs/ReplacementValue.md new file mode 100644 index 0000000..c2e0673 --- /dev/null +++ b/docs/ReplacementValue.md @@ -0,0 +1,29 @@ +# ReplacementValue + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | + +## Example + +```python +from revengai.models.replacement_value import ReplacementValue + +# TODO update the JSON string below +json = "{}" +# create an instance of ReplacementValue from a JSON string +replacement_value_instance = ReplacementValue.from_json(json) +# print the JSON string representation of the object +print(ReplacementValue.to_json()) + +# convert the object into a dict +replacement_value_dict = replacement_value_instance.to_dict() +# create an instance of ReplacementValue from a dict +replacement_value_from_dict = ReplacementValue.from_dict(replacement_value_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/SummaryData.md b/docs/SummaryData.md new file mode 100644 index 0000000..33a0162 --- /dev/null +++ b/docs/SummaryData.md @@ -0,0 +1,32 @@ +# SummaryData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**ai_summary** | **str** | Summary with code tags removed | +**summary** | **str** | Raw summary from the model | +**task_status** | **str** | Task status | + +## Example + +```python +from revengai.models.summary_data import SummaryData + +# TODO update the JSON string below +json = "{}" +# create an instance of SummaryData from a JSON string +summary_data_instance = SummaryData.from_json(json) +# print the JSON string representation of the object +print(SummaryData.to_json()) + +# convert the object into a dict +summary_data_dict = summary_data_instance.to_dict() +# create an instance of SummaryData from a dict +summary_data_from_dict = SummaryData.from_dict(summary_data_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/TokenisedData.md b/docs/TokenisedData.md new file mode 100644 index 0000000..3aff4db --- /dev/null +++ b/docs/TokenisedData.md @@ -0,0 +1,33 @@ +# TokenisedData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**function_mapping** | [**FunctionMapping**](FunctionMapping.md) | Complete mapping data for token resolution | [optional] +**predicted_function_name** | **str** | Predicted function name from the AI model | [optional] +**status** | **str** | Task status | +**tokenised_decompilation** | **str** | Source code with placeholder tokens | [optional] + +## Example + +```python +from revengai.models.tokenised_data import TokenisedData + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenisedData from a JSON string +tokenised_data_instance = TokenisedData.from_json(json) +# print the JSON string representation of the object +print(TokenisedData.to_json()) + +# convert the object into a dict +tokenised_data_dict = tokenised_data_instance.to_dict() +# create an instance of TokenisedData from a dict +tokenised_data_from_dict = TokenisedData.from_dict(tokenised_data_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/UpsertOverridesData.md b/docs/UpsertOverridesData.md new file mode 100644 index 0000000..c8251ae --- /dev/null +++ b/docs/UpsertOverridesData.md @@ -0,0 +1,30 @@ +# UpsertOverridesData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**user_override_mappings** | **Dict[str, str]** | Merged override mappings after applying changes | + +## Example + +```python +from revengai.models.upsert_overrides_data import UpsertOverridesData + +# TODO update the JSON string below +json = "{}" +# create an instance of UpsertOverridesData from a JSON string +upsert_overrides_data_instance = UpsertOverridesData.from_json(json) +# print the JSON string representation of the object +print(UpsertOverridesData.to_json()) + +# convert the object into a dict +upsert_overrides_data_dict = upsert_overrides_data_instance.to_dict() +# create an instance of UpsertOverridesData from a dict +upsert_overrides_data_from_dict = UpsertOverridesData.from_dict(upsert_overrides_data_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/UpsertOverridesInputBody.md b/docs/UpsertOverridesInputBody.md new file mode 100644 index 0000000..97da860 --- /dev/null +++ b/docs/UpsertOverridesInputBody.md @@ -0,0 +1,30 @@ +# UpsertOverridesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**overrides** | **Dict[str, str]** | Token to name mappings. Empty string removes the override. | + +## Example + +```python +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpsertOverridesInputBody from a JSON string +upsert_overrides_input_body_instance = UpsertOverridesInputBody.from_json(json) +# print the JSON string representation of the object +print(UpsertOverridesInputBody.to_json()) + +# convert the object into a dict +upsert_overrides_input_body_dict = upsert_overrides_input_body_instance.to_dict() +# create an instance of UpsertOverridesInputBody from a dict +upsert_overrides_input_body_from_dict = UpsertOverridesInputBody.from_dict(upsert_overrides_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/WorkflowProgress.md b/docs/WorkflowProgress.md new file mode 100644 index 0000000..e74888d --- /dev/null +++ b/docs/WorkflowProgress.md @@ -0,0 +1,34 @@ +# WorkflowProgress + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | A URL to the JSON Schema for this object. | [optional] [readonly] +**messages** | [**List[ProgressMessage]**](ProgressMessage.md) | Log messages emitted during execution | +**status** | **str** | Current workflow status | +**step** | **str** | Name of the current step | +**step_index** | **int** | Zero-based index of the current step | +**steps_total** | **int** | Total number of steps in the workflow | + +## Example + +```python +from revengai.models.workflow_progress import WorkflowProgress + +# TODO update the JSON string below +json = "{}" +# create an instance of WorkflowProgress from a JSON string +workflow_progress_instance = WorkflowProgress.from_json(json) +# print the JSON string representation of the object +print(WorkflowProgress.to_json()) + +# convert the object into a dict +workflow_progress_dict = workflow_progress_instance.to_dict() +# create an instance of WorkflowProgress from a dict +workflow_progress_from_dict = WorkflowProgress.from_dict(workflow_progress_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 0e9f6be..3410363 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.81.1" +__version__ = "v3.82.0" # Define package exports __all__ = [ @@ -187,6 +187,7 @@ "CommentBase", "CommentResponse", "CommentUpdateRequest", + "CommentsData", "ConfigResponse", "ConfirmToolInputBody", "Connection", @@ -194,9 +195,11 @@ "Conversation", "ConversationContext", "ConversationWithEvents", + "CreateAIDecompOutputBody", "CreateConversationRequest", "Created", "DecompilationCommentContext", + "DecompilationData", "DieMatch", "DnsQuery", "DrakvufFileMetadata", @@ -289,6 +292,7 @@ "ISA", "IconModel", "ImportModel", + "InlineComment", "InsertAnalysisLogRequest", "InverseFunctionMapItem", "InverseStringMapItem", @@ -307,6 +311,7 @@ "NameConfidence", "NameSourceType", "NetworkActivity", + "NumericAddr", "Order", "PDBDebugModel", "PEModel", @@ -317,14 +322,17 @@ "ProcessMemdumps", "ProcessNode", "ProcessTree", + "ProgressMessage", "PutAnalysisStringsRequest", "QueuePositionResponse", "QueuedWorkflowTaskResponse", "ReAnalysisForm", "Recent", + "RegenerateOutputBody", "RegenerateTarget", "RegistryOperation", "RelativeBinaryResponse", + "ReplacementValue", "ReportAnalysisResponse", "ReportEvent", "ReportInfo", @@ -372,6 +380,7 @@ "Structure", "StructureMember", "SubmitUserFeedbackRequest", + "SummaryData", "Symbols", "Tag", "TagItem", @@ -382,6 +391,7 @@ "TaskStatus", "TaskStatusResponse", "TimestampModel", + "TokenisedData", "TriageFunctionResponse", "TriageReportResponse", "Ttp", @@ -390,9 +400,12 @@ "UploadFileType", "UploadResponse", "UpsertAiDecomplationRatingRequest", + "UpsertOverridesData", + "UpsertOverridesInputBody", "UserActivityResponse", "Vulnerabilities", "Vulnerability", + "WorkflowProgress", "Workspace", "XrefFromResponse", "XrefResponse", @@ -574,6 +587,7 @@ from revengai.models.comment_base import CommentBase as CommentBase from revengai.models.comment_response import CommentResponse as CommentResponse from revengai.models.comment_update_request import CommentUpdateRequest as CommentUpdateRequest +from revengai.models.comments_data import CommentsData as CommentsData from revengai.models.config_response import ConfigResponse as ConfigResponse from revengai.models.confirm_tool_input_body import ConfirmToolInputBody as ConfirmToolInputBody from revengai.models.connection import Connection as Connection @@ -581,9 +595,11 @@ from revengai.models.conversation import Conversation as Conversation from revengai.models.conversation_context import ConversationContext as ConversationContext from revengai.models.conversation_with_events import ConversationWithEvents as ConversationWithEvents +from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody as CreateAIDecompOutputBody from revengai.models.create_conversation_request import CreateConversationRequest as CreateConversationRequest from revengai.models.created import Created as Created from revengai.models.decompilation_comment_context import DecompilationCommentContext as DecompilationCommentContext +from revengai.models.decompilation_data import DecompilationData as DecompilationData from revengai.models.die_match import DieMatch as DieMatch from revengai.models.dns_query import DnsQuery as DnsQuery from revengai.models.drakvuf_file_metadata import DrakvufFileMetadata as DrakvufFileMetadata @@ -676,6 +692,7 @@ from revengai.models.isa import ISA as ISA from revengai.models.icon_model import IconModel as IconModel from revengai.models.import_model import ImportModel as ImportModel +from revengai.models.inline_comment import InlineComment as InlineComment from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest as InsertAnalysisLogRequest from revengai.models.inverse_function_map_item import InverseFunctionMapItem as InverseFunctionMapItem from revengai.models.inverse_string_map_item import InverseStringMapItem as InverseStringMapItem @@ -694,6 +711,7 @@ from revengai.models.name_confidence import NameConfidence as NameConfidence from revengai.models.name_source_type import NameSourceType as NameSourceType from revengai.models.network_activity import NetworkActivity as NetworkActivity +from revengai.models.numeric_addr import NumericAddr as NumericAddr from revengai.models.order import Order as Order from revengai.models.pdb_debug_model import PDBDebugModel as PDBDebugModel from revengai.models.pe_model import PEModel as PEModel @@ -704,14 +722,17 @@ from revengai.models.process_memdumps import ProcessMemdumps as ProcessMemdumps from revengai.models.process_node import ProcessNode as ProcessNode from revengai.models.process_tree import ProcessTree as ProcessTree +from revengai.models.progress_message import ProgressMessage as ProgressMessage from revengai.models.put_analysis_strings_request import PutAnalysisStringsRequest as PutAnalysisStringsRequest from revengai.models.queue_position_response import QueuePositionResponse as QueuePositionResponse from revengai.models.queued_workflow_task_response import QueuedWorkflowTaskResponse as QueuedWorkflowTaskResponse from revengai.models.re_analysis_form import ReAnalysisForm as ReAnalysisForm from revengai.models.recent import Recent as Recent +from revengai.models.regenerate_output_body import RegenerateOutputBody as RegenerateOutputBody 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.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 @@ -759,6 +780,7 @@ from revengai.models.structure import Structure as Structure from revengai.models.structure_member import StructureMember as StructureMember from revengai.models.submit_user_feedback_request import SubmitUserFeedbackRequest as SubmitUserFeedbackRequest +from revengai.models.summary_data import SummaryData as SummaryData from revengai.models.symbols import Symbols as Symbols from revengai.models.tag import Tag as Tag from revengai.models.tag_item import TagItem as TagItem @@ -769,6 +791,7 @@ from revengai.models.task_status import TaskStatus as TaskStatus from revengai.models.task_status_response import TaskStatusResponse as TaskStatusResponse from revengai.models.timestamp_model import TimestampModel as TimestampModel +from revengai.models.tokenised_data import TokenisedData as TokenisedData from revengai.models.triage_function_response import TriageFunctionResponse as TriageFunctionResponse from revengai.models.triage_report_response import TriageReportResponse as TriageReportResponse from revengai.models.ttp import Ttp as Ttp @@ -777,9 +800,12 @@ from revengai.models.upload_file_type import UploadFileType as UploadFileType from revengai.models.upload_response import UploadResponse as UploadResponse from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest as UpsertAiDecomplationRatingRequest +from revengai.models.upsert_overrides_data import UpsertOverridesData as UpsertOverridesData +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody as UpsertOverridesInputBody from revengai.models.user_activity_response import UserActivityResponse as UserActivityResponse from revengai.models.vulnerabilities import Vulnerabilities as Vulnerabilities from revengai.models.vulnerability import Vulnerability as Vulnerability +from revengai.models.workflow_progress import WorkflowProgress as WorkflowProgress from revengai.models.workspace import Workspace as Workspace from revengai.models.xref_from_response import XrefFromResponse as XrefFromResponse from revengai.models.xref_response import XrefResponse as XrefResponse diff --git a/revengai/api/functions_ai_decompilation_api.py b/revengai/api/functions_ai_decompilation_api.py index 98b67bf..771c64a 100644 --- a/revengai/api/functions_ai_decompilation_api.py +++ b/revengai/api/functions_ai_decompilation_api.py @@ -26,9 +26,18 @@ from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse from revengai.models.base_response_union_get_ai_decompilation_rating_response_none_type import BaseResponseUnionGetAiDecompilationRatingResponseNoneType from revengai.models.comment_update_request import CommentUpdateRequest +from revengai.models.comments_data import CommentsData +from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody +from revengai.models.decompilation_data import DecompilationData from revengai.models.function_comment_create_request import FunctionCommentCreateRequest +from revengai.models.regenerate_output_body import RegenerateOutputBody from revengai.models.regenerate_target import RegenerateTarget +from revengai.models.summary_data import SummaryData +from revengai.models.tokenised_data import TokenisedData from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest +from revengai.models.upsert_overrides_data import UpsertOverridesData +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody +from revengai.models.workflow_progress import WorkflowProgress from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -48,6 +57,299 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def create_ai_decompilation( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + context_aware: Annotated[Optional[StrictBool], Field(description="Use context-aware decompilation")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateAIDecompOutputBody: + """Start AI decompilation + + Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + + :param function_id: Function ID (required) + :type function_id: int + :param context_aware: Use context-aware decompilation + :type context_aware: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ai_decompilation_serialize( + function_id=function_id, + context_aware=context_aware, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAIDecompOutputBody", + '400': "APIError", + '403': "APIError", + '409': "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 create_ai_decompilation_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + context_aware: Annotated[Optional[StrictBool], Field(description="Use context-aware decompilation")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateAIDecompOutputBody]: + """Start AI decompilation + + Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + + :param function_id: Function ID (required) + :type function_id: int + :param context_aware: Use context-aware decompilation + :type context_aware: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ai_decompilation_serialize( + function_id=function_id, + context_aware=context_aware, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAIDecompOutputBody", + '400': "APIError", + '403': "APIError", + '409': "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 create_ai_decompilation_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + context_aware: Annotated[Optional[StrictBool], Field(description="Use context-aware decompilation")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start AI decompilation + + Begins the AI decompilation process for a function. Charges team credits and starts the workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + + :param function_id: Function ID (required) + :type function_id: int + :param context_aware: Use context-aware decompilation + :type context_aware: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ai_decompilation_serialize( + function_id=function_id, + context_aware=context_aware, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAIDecompOutputBody", + '400': "APIError", + '403': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_ai_decompilation_serialize( + self, + function_id, + context_aware, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + if context_aware is not None: + + _query_params.append(('context_aware', context_aware)) + + # 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}/ai-decompilation', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def create_ai_decompilation_comment( self, @@ -905,9 +1207,9 @@ def _delete_ai_decompilation_comment_serialize( @validate_call - def get_ai_decompilation_comments( + def get_ai_decompilation( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -920,12 +1222,12 @@ def get_ai_decompilation_comments( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseListCommentResponse: - """Get comments for this function + ) -> DecompilationData: + """Get AI decompilation result - Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. + Returns the decompilation source code. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -949,7 +1251,7 @@ def get_ai_decompilation_comments( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_comments_serialize( + _param = self._get_ai_decompilation_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -958,8 +1260,11 @@ def get_ai_decompilation_comments( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", + '200': "DecompilationData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -973,9 +1278,9 @@ def get_ai_decompilation_comments( @validate_call - def get_ai_decompilation_comments_with_http_info( + def get_ai_decompilation_with_http_info( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -988,12 +1293,12 @@ def get_ai_decompilation_comments_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[BaseResponseListCommentResponse]: - """Get comments for this function + ) -> ApiResponse[DecompilationData]: + """Get AI decompilation result - Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. + Returns the decompilation source code. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1017,7 +1322,7 @@ def get_ai_decompilation_comments_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_comments_serialize( + _param = self._get_ai_decompilation_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1026,8 +1331,11 @@ def get_ai_decompilation_comments_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", + '200': "DecompilationData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1041,9 +1349,9 @@ def get_ai_decompilation_comments_with_http_info( @validate_call - def get_ai_decompilation_comments_without_preload_content( + def get_ai_decompilation_without_preload_content( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1057,11 +1365,11 @@ def get_ai_decompilation_comments_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get comments for this function + """Get AI decompilation result - Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. + Returns the decompilation source code. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1085,7 +1393,7 @@ def get_ai_decompilation_comments_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_comments_serialize( + _param = self._get_ai_decompilation_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1094,8 +1402,11 @@ def get_ai_decompilation_comments_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", + '200': "DecompilationData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1104,7 +1415,7 @@ def get_ai_decompilation_comments_without_preload_content( return response_data.response - def _get_ai_decompilation_comments_serialize( + def _get_ai_decompilation_serialize( self, function_id, _request_auth, @@ -1152,7 +1463,7 @@ def _get_ai_decompilation_comments_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/ai-decompilation/comments', + resource_path='/v3/functions/{function_id}/ai-decompilation', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1169,9 +1480,9 @@ def _get_ai_decompilation_comments_serialize( @validate_call - def get_ai_decompilation_rating( + def get_ai_decompilation_comments( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function for which to get the rating")], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1184,11 +1495,12 @@ def get_ai_decompilation_rating( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseUnionGetAiDecompilationRatingResponseNoneType: - """Get rating for AI decompilation + ) -> BaseResponseListCommentResponse: + """Get comments for this function + Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - :param function_id: The ID of the function for which to get the rating (required) + :param function_id: (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1212,7 +1524,7 @@ def get_ai_decompilation_rating( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_rating_serialize( + _param = self._get_ai_decompilation_comments_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1221,7 +1533,7 @@ def get_ai_decompilation_rating( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseUnionGetAiDecompilationRatingResponseNoneType", + '200': "BaseResponseListCommentResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1236,9 +1548,9 @@ def get_ai_decompilation_rating( @validate_call - def get_ai_decompilation_rating_with_http_info( + def get_ai_decompilation_comments_with_http_info( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function for which to get the rating")], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1251,11 +1563,12 @@ def get_ai_decompilation_rating_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[BaseResponseUnionGetAiDecompilationRatingResponseNoneType]: - """Get rating for AI decompilation + ) -> ApiResponse[BaseResponseListCommentResponse]: + """Get comments for this function + Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - :param function_id: The ID of the function for which to get the rating (required) + :param function_id: (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1279,7 +1592,7 @@ def get_ai_decompilation_rating_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_rating_serialize( + _param = self._get_ai_decompilation_comments_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1288,7 +1601,7 @@ def get_ai_decompilation_rating_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseUnionGetAiDecompilationRatingResponseNoneType", + '200': "BaseResponseListCommentResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1303,9 +1616,9 @@ def get_ai_decompilation_rating_with_http_info( @validate_call - def get_ai_decompilation_rating_without_preload_content( + def get_ai_decompilation_comments_without_preload_content( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function for which to get the rating")], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1319,10 +1632,11 @@ def get_ai_decompilation_rating_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get rating for AI decompilation + """Get comments for this function + Retrieves all comments created for a specific function. Only returns comments for resources the requesting user has access to. - :param function_id: The ID of the function for which to get the rating (required) + :param function_id: (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1346,7 +1660,7 @@ def get_ai_decompilation_rating_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_rating_serialize( + _param = self._get_ai_decompilation_comments_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1355,7 +1669,7 @@ def get_ai_decompilation_rating_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseUnionGetAiDecompilationRatingResponseNoneType", + '200': "BaseResponseListCommentResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1365,7 +1679,7 @@ def get_ai_decompilation_rating_without_preload_content( return response_data.response - def _get_ai_decompilation_rating_serialize( + def _get_ai_decompilation_comments_serialize( self, function_id, _request_auth, @@ -1413,7 +1727,7 @@ def _get_ai_decompilation_rating_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/ai-decompilation/rating', + resource_path='/v2/functions/{function_id}/ai-decompilation/comments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1430,12 +1744,9 @@ def _get_ai_decompilation_rating_serialize( @validate_call - def get_ai_decompilation_task_result( + def get_ai_decompilation_inline_comments( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being decompiled")], - summarise: Annotated[Optional[StrictBool], Field(description="Generate a summary for the decompilation")] = None, - generate_inline_comments: Annotated[Optional[StrictBool], Field(description="Generate inline comments for the decompilation")] = None, - force_regenerate: Annotated[Optional[List[RegenerateTarget]], Field(description="Force regeneration of summary and/or comments.")] = None, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1448,19 +1759,13 @@ def get_ai_decompilation_task_result( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseGetAiDecompilationTask: - """Polls AI Decompilation Process + ) -> CommentsData: + """Get AI decompilation inline comments - Polls the AI Decompilation Process + Returns the commented source if available. Returns pending status if comments are still being generated. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: The ID of the function being decompiled (required) + :param function_id: Function ID (required) :type function_id: int - :param summarise: Generate a summary for the decompilation - :type summarise: bool - :param generate_inline_comments: Generate inline comments for the decompilation - :type generate_inline_comments: bool - :param force_regenerate: Force regeneration of summary and/or comments. - :type force_regenerate: List[RegenerateTarget] :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 @@ -1483,11 +1788,8 @@ def get_ai_decompilation_task_result( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_task_result_serialize( + _param = self._get_ai_decompilation_inline_comments_serialize( function_id=function_id, - summarise=summarise, - generate_inline_comments=generate_inline_comments, - force_regenerate=force_regenerate, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1495,9 +1797,11 @@ def get_ai_decompilation_task_result( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetAiDecompilationTask", - '422': "BaseResponse", - '403': "BaseResponse", + '200': "CommentsData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1511,12 +1815,9 @@ def get_ai_decompilation_task_result( @validate_call - def get_ai_decompilation_task_result_with_http_info( + def get_ai_decompilation_inline_comments_with_http_info( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being decompiled")], - summarise: Annotated[Optional[StrictBool], Field(description="Generate a summary for the decompilation")] = None, - generate_inline_comments: Annotated[Optional[StrictBool], Field(description="Generate inline comments for the decompilation")] = None, - force_regenerate: Annotated[Optional[List[RegenerateTarget]], Field(description="Force regeneration of summary and/or comments.")] = None, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1529,19 +1830,13 @@ def get_ai_decompilation_task_result_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[BaseResponseGetAiDecompilationTask]: - """Polls AI Decompilation Process + ) -> ApiResponse[CommentsData]: + """Get AI decompilation inline comments - Polls the AI Decompilation Process + Returns the commented source if available. Returns pending status if comments are still being generated. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: The ID of the function being decompiled (required) + :param function_id: Function ID (required) :type function_id: int - :param summarise: Generate a summary for the decompilation - :type summarise: bool - :param generate_inline_comments: Generate inline comments for the decompilation - :type generate_inline_comments: bool - :param force_regenerate: Force regeneration of summary and/or comments. - :type force_regenerate: List[RegenerateTarget] :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 @@ -1564,11 +1859,8 @@ def get_ai_decompilation_task_result_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_task_result_serialize( + _param = self._get_ai_decompilation_inline_comments_serialize( function_id=function_id, - summarise=summarise, - generate_inline_comments=generate_inline_comments, - force_regenerate=force_regenerate, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1576,9 +1868,11 @@ def get_ai_decompilation_task_result_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetAiDecompilationTask", - '422': "BaseResponse", - '403': "BaseResponse", + '200': "CommentsData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1592,12 +1886,9 @@ def get_ai_decompilation_task_result_with_http_info( @validate_call - def get_ai_decompilation_task_result_without_preload_content( + def get_ai_decompilation_inline_comments_without_preload_content( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being decompiled")], - summarise: Annotated[Optional[StrictBool], Field(description="Generate a summary for the decompilation")] = None, - generate_inline_comments: Annotated[Optional[StrictBool], Field(description="Generate inline comments for the decompilation")] = None, - force_regenerate: Annotated[Optional[List[RegenerateTarget]], Field(description="Force regeneration of summary and/or comments.")] = None, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1611,18 +1902,12 @@ def get_ai_decompilation_task_result_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Polls AI Decompilation Process + """Get AI decompilation inline comments - Polls the AI Decompilation Process + Returns the commented source if available. Returns pending status if comments are still being generated. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: The ID of the function being decompiled (required) + :param function_id: Function ID (required) :type function_id: int - :param summarise: Generate a summary for the decompilation - :type summarise: bool - :param generate_inline_comments: Generate inline comments for the decompilation - :type generate_inline_comments: bool - :param force_regenerate: Force regeneration of summary and/or comments. - :type force_regenerate: List[RegenerateTarget] :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 @@ -1645,11 +1930,8 @@ def get_ai_decompilation_task_result_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_task_result_serialize( + _param = self._get_ai_decompilation_inline_comments_serialize( function_id=function_id, - summarise=summarise, - generate_inline_comments=generate_inline_comments, - force_regenerate=force_regenerate, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1657,9 +1939,11 @@ def get_ai_decompilation_task_result_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetAiDecompilationTask", - '422': "BaseResponse", - '403': "BaseResponse", + '200': "CommentsData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1668,12 +1952,9 @@ def get_ai_decompilation_task_result_without_preload_content( return response_data.response - def _get_ai_decompilation_task_result_serialize( + def _get_ai_decompilation_inline_comments_serialize( self, function_id, - summarise, - generate_inline_comments, - force_regenerate, _request_auth, _content_type, _headers, @@ -1683,7 +1964,6 @@ def _get_ai_decompilation_task_result_serialize( _host = None _collection_formats: Dict[str, str] = { - 'force_regenerate': 'multi', } _path_params: Dict[str, str] = {} @@ -1699,18 +1979,6 @@ def _get_ai_decompilation_task_result_serialize( if function_id is not None: _path_params['function_id'] = function_id # process the query parameters - if summarise is not None: - - _query_params.append(('summarise', summarise)) - - if generate_inline_comments is not None: - - _query_params.append(('generate_inline_comments', generate_inline_comments)) - - if force_regenerate is not None: - - _query_params.append(('force_regenerate', force_regenerate)) - # process the header parameters # process the form parameters # process the body parameter @@ -1732,7 +2000,7 @@ def _get_ai_decompilation_task_result_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/ai-decompilation', + resource_path='/v3/functions/{function_id}/ai-decompilation/inline-comments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1749,9 +2017,9 @@ def _get_ai_decompilation_task_result_serialize( @validate_call - def get_ai_decompilation_task_status( + def get_ai_decompilation_inline_comments_status( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being checked")], + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1764,11 +2032,12 @@ def get_ai_decompilation_task_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionTaskResponse: - """Check the status of a function ai decompilation + ) -> WorkflowProgress: + """Get inline comments generation workflow status + Returns fine-grained progress of the inline comments generation workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: The ID of the function being checked (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1792,7 +2061,7 @@ def get_ai_decompilation_task_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_task_status_serialize( + _param = self._get_ai_decompilation_inline_comments_status_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1801,8 +2070,11 @@ def get_ai_decompilation_task_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionTaskResponse", - '422': "BaseResponse", + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1816,9 +2088,9 @@ def get_ai_decompilation_task_status( @validate_call - def get_ai_decompilation_task_status_with_http_info( + def get_ai_decompilation_inline_comments_status_with_http_info( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being checked")], + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1831,11 +2103,12 @@ def get_ai_decompilation_task_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionTaskResponse]: - """Check the status of a function ai decompilation + ) -> ApiResponse[WorkflowProgress]: + """Get inline comments generation workflow status + Returns fine-grained progress of the inline comments generation workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: The ID of the function being checked (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1859,7 +2132,7 @@ def get_ai_decompilation_task_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_task_status_serialize( + _param = self._get_ai_decompilation_inline_comments_status_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1868,8 +2141,11 @@ def get_ai_decompilation_task_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionTaskResponse", - '422': "BaseResponse", + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1883,9 +2159,9 @@ def get_ai_decompilation_task_status_with_http_info( @validate_call - def get_ai_decompilation_task_status_without_preload_content( + def get_ai_decompilation_inline_comments_status_without_preload_content( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being checked")], + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1899,10 +2175,11 @@ def get_ai_decompilation_task_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Check the status of a function ai decompilation + """Get inline comments generation workflow status + Returns fine-grained progress of the inline comments generation workflow. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: The ID of the function being checked (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1926,7 +2203,7 @@ def get_ai_decompilation_task_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_task_status_serialize( + _param = self._get_ai_decompilation_inline_comments_status_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1935,8 +2212,11 @@ def get_ai_decompilation_task_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionTaskResponse", - '422': "BaseResponse", + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1945,7 +2225,7 @@ def get_ai_decompilation_task_status_without_preload_content( return response_data.response - def _get_ai_decompilation_task_status_serialize( + def _get_ai_decompilation_inline_comments_status_serialize( self, function_id, _request_auth, @@ -1993,7 +2273,7 @@ def _get_ai_decompilation_task_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/ai-decompilation/status', + resource_path='/v3/functions/{function_id}/ai-decompilation/inline-comments/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2010,11 +2290,9 @@ def _get_ai_decompilation_task_status_serialize( @validate_call - def update_ai_decompilation_comment( + def get_ai_decompilation_rating( self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - comment_update_request: CommentUpdateRequest, + function_id: Annotated[StrictInt, Field(description="The ID of the function for which to get the rating")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2027,17 +2305,12 @@ def update_ai_decompilation_comment( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseCommentResponse: - """Update a comment + ) -> BaseResponseUnionGetAiDecompilationRatingResponseNoneType: + """Get rating for AI decompilation - Updates the content of an existing comment. Users can only update their own comments. - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) + :param function_id: The ID of the function for which to get the rating (required) :type function_id: int - :param comment_update_request: (required) - :type comment_update_request: CommentUpdateRequest :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 @@ -2060,10 +2333,8 @@ def update_ai_decompilation_comment( :return: Returns the result object. """ # noqa: E501 - _param = self._update_ai_decompilation_comment_serialize( - comment_id=comment_id, + _param = self._get_ai_decompilation_rating_serialize( function_id=function_id, - comment_update_request=comment_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2071,10 +2342,8 @@ def update_ai_decompilation_comment( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCommentResponse", + '200': "BaseResponseUnionGetAiDecompilationRatingResponseNoneType", '422': "BaseResponse", - '403': "BaseResponse", - '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2088,11 +2357,9 @@ def update_ai_decompilation_comment( @validate_call - def update_ai_decompilation_comment_with_http_info( + def get_ai_decompilation_rating_with_http_info( self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - comment_update_request: CommentUpdateRequest, + function_id: Annotated[StrictInt, Field(description="The ID of the function for which to get the rating")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2105,17 +2372,12 @@ def update_ai_decompilation_comment_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[BaseResponseCommentResponse]: - """Update a comment + ) -> ApiResponse[BaseResponseUnionGetAiDecompilationRatingResponseNoneType]: + """Get rating for AI decompilation - Updates the content of an existing comment. Users can only update their own comments. - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) + :param function_id: The ID of the function for which to get the rating (required) :type function_id: int - :param comment_update_request: (required) - :type comment_update_request: CommentUpdateRequest :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 @@ -2138,10 +2400,8 @@ def update_ai_decompilation_comment_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_ai_decompilation_comment_serialize( - comment_id=comment_id, + _param = self._get_ai_decompilation_rating_serialize( function_id=function_id, - comment_update_request=comment_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2149,10 +2409,8 @@ def update_ai_decompilation_comment_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCommentResponse", + '200': "BaseResponseUnionGetAiDecompilationRatingResponseNoneType", '422': "BaseResponse", - '403': "BaseResponse", - '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2166,11 +2424,9 @@ def update_ai_decompilation_comment_with_http_info( @validate_call - def update_ai_decompilation_comment_without_preload_content( + def get_ai_decompilation_rating_without_preload_content( self, - comment_id: Annotated[int, Field(strict=True, ge=1)], - function_id: StrictInt, - comment_update_request: CommentUpdateRequest, + function_id: Annotated[StrictInt, Field(description="The ID of the function for which to get the rating")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2184,16 +2440,11 @@ def update_ai_decompilation_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a comment + """Get rating for AI decompilation - Updates the content of an existing comment. Users can only update their own comments. - :param comment_id: (required) - :type comment_id: int - :param function_id: (required) + :param function_id: The ID of the function for which to get the rating (required) :type function_id: int - :param comment_update_request: (required) - :type comment_update_request: CommentUpdateRequest :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 @@ -2216,10 +2467,8 @@ def update_ai_decompilation_comment_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_ai_decompilation_comment_serialize( - comment_id=comment_id, + _param = self._get_ai_decompilation_rating_serialize( function_id=function_id, - comment_update_request=comment_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2227,10 +2476,8 @@ def update_ai_decompilation_comment_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCommentResponse", + '200': "BaseResponseUnionGetAiDecompilationRatingResponseNoneType", '422': "BaseResponse", - '403': "BaseResponse", - '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2239,11 +2486,9 @@ def update_ai_decompilation_comment_without_preload_content( return response_data.response - def _update_ai_decompilation_comment_serialize( + def _get_ai_decompilation_rating_serialize( self, - comment_id, function_id, - comment_update_request, _request_auth, _content_type, _headers, @@ -2265,16 +2510,12 @@ def _update_ai_decompilation_comment_serialize( _body_params: Optional[bytes] = None # process the path parameters - if comment_id is not None: - _path_params['comment_id'] = comment_id if function_id is not None: _path_params['function_id'] = function_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if comment_update_request is not None: - _body_params = comment_update_request # set the HTTP header `Accept` @@ -2285,16 +2526,2534 @@ def _update_ai_decompilation_comment_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' - ] - ) + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/functions/{function_id}/ai-decompilation/rating', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ai_decompilation_status( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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, + ) -> WorkflowProgress: + """Get AI decompilation workflow status + + Returns fine-grained progress of the running workflow including current step, total steps, and messages. Falls back to the database task status when no workflow is running. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowProgress", + '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 get_ai_decompilation_status_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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[WorkflowProgress]: + """Get AI decompilation workflow status + + Returns fine-grained progress of the running workflow including current step, total steps, and messages. Falls back to the database task status when no workflow is running. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ai_decompilation_status_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get AI decompilation workflow status + + Returns fine-grained progress of the running workflow including current step, total steps, and messages. Falls back to the database task status when no workflow is running. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ai_decompilation_status_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ai_decompilation_summary( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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, + ) -> SummaryData: + """Get AI decompilation summary + + Returns the summary if available. Returns pending status if summary is still being generated. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_summary_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SummaryData", + '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 get_ai_decompilation_summary_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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[SummaryData]: + """Get AI decompilation summary + + Returns the summary if available. Returns pending status if summary is still being generated. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_summary_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SummaryData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ai_decompilation_summary_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get AI decompilation summary + + Returns the summary if available. Returns pending status if summary is still being generated. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_summary_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SummaryData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ai_decompilation_summary_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/summary', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ai_decompilation_summary_status( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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, + ) -> WorkflowProgress: + """Get summary generation workflow status + + Returns fine-grained progress of the summary generation workflow. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_summary_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowProgress", + '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 get_ai_decompilation_summary_status_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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[WorkflowProgress]: + """Get summary generation workflow status + + Returns fine-grained progress of the summary generation workflow. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_summary_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ai_decompilation_summary_status_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get summary generation workflow status + + Returns fine-grained progress of the summary generation workflow. **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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_summary_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowProgress", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ai_decompilation_summary_status_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/summary/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ai_decompilation_task_result( + self, + function_id: Annotated[StrictInt, Field(description="The ID of the function being decompiled")], + summarise: Annotated[Optional[StrictBool], Field(description="Generate a summary for the decompilation")] = None, + generate_inline_comments: Annotated[Optional[StrictBool], Field(description="Generate inline comments for the decompilation")] = None, + force_regenerate: Annotated[Optional[List[RegenerateTarget]], Field(description="Force regeneration of summary and/or comments.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseGetAiDecompilationTask: + """Polls AI Decompilation Process + + Polls the AI Decompilation Process + + :param function_id: The ID of the function being decompiled (required) + :type function_id: int + :param summarise: Generate a summary for the decompilation + :type summarise: bool + :param generate_inline_comments: Generate inline comments for the decompilation + :type generate_inline_comments: bool + :param force_regenerate: Force regeneration of summary and/or comments. + :type force_regenerate: List[RegenerateTarget] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_task_result_serialize( + function_id=function_id, + summarise=summarise, + generate_inline_comments=generate_inline_comments, + force_regenerate=force_regenerate, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseGetAiDecompilationTask", + '422': "BaseResponse", + '403': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_ai_decompilation_task_result_with_http_info( + self, + function_id: Annotated[StrictInt, Field(description="The ID of the function being decompiled")], + summarise: Annotated[Optional[StrictBool], Field(description="Generate a summary for the decompilation")] = None, + generate_inline_comments: Annotated[Optional[StrictBool], Field(description="Generate inline comments for the decompilation")] = None, + force_regenerate: Annotated[Optional[List[RegenerateTarget]], Field(description="Force regeneration of summary and/or comments.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseGetAiDecompilationTask]: + """Polls AI Decompilation Process + + Polls the AI Decompilation Process + + :param function_id: The ID of the function being decompiled (required) + :type function_id: int + :param summarise: Generate a summary for the decompilation + :type summarise: bool + :param generate_inline_comments: Generate inline comments for the decompilation + :type generate_inline_comments: bool + :param force_regenerate: Force regeneration of summary and/or comments. + :type force_regenerate: List[RegenerateTarget] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_task_result_serialize( + function_id=function_id, + summarise=summarise, + generate_inline_comments=generate_inline_comments, + force_regenerate=force_regenerate, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseGetAiDecompilationTask", + '422': "BaseResponse", + '403': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ai_decompilation_task_result_without_preload_content( + self, + function_id: Annotated[StrictInt, Field(description="The ID of the function being decompiled")], + summarise: Annotated[Optional[StrictBool], Field(description="Generate a summary for the decompilation")] = None, + generate_inline_comments: Annotated[Optional[StrictBool], Field(description="Generate inline comments for the decompilation")] = None, + force_regenerate: Annotated[Optional[List[RegenerateTarget]], Field(description="Force regeneration of summary and/or comments.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Polls AI Decompilation Process + + Polls the AI Decompilation Process + + :param function_id: The ID of the function being decompiled (required) + :type function_id: int + :param summarise: Generate a summary for the decompilation + :type summarise: bool + :param generate_inline_comments: Generate inline comments for the decompilation + :type generate_inline_comments: bool + :param force_regenerate: Force regeneration of summary and/or comments. + :type force_regenerate: List[RegenerateTarget] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_task_result_serialize( + function_id=function_id, + summarise=summarise, + generate_inline_comments=generate_inline_comments, + force_regenerate=force_regenerate, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseGetAiDecompilationTask", + '422': "BaseResponse", + '403': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ai_decompilation_task_result_serialize( + self, + function_id, + summarise, + generate_inline_comments, + force_regenerate, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'force_regenerate': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + if summarise is not None: + + _query_params.append(('summarise', summarise)) + + if generate_inline_comments is not None: + + _query_params.append(('generate_inline_comments', generate_inline_comments)) + + if force_regenerate is not None: + + _query_params.append(('force_regenerate', force_regenerate)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/functions/{function_id}/ai-decompilation', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ai_decompilation_task_status( + self, + function_id: Annotated[StrictInt, Field(description="The ID of the function being checked")], + _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, + ) -> BaseResponseFunctionTaskResponse: + """Check the status of a function ai decompilation + + + :param function_id: The ID of the function being checked (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_task_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseFunctionTaskResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_ai_decompilation_task_status_with_http_info( + self, + function_id: Annotated[StrictInt, Field(description="The ID of the function being checked")], + _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[BaseResponseFunctionTaskResponse]: + """Check the status of a function ai decompilation + + + :param function_id: The ID of the function being checked (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_task_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseFunctionTaskResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ai_decompilation_task_status_without_preload_content( + self, + function_id: Annotated[StrictInt, Field(description="The ID of the function being checked")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check the status of a function ai decompilation + + + :param function_id: The ID of the function being checked (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_task_status_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseFunctionTaskResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ai_decompilation_task_status_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/functions/{function_id}/ai-decompilation/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ai_decompilation_tokenised( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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, + ) -> TokenisedData: + """Get tokenised AI decompilation with function mapping + + Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_tokenised_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TokenisedData", + '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 get_ai_decompilation_tokenised_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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[TokenisedData]: + """Get tokenised AI decompilation with function mapping + + Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_tokenised_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TokenisedData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_ai_decompilation_tokenised_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get tokenised AI decompilation with function mapping + + Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ai_decompilation_tokenised_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TokenisedData", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ai_decompilation_tokenised_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/tokenised', + 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 regenerate_ai_decompilation_inline_comments( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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, + ) -> RegenerateOutputBody: + """Regenerate AI decompilation inline comments + + Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **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 _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._regenerate_ai_decompilation_inline_comments_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "RegenerateOutputBody", + '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 regenerate_ai_decompilation_inline_comments_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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[RegenerateOutputBody]: + """Regenerate AI decompilation inline comments + + Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **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 _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._regenerate_ai_decompilation_inline_comments_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "RegenerateOutputBody", + '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 regenerate_ai_decompilation_inline_comments_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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: + """Regenerate AI decompilation inline comments + + Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **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 _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._regenerate_ai_decompilation_inline_comments_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "RegenerateOutputBody", + '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 _regenerate_ai_decompilation_inline_comments_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/functions/{function_id}/ai-decompilation/inline-comments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def regenerate_ai_decompilation_summary( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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, + ) -> RegenerateOutputBody: + """Regenerate AI decompilation summary + + Starts a new summary generation workflow for the function. Requires an existing decompilation. **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 _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._regenerate_ai_decompilation_summary_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "RegenerateOutputBody", + '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 regenerate_ai_decompilation_summary_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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[RegenerateOutputBody]: + """Regenerate AI decompilation summary + + Starts a new summary generation workflow for the function. Requires an existing decompilation. **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 _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._regenerate_ai_decompilation_summary_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "RegenerateOutputBody", + '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 regenerate_ai_decompilation_summary_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _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: + """Regenerate AI decompilation summary + + Starts a new summary generation workflow for the function. Requires an existing decompilation. **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 _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._regenerate_ai_decompilation_summary_serialize( + function_id=function_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "RegenerateOutputBody", + '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 _regenerate_ai_decompilation_summary_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/functions/{function_id}/ai-decompilation/summary', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_ai_decompilation_comment( + self, + comment_id: Annotated[int, Field(strict=True, ge=1)], + function_id: StrictInt, + comment_update_request: CommentUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseCommentResponse: + """Update a comment + + Updates the content of an existing comment. Users can only update their own comments. + + :param comment_id: (required) + :type comment_id: int + :param function_id: (required) + :type function_id: int + :param comment_update_request: (required) + :type comment_update_request: CommentUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ai_decompilation_comment_serialize( + comment_id=comment_id, + function_id=function_id, + comment_update_request=comment_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseCommentResponse", + '422': "BaseResponse", + '403': "BaseResponse", + '400': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_ai_decompilation_comment_with_http_info( + self, + comment_id: Annotated[int, Field(strict=True, ge=1)], + function_id: StrictInt, + comment_update_request: CommentUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseCommentResponse]: + """Update a comment + + Updates the content of an existing comment. Users can only update their own comments. + + :param comment_id: (required) + :type comment_id: int + :param function_id: (required) + :type function_id: int + :param comment_update_request: (required) + :type comment_update_request: CommentUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ai_decompilation_comment_serialize( + comment_id=comment_id, + function_id=function_id, + comment_update_request=comment_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseCommentResponse", + '422': "BaseResponse", + '403': "BaseResponse", + '400': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_ai_decompilation_comment_without_preload_content( + self, + comment_id: Annotated[int, Field(strict=True, ge=1)], + function_id: StrictInt, + comment_update_request: CommentUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a comment + + Updates the content of an existing comment. Users can only update their own comments. + + :param comment_id: (required) + :type comment_id: int + :param function_id: (required) + :type function_id: int + :param comment_update_request: (required) + :type comment_update_request: CommentUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ai_decompilation_comment_serialize( + comment_id=comment_id, + function_id=function_id, + comment_update_request=comment_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseCommentResponse", + '422': "BaseResponse", + '403': "BaseResponse", + '400': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_ai_decompilation_comment_serialize( + self, + comment_id, + function_id, + comment_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if comment_id is not None: + _path_params['comment_id'] = comment_id + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if comment_update_request is not None: + _body_params = comment_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: _header_params['Content-Type'] = _default_content_type @@ -2322,6 +5081,310 @@ def _update_ai_decompilation_comment_serialize( + @validate_call + def upsert_ai_decompilation_overrides( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + upsert_overrides_input_body: UpsertOverridesInputBody, + _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, + ) -> UpsertOverridesData: + """Upsert variable/function name overrides + + Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_id: Function ID (required) + :type function_id: int + :param upsert_overrides_input_body: (required) + :type upsert_overrides_input_body: UpsertOverridesInputBody + :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._upsert_ai_decompilation_overrides_serialize( + function_id=function_id, + upsert_overrides_input_body=upsert_overrides_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpsertOverridesData", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def upsert_ai_decompilation_overrides_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + upsert_overrides_input_body: UpsertOverridesInputBody, + _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[UpsertOverridesData]: + """Upsert variable/function name overrides + + Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_id: Function ID (required) + :type function_id: int + :param upsert_overrides_input_body: (required) + :type upsert_overrides_input_body: UpsertOverridesInputBody + :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._upsert_ai_decompilation_overrides_serialize( + function_id=function_id, + upsert_overrides_input_body=upsert_overrides_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpsertOverridesData", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def upsert_ai_decompilation_overrides_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + upsert_overrides_input_body: UpsertOverridesInputBody, + _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: + """Upsert variable/function name overrides + + Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_id: Function ID (required) + :type function_id: int + :param upsert_overrides_input_body: (required) + :type upsert_overrides_input_body: UpsertOverridesInputBody + :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._upsert_ai_decompilation_overrides_serialize( + function_id=function_id, + upsert_overrides_input_body=upsert_overrides_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpsertOverridesData", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upsert_ai_decompilation_overrides_serialize( + self, + function_id, + upsert_overrides_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 upsert_overrides_input_body is not None: + _body_params = upsert_overrides_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='PATCH', + resource_path='/v3/functions/{function_id}/ai-decompilation/overrides', + 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 upsert_ai_decompilation_rating( self, diff --git a/revengai/api_client.py b/revengai/api_client.py index 71422b7..dce6a04 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v3.81.1/python' + self.user_agent = 'OpenAPI-Generator/v3.82.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 9ee52f3..68f2430 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.81.1\n"\ - "SDK Package Version: v3.81.1".\ + "Version of the API: v3.82.0\n"\ + "SDK Package Version: v3.82.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index dd97b9c..0195a6a 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -154,6 +154,7 @@ from revengai.models.comment_base import CommentBase from revengai.models.comment_response import CommentResponse from revengai.models.comment_update_request import CommentUpdateRequest +from revengai.models.comments_data import CommentsData from revengai.models.config_response import ConfigResponse from revengai.models.confirm_tool_input_body import ConfirmToolInputBody from revengai.models.connection import Connection @@ -161,9 +162,11 @@ from revengai.models.conversation import Conversation from revengai.models.conversation_context import ConversationContext from revengai.models.conversation_with_events import ConversationWithEvents +from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody from revengai.models.create_conversation_request import CreateConversationRequest from revengai.models.created import Created from revengai.models.decompilation_comment_context import DecompilationCommentContext +from revengai.models.decompilation_data import DecompilationData from revengai.models.die_match import DieMatch from revengai.models.dns_query import DnsQuery from revengai.models.drakvuf_file_metadata import DrakvufFileMetadata @@ -256,6 +259,7 @@ from revengai.models.isa import ISA from revengai.models.icon_model import IconModel from revengai.models.import_model import ImportModel +from revengai.models.inline_comment import InlineComment from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest from revengai.models.inverse_function_map_item import InverseFunctionMapItem from revengai.models.inverse_string_map_item import InverseStringMapItem @@ -274,6 +278,7 @@ from revengai.models.name_confidence import NameConfidence from revengai.models.name_source_type import NameSourceType from revengai.models.network_activity import NetworkActivity +from revengai.models.numeric_addr import NumericAddr from revengai.models.order import Order from revengai.models.pdb_debug_model import PDBDebugModel from revengai.models.pe_model import PEModel @@ -284,14 +289,17 @@ from revengai.models.process_memdumps import ProcessMemdumps from revengai.models.process_node import ProcessNode from revengai.models.process_tree import ProcessTree +from revengai.models.progress_message import ProgressMessage from revengai.models.put_analysis_strings_request import PutAnalysisStringsRequest from revengai.models.queue_position_response import QueuePositionResponse from revengai.models.queued_workflow_task_response import QueuedWorkflowTaskResponse from revengai.models.re_analysis_form import ReAnalysisForm from revengai.models.recent import Recent +from revengai.models.regenerate_output_body import RegenerateOutputBody 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.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 @@ -339,6 +347,7 @@ from revengai.models.structure import Structure from revengai.models.structure_member import StructureMember from revengai.models.submit_user_feedback_request import SubmitUserFeedbackRequest +from revengai.models.summary_data import SummaryData from revengai.models.symbols import Symbols from revengai.models.tag import Tag from revengai.models.tag_item import TagItem @@ -349,6 +358,7 @@ from revengai.models.task_status import TaskStatus from revengai.models.task_status_response import TaskStatusResponse from revengai.models.timestamp_model import TimestampModel +from revengai.models.tokenised_data import TokenisedData from revengai.models.triage_function_response import TriageFunctionResponse from revengai.models.triage_report_response import TriageReportResponse from revengai.models.ttp import Ttp @@ -357,9 +367,12 @@ from revengai.models.upload_file_type import UploadFileType from revengai.models.upload_response import UploadResponse from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest +from revengai.models.upsert_overrides_data import UpsertOverridesData +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody from revengai.models.user_activity_response import UserActivityResponse from revengai.models.vulnerabilities import Vulnerabilities from revengai.models.vulnerability import Vulnerability +from revengai.models.workflow_progress import WorkflowProgress from revengai.models.workspace import Workspace from revengai.models.xref_from_response import XrefFromResponse from revengai.models.xref_response import XrefResponse diff --git a/revengai/models/comments_data.py b/revengai/models/comments_data.py new file mode 100644 index 0000000..b5b98b2 --- /dev/null +++ b/revengai/models/comments_data.py @@ -0,0 +1,125 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.inline_comment import InlineComment +from typing import Optional, Set +from typing_extensions import Self + +class CommentsData(BaseModel): + """ + CommentsData + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + inline_comments: Optional[List[InlineComment]] = Field(description="Structured inline comments with line numbers") + task_status: StrictStr = Field(description="Task status") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "inline_comments", "task_status"] + + @field_validator('task_status') + def task_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'COMPLETED']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'COMPLETED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CommentsData 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 inline_comments (list) + _items = [] + if self.inline_comments: + for _item_inline_comments in self.inline_comments: + if _item_inline_comments: + _items.append(_item_inline_comments.to_dict()) + _dict['inline_comments'] = _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 inline_comments (nullable) is None + # and model_fields_set contains the field + if self.inline_comments is None and "inline_comments" in self.model_fields_set: + _dict['inline_comments'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CommentsData 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"), + "inline_comments": [InlineComment.from_dict(_item) for _item in obj["inline_comments"]] if obj.get("inline_comments") is not None else None, + "task_status": obj.get("task_status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_ai_decomp_output_body.py b/revengai/models/create_ai_decomp_output_body.py new file mode 100644 index 0000000..b5f1d24 --- /dev/null +++ b/revengai/models/create_ai_decomp_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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateAIDecompOutputBody(BaseModel): + """ + CreateAIDecompOutputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + status: StrictBool + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateAIDecompOutputBody 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 CreateAIDecompOutputBody 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"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/decompilation_data.py b/revengai/models/decompilation_data.py new file mode 100644 index 0000000..d7433e8 --- /dev/null +++ b/revengai/models/decompilation_data.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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DecompilationData(BaseModel): + """ + DecompilationData + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + decompilation: Optional[StrictStr] = Field(default=None, description="Source code with placeholders replaced") + status: StrictStr = Field(description="Task status") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "decompilation", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DecompilationData 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 DecompilationData 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"), + "decompilation": obj.get("decompilation"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/error_body.py b/revengai/models/error_body.py index 5b96eb5..f3267fe 100644 --- a/revengai/models/error_body.py +++ b/revengai/models/error_body.py @@ -36,8 +36,8 @@ class ErrorBody(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in set(['ACCESS_DENIED', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND']): - raise ValueError("must be one of enum values ('ACCESS_DENIED', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND')") + if value not in set(['ACCESS_DENIED', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REPORT_RENDER_FAILED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND']): + raise ValueError("must be one of enum values ('ACCESS_DENIED', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REPORT_RENDER_FAILED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND')") return value model_config = ConfigDict( diff --git a/revengai/models/function_list_item.py b/revengai/models/function_list_item.py index 80af705..e7c3f9a 100644 --- a/revengai/models/function_list_item.py +++ b/revengai/models/function_list_item.py @@ -39,8 +39,8 @@ class FunctionListItem(BaseModel): @field_validator('name_source_type') def name_source_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP']): - raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP')") + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP', 'AI_AGENT']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP', 'AI_AGENT')") return value model_config = ConfigDict( diff --git a/revengai/models/inline_comment.py b/revengai/models/inline_comment.py new file mode 100644 index 0000000..2187cf1 --- /dev/null +++ b/revengai/models/inline_comment.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class InlineComment(BaseModel): + """ + InlineComment + """ # noqa: E501 + comment: StrictStr + line: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["comment", "line"] + + 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 InlineComment 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 InlineComment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "comment": obj.get("comment"), + "line": obj.get("line") + }) + # 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/name_source_type.py b/revengai/models/name_source_type.py index 0a75b67..4fd2348 100644 --- a/revengai/models/name_source_type.py +++ b/revengai/models/name_source_type.py @@ -34,8 +34,8 @@ class NameSourceType(BaseModel): @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP']): - raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP')") + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP', 'AI_AGENT']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'EXTERNAL', 'AI_UNSTRIP', 'AI_AGENT')") return value model_config = ConfigDict( diff --git a/revengai/models/numeric_addr.py b/revengai/models/numeric_addr.py new file mode 100644 index 0000000..a3dab85 --- /dev/null +++ b/revengai/models/numeric_addr.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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NumericAddr(BaseModel): + """ + NumericAddr + """ # noqa: E501 + value: Optional[StrictInt] = Field(alias="Value") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["Value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NumericAddr from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['Value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NumericAddr from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "Value": obj.get("Value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/progress_message.py b/revengai/models/progress_message.py new file mode 100644 index 0000000..66c945e --- /dev/null +++ b/revengai/models/progress_message.py @@ -0,0 +1,113 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ProgressMessage(BaseModel): + """ + ProgressMessage + """ # noqa: E501 + level: StrictStr = Field(description="Severity level") + step: StrictStr = Field(description="Step name when the message was emitted") + text: StrictStr = Field(description="Message text") + timestamp: datetime = Field(description="When the message was emitted") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["level", "step", "text", "timestamp"] + + @field_validator('level') + def level_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['INFO', 'WARN', 'ERROR']): + raise ValueError("must be one of enum values ('INFO', 'WARN', 'ERROR')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProgressMessage 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 ProgressMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "level": obj.get("level"), + "step": obj.get("step"), + "text": obj.get("text"), + "timestamp": obj.get("timestamp") + }) + # 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/regenerate_output_body.py b/revengai/models/regenerate_output_body.py new file mode 100644 index 0000000..7dce5fe --- /dev/null +++ b/revengai/models/regenerate_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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RegenerateOutputBody(BaseModel): + """ + RegenerateOutputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + status: StrictBool + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RegenerateOutputBody 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 RegenerateOutputBody 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"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/replacement_value.py b/revengai/models/replacement_value.py new file mode 100644 index 0000000..7f7a0de --- /dev/null +++ b/revengai/models/replacement_value.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReplacementValue(BaseModel): + """ + ReplacementValue + """ # noqa: E501 + value: Optional[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReplacementValue from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReplacementValue from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/summary_data.py b/revengai/models/summary_data.py new file mode 100644 index 0000000..aad4dcb --- /dev/null +++ b/revengai/models/summary_data.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SummaryData(BaseModel): + """ + SummaryData + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + ai_summary: StrictStr = Field(description="Summary with code tags removed") + summary: StrictStr = Field(description="Raw summary from the model") + task_status: StrictStr = Field(description="Task status") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "ai_summary", "summary", "task_status"] + + @field_validator('task_status') + def task_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'COMPLETED']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'COMPLETED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SummaryData 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 SummaryData 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"), + "ai_summary": obj.get("ai_summary"), + "summary": obj.get("summary"), + "task_status": obj.get("task_status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/tokenised_data.py b/revengai/models/tokenised_data.py new file mode 100644 index 0000000..fb1e686 --- /dev/null +++ b/revengai/models/tokenised_data.py @@ -0,0 +1,120 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_mapping import FunctionMapping +from typing import Optional, Set +from typing_extensions import Self + +class TokenisedData(BaseModel): + """ + TokenisedData + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + function_mapping: Optional[FunctionMapping] = Field(default=None, description="Complete mapping data for token resolution") + predicted_function_name: Optional[StrictStr] = Field(default=None, description="Predicted function name from the AI model") + status: StrictStr = Field(description="Task status") + tokenised_decompilation: Optional[StrictStr] = Field(default=None, description="Source code with placeholder tokens") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "function_mapping", "predicted_function_name", "status", "tokenised_decompilation"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TokenisedData 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 function_mapping + if self.function_mapping: + _dict['function_mapping'] = self.function_mapping.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TokenisedData 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"), + "function_mapping": FunctionMapping.from_dict(obj["function_mapping"]) if obj.get("function_mapping") is not None else None, + "predicted_function_name": obj.get("predicted_function_name"), + "status": obj.get("status"), + "tokenised_decompilation": obj.get("tokenised_decompilation") + }) + # 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/upsert_overrides_data.py b/revengai/models/upsert_overrides_data.py new file mode 100644 index 0000000..838e066 --- /dev/null +++ b/revengai/models/upsert_overrides_data.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpsertOverridesData(BaseModel): + """ + UpsertOverridesData + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + user_override_mappings: Dict[str, StrictStr] = Field(description="Merged override mappings after applying changes") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "user_override_mappings"] + + 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 UpsertOverridesData 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 UpsertOverridesData 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"), + "user_override_mappings": obj.get("user_override_mappings") + }) + # 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/upsert_overrides_input_body.py b/revengai/models/upsert_overrides_input_body.py new file mode 100644 index 0000000..39dbd91 --- /dev/null +++ b/revengai/models/upsert_overrides_input_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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpsertOverridesInputBody(BaseModel): + """ + UpsertOverridesInputBody + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + overrides: Dict[str, StrictStr] = Field(description="Token to name mappings. Empty string removes the override.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "overrides"] + + 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 UpsertOverridesInputBody 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 UpsertOverridesInputBody 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"), + "overrides": obj.get("overrides") + }) + # 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/workflow_progress.py b/revengai/models/workflow_progress.py new file mode 100644 index 0000000..2c98b44 --- /dev/null +++ b/revengai/models/workflow_progress.py @@ -0,0 +1,131 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.progress_message import ProgressMessage +from typing import Optional, Set +from typing_extensions import Self + +class WorkflowProgress(BaseModel): + """ + WorkflowProgress + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, description="A URL to the JSON Schema for this object.", alias="$schema") + messages: Optional[List[ProgressMessage]] = Field(description="Log messages emitted during execution") + status: StrictStr = Field(description="Current workflow status") + step: StrictStr = Field(description="Name of the current step") + step_index: StrictInt = Field(description="Zero-based index of the current step") + steps_total: StrictInt = Field(description="Total number of steps in the workflow") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["$schema", "messages", "status", "step", "step_index", "steps_total"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkflowProgress 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 messages (list) + _items = [] + if self.messages: + for _item_messages in self.messages: + if _item_messages: + _items.append(_item_messages.to_dict()) + _dict['messages'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if messages (nullable) is None + # and model_fields_set contains the field + if self.messages is None and "messages" in self.model_fields_set: + _dict['messages'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkflowProgress 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"), + "messages": [ProgressMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None, + "status": obj.get("status"), + "step": obj.get("step"), + "step_index": obj.get("step_index"), + "steps_total": obj.get("steps_total") + }) + # 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/test/test_comments_data.py b/test/test_comments_data.py new file mode 100644 index 0000000..23b90c3 --- /dev/null +++ b/test/test_comments_data.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.comments_data import CommentsData + +class TestCommentsData(unittest.TestCase): + """CommentsData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CommentsData: + """Test CommentsData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CommentsData` + """ + model = CommentsData() + if include_optional: + return CommentsData( + var_schema = '', + inline_comments = [ + { } + ], + task_status = 'UNINITIALISED' + ) + else: + return CommentsData( + inline_comments = [ + { } + ], + task_status = 'UNINITIALISED', + ) + """ + + def testCommentsData(self): + """Test CommentsData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_ai_decomp_output_body.py b/test/test_create_ai_decomp_output_body.py new file mode 100644 index 0000000..5877db6 --- /dev/null +++ b/test/test_create_ai_decomp_output_body.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody + +class TestCreateAIDecompOutputBody(unittest.TestCase): + """CreateAIDecompOutputBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAIDecompOutputBody: + """Test CreateAIDecompOutputBody + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAIDecompOutputBody` + """ + model = CreateAIDecompOutputBody() + if include_optional: + return CreateAIDecompOutputBody( + var_schema = '', + status = True + ) + else: + return CreateAIDecompOutputBody( + status = True, + ) + """ + + def testCreateAIDecompOutputBody(self): + """Test CreateAIDecompOutputBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_decompilation_data.py b/test/test_decompilation_data.py new file mode 100644 index 0000000..abb874b --- /dev/null +++ b/test/test_decompilation_data.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.decompilation_data import DecompilationData + +class TestDecompilationData(unittest.TestCase): + """DecompilationData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DecompilationData: + """Test DecompilationData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DecompilationData` + """ + model = DecompilationData() + if include_optional: + return DecompilationData( + var_schema = '', + decompilation = '', + status = 'UNINITIALISED' + ) + else: + return DecompilationData( + status = 'UNINITIALISED', + ) + """ + + def testDecompilationData(self): + """Test DecompilationData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_functions_ai_decompilation_api.py b/test/test_functions_ai_decompilation_api.py index 6018a0e..428d825 100644 --- a/test/test_functions_ai_decompilation_api.py +++ b/test/test_functions_ai_decompilation_api.py @@ -25,6 +25,13 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_create_ai_decompilation(self) -> None: + """Test case for create_ai_decompilation + + Start AI decompilation + """ + pass + def test_create_ai_decompilation_comment(self) -> None: """Test case for create_ai_decompilation_comment @@ -46,6 +53,13 @@ def test_delete_ai_decompilation_comment(self) -> None: """ pass + def test_get_ai_decompilation(self) -> None: + """Test case for get_ai_decompilation + + Get AI decompilation result + """ + pass + def test_get_ai_decompilation_comments(self) -> None: """Test case for get_ai_decompilation_comments @@ -53,6 +67,20 @@ def test_get_ai_decompilation_comments(self) -> None: """ pass + def test_get_ai_decompilation_inline_comments(self) -> None: + """Test case for get_ai_decompilation_inline_comments + + Get AI decompilation inline comments + """ + pass + + def test_get_ai_decompilation_inline_comments_status(self) -> None: + """Test case for get_ai_decompilation_inline_comments_status + + Get inline comments generation workflow status + """ + pass + def test_get_ai_decompilation_rating(self) -> None: """Test case for get_ai_decompilation_rating @@ -60,6 +88,27 @@ def test_get_ai_decompilation_rating(self) -> None: """ pass + def test_get_ai_decompilation_status(self) -> None: + """Test case for get_ai_decompilation_status + + Get AI decompilation workflow status + """ + pass + + def test_get_ai_decompilation_summary(self) -> None: + """Test case for get_ai_decompilation_summary + + Get AI decompilation summary + """ + pass + + def test_get_ai_decompilation_summary_status(self) -> None: + """Test case for get_ai_decompilation_summary_status + + Get summary generation workflow status + """ + pass + def test_get_ai_decompilation_task_result(self) -> None: """Test case for get_ai_decompilation_task_result @@ -74,6 +123,27 @@ def test_get_ai_decompilation_task_status(self) -> None: """ pass + def test_get_ai_decompilation_tokenised(self) -> None: + """Test case for get_ai_decompilation_tokenised + + Get tokenised AI decompilation with function mapping + """ + pass + + def test_regenerate_ai_decompilation_inline_comments(self) -> None: + """Test case for regenerate_ai_decompilation_inline_comments + + Regenerate AI decompilation inline comments + """ + pass + + def test_regenerate_ai_decompilation_summary(self) -> None: + """Test case for regenerate_ai_decompilation_summary + + Regenerate AI decompilation summary + """ + pass + def test_update_ai_decompilation_comment(self) -> None: """Test case for update_ai_decompilation_comment @@ -81,6 +151,13 @@ def test_update_ai_decompilation_comment(self) -> None: """ pass + def test_upsert_ai_decompilation_overrides(self) -> None: + """Test case for upsert_ai_decompilation_overrides + + Upsert variable/function name overrides + """ + pass + def test_upsert_ai_decompilation_rating(self) -> None: """Test case for upsert_ai_decompilation_rating diff --git a/test/test_inline_comment.py b/test/test_inline_comment.py new file mode 100644 index 0000000..c8f173a --- /dev/null +++ b/test/test_inline_comment.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.inline_comment import InlineComment + +class TestInlineComment(unittest.TestCase): + """InlineComment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InlineComment: + """Test InlineComment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InlineComment` + """ + model = InlineComment() + if include_optional: + return InlineComment( + comment = '', + line = 56 + ) + else: + return InlineComment( + comment = '', + line = 56, + ) + """ + + def testInlineComment(self): + """Test InlineComment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_numeric_addr.py b/test/test_numeric_addr.py new file mode 100644 index 0000000..741a819 --- /dev/null +++ b/test/test_numeric_addr.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.numeric_addr import NumericAddr + +class TestNumericAddr(unittest.TestCase): + """NumericAddr unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NumericAddr: + """Test NumericAddr + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NumericAddr` + """ + model = NumericAddr() + if include_optional: + return NumericAddr( + value = 56 + ) + else: + return NumericAddr( + value = 56, + ) + """ + + def testNumericAddr(self): + """Test NumericAddr""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_progress_message.py b/test/test_progress_message.py new file mode 100644 index 0000000..c686e36 --- /dev/null +++ b/test/test_progress_message.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.progress_message import ProgressMessage + +class TestProgressMessage(unittest.TestCase): + """ProgressMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProgressMessage: + """Test ProgressMessage + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ProgressMessage` + """ + model = ProgressMessage() + if include_optional: + return ProgressMessage( + level = 'INFO', + step = '', + text = '', + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return ProgressMessage( + level = 'INFO', + step = '', + text = '', + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testProgressMessage(self): + """Test ProgressMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_regenerate_output_body.py b/test/test_regenerate_output_body.py new file mode 100644 index 0000000..4d042d5 --- /dev/null +++ b/test/test_regenerate_output_body.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.regenerate_output_body import RegenerateOutputBody + +class TestRegenerateOutputBody(unittest.TestCase): + """RegenerateOutputBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RegenerateOutputBody: + """Test RegenerateOutputBody + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RegenerateOutputBody` + """ + model = RegenerateOutputBody() + if include_optional: + return RegenerateOutputBody( + var_schema = '', + status = True + ) + else: + return RegenerateOutputBody( + status = True, + ) + """ + + def testRegenerateOutputBody(self): + """Test RegenerateOutputBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_replacement_value.py b/test/test_replacement_value.py new file mode 100644 index 0000000..354468d --- /dev/null +++ b/test/test_replacement_value.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.replacement_value import ReplacementValue + +class TestReplacementValue(unittest.TestCase): + """ReplacementValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ReplacementValue: + """Test ReplacementValue + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ReplacementValue` + """ + model = ReplacementValue() + if include_optional: + return ReplacementValue( + value = '' + ) + else: + return ReplacementValue( + value = '', + ) + """ + + def testReplacementValue(self): + """Test ReplacementValue""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_summary_data.py b/test/test_summary_data.py new file mode 100644 index 0000000..62a3a2b --- /dev/null +++ b/test/test_summary_data.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.summary_data import SummaryData + +class TestSummaryData(unittest.TestCase): + """SummaryData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SummaryData: + """Test SummaryData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SummaryData` + """ + model = SummaryData() + if include_optional: + return SummaryData( + var_schema = '', + ai_summary = '', + summary = '', + task_status = 'UNINITIALISED' + ) + else: + return SummaryData( + ai_summary = '', + summary = '', + task_status = 'UNINITIALISED', + ) + """ + + def testSummaryData(self): + """Test SummaryData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tokenised_data.py b/test/test_tokenised_data.py new file mode 100644 index 0000000..976f6d9 --- /dev/null +++ b/test/test_tokenised_data.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.tokenised_data import TokenisedData + +class TestTokenisedData(unittest.TestCase): + """TokenisedData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TokenisedData: + """Test TokenisedData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TokenisedData` + """ + model = TokenisedData() + if include_optional: + return TokenisedData( + var_schema = '', + function_mapping = revengai.models.function_mapping.FunctionMapping( + function_map = { + 'key' : 56 + }, + inverse_function_map = { + 'key' : 56 + }, + name_map = { + 'key' : '' + }, ), + predicted_function_name = '', + status = 'UNINITIALISED', + tokenised_decompilation = '' + ) + else: + return TokenisedData( + status = 'UNINITIALISED', + ) + """ + + def testTokenisedData(self): + """Test TokenisedData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_upsert_overrides_data.py b/test/test_upsert_overrides_data.py new file mode 100644 index 0000000..a946395 --- /dev/null +++ b/test/test_upsert_overrides_data.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.upsert_overrides_data import UpsertOverridesData + +class TestUpsertOverridesData(unittest.TestCase): + """UpsertOverridesData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpsertOverridesData: + """Test UpsertOverridesData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpsertOverridesData` + """ + model = UpsertOverridesData() + if include_optional: + return UpsertOverridesData( + var_schema = '', + user_override_mappings = { + 'key' : '' + } + ) + else: + return UpsertOverridesData( + user_override_mappings = { + 'key' : '' + }, + ) + """ + + def testUpsertOverridesData(self): + """Test UpsertOverridesData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_upsert_overrides_input_body.py b/test/test_upsert_overrides_input_body.py new file mode 100644 index 0000000..dcaf0f1 --- /dev/null +++ b/test/test_upsert_overrides_input_body.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody + +class TestUpsertOverridesInputBody(unittest.TestCase): + """UpsertOverridesInputBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpsertOverridesInputBody: + """Test UpsertOverridesInputBody + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpsertOverridesInputBody` + """ + model = UpsertOverridesInputBody() + if include_optional: + return UpsertOverridesInputBody( + var_schema = '', + overrides = { + 'key' : '' + } + ) + else: + return UpsertOverridesInputBody( + overrides = { + 'key' : '' + }, + ) + """ + + def testUpsertOverridesInputBody(self): + """Test UpsertOverridesInputBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_workflow_progress.py b/test/test_workflow_progress.py new file mode 100644 index 0000000..9cea4eb --- /dev/null +++ b/test/test_workflow_progress.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.workflow_progress import WorkflowProgress + +class TestWorkflowProgress(unittest.TestCase): + """WorkflowProgress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WorkflowProgress: + """Test WorkflowProgress + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WorkflowProgress` + """ + model = WorkflowProgress() + if include_optional: + return WorkflowProgress( + var_schema = '', + messages = [ + { } + ], + status = 'UNINITIALISED', + step = '', + step_index = 56, + steps_total = 56 + ) + else: + return WorkflowProgress( + messages = [ + { } + ], + status = 'UNINITIALISED', + step = '', + step_index = 56, + steps_total = 56, + ) + """ + + def testWorkflowProgress(self): + """Test WorkflowProgress""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()