diff --git a/.sdk-version b/.sdk-version index 8f8c6ffb..71f00aa0 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.85.0 +v3.85.1 diff --git a/README.md b/README.md index 919dec2b..ec849316 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,8 @@ Class | Method | HTTP request | Description *AnalysesResultsMetadataApi* | [**get_tags**](docs/AnalysesResultsMetadataApi.md#get_tags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score *AnalysesResultsMetadataApi* | [**get_vulnerabilities**](docs/AnalysesResultsMetadataApi.md#get_vulnerabilities) | **GET** /v2/analyses/{analysis_id}/vulnerabilities | Gets the vulnerabilities found in the analysis *AnalysesXRefsApi* | [**get_xref_by_vaddr**](docs/AnalysesXRefsApi.md#get_xref_by_vaddr) | **GET** /v2/analyses/{analysis_id}/xrefs/{vaddr} | [Beta] Look up xrefs by virtual address -*AuthenticationUsersApi* | [**get_requester_user_info**](docs/AuthenticationUsersApi.md#get_requester_user_info) | **GET** /v2/users/me | Get the requesters user information *AuthenticationUsersApi* | [**get_user**](docs/AuthenticationUsersApi.md#get_user) | **GET** /v2/users/{user_id} | Get a user's public information *AuthenticationUsersApi* | [**get_user_activity**](docs/AuthenticationUsersApi.md#get_user_activity) | **GET** /v2/users/activity | Get auth user activity -*AuthenticationUsersApi* | [**get_user_comments**](docs/AuthenticationUsersApi.md#get_user_comments) | **GET** /v2/users/me/comments | Get comments by user *AuthenticationUsersApi* | [**submit_user_feedback**](docs/AuthenticationUsersApi.md#submit_user_feedback) | **POST** /v2/users/feedback | Submit feedback about the application *BinariesApi* | [**download_zipped_binary**](docs/BinariesApi.md#download_zipped_binary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection *BinariesApi* | [**get_binary_additional_details**](docs/BinariesApi.md#get_binary_additional_details) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary @@ -132,6 +130,7 @@ Class | Method | HTTP request | Description *FunctionsAIDecompilationApi* | [**patch_ai_decompilation_inline_comment**](docs/FunctionsAIDecompilationApi.md#patch_ai_decompilation_inline_comment) | **PATCH** /v3/functions/{function_id}/ai-decompilation/inline-comments | Update a single inline comment *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* | [**stream_ai_decompilation**](docs/FunctionsAIDecompilationApi.md#stream_ai_decompilation) | **GET** /v3/functions/{function_id}/ai-decompilation/events | Stream live AI decompilation output (SSE) *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 @@ -211,6 +210,8 @@ Class | Method | HTTP request | Description - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - [AppApiRestV2InfoTypesCapability](docs/AppApiRestV2InfoTypesCapability.md) - [Argument](docs/Argument.md) + - [AttemptFailedEvent](docs/AttemptFailedEvent.md) + - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - [AutoRunAgents](docs/AutoRunAgents.md) - [AutoUnstripRequest](docs/AutoUnstripRequest.md) - [AutoUnstripResponse](docs/AutoUnstripResponse.md) @@ -257,7 +258,6 @@ Class | Method | HTTP request | Description - [BaseResponseGenerateFunctionDataTypes](docs/BaseResponseGenerateFunctionDataTypes.md) - [BaseResponseGenerationStatusList](docs/BaseResponseGenerationStatusList.md) - [BaseResponseGetAiDecompilationTask](docs/BaseResponseGetAiDecompilationTask.md) - - [BaseResponseGetMeResponse](docs/BaseResponseGetMeResponse.md) - [BaseResponseGetPublicUserResponse](docs/BaseResponseGetPublicUserResponse.md) - [BaseResponseListCalleesCallerFunctionsResponse](docs/BaseResponseListCalleesCallerFunctionsResponse.md) - [BaseResponseListCollectionResults](docs/BaseResponseListCollectionResults.md) @@ -331,6 +331,8 @@ Class | Method | HTTP request | Description - [CreateAIDecompOutputBody](docs/CreateAIDecompOutputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) - [Created](docs/Created.md) + - [DecompFailedEvent](docs/DecompFailedEvent.md) + - [DecompFinishedEvent](docs/DecompFinishedEvent.md) - [DecompilationCommentContext](docs/DecompilationCommentContext.md) - [DecompilationData](docs/DecompilationData.md) - [DieMatch](docs/DieMatch.md) @@ -351,13 +353,21 @@ Class | Method | HTTP request | Description - [ErrorBody](docs/ErrorBody.md) - [ErrorModel](docs/ErrorModel.md) - [Event](docs/Event.md) + - [EventAttemptFailed](docs/EventAttemptFailed.md) + - [EventAttemptStarted](docs/EventAttemptStarted.md) - [EventCONTEXTCOMPACTED](docs/EventCONTEXTCOMPACTED.md) + - [EventDecompFailed](docs/EventDecompFailed.md) + - [EventDecompFinished](docs/EventDecompFinished.md) + - [EventProse](docs/EventProse.md) - [EventRUNCANCELLED](docs/EventRUNCANCELLED.md) - [EventRUNERROR](docs/EventRUNERROR.md) - [EventRUNFINISHED](docs/EventRUNFINISHED.md) - [EventRUNSTARTED](docs/EventRUNSTARTED.md) + - [EventRenameApplied](docs/EventRenameApplied.md) - [EventSTEPFINISHED](docs/EventSTEPFINISHED.md) - [EventSTEPSTARTED](docs/EventSTEPSTARTED.md) + - [EventSourceDelta](docs/EventSourceDelta.md) + - [EventSourceReset](docs/EventSourceReset.md) - [EventTEXTMESSAGECONTENT](docs/EventTEXTMESSAGECONTENT.md) - [EventTEXTMESSAGEEND](docs/EventTEXTMESSAGEEND.md) - [EventTEXTMESSAGESTART](docs/EventTEXTMESSAGESTART.md) @@ -367,6 +377,7 @@ Class | Method | HTTP request | Description - [EventTOOLCALLRESULT](docs/EventTOOLCALLRESULT.md) - [EventTOOLCALLSTART](docs/EventTOOLCALLSTART.md) - [EventTOOLCONFIRMATIONREQUIRED](docs/EventTOOLCONFIRMATIONREQUIRED.md) + - [EventWarning](docs/EventWarning.md) - [ExportModel](docs/ExportModel.md) - [ExternalResponse](docs/ExternalResponse.md) - [ExtractedURL](docs/ExtractedURL.md) @@ -418,7 +429,6 @@ Class | Method | HTTP request | Description - [GenerationStatusList](docs/GenerationStatusList.md) - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAiDecompilationTask](docs/GetAiDecompilationTask.md) - - [GetMeResponse](docs/GetMeResponse.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GlobalVariable](docs/GlobalVariable.md) - [HistoryEntry](docs/HistoryEntry.md) @@ -459,6 +469,7 @@ Class | Method | HTTP request | Description - [ProcessNode](docs/ProcessNode.md) - [ProcessTree](docs/ProcessTree.md) - [ProgressMessage](docs/ProgressMessage.md) + - [ProseEvent](docs/ProseEvent.md) - [PutAnalysisStringsRequest](docs/PutAnalysisStringsRequest.md) - [QueuePositionResponse](docs/QueuePositionResponse.md) - [QueuedWorkflowTaskResponse](docs/QueuedWorkflowTaskResponse.md) @@ -468,6 +479,7 @@ Class | Method | HTTP request | Description - [RegenerateTarget](docs/RegenerateTarget.md) - [RegistryOperation](docs/RegistryOperation.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) + - [RenameAppliedEvent](docs/RenameAppliedEvent.md) - [RenameInputBody](docs/RenameInputBody.md) - [RenameOutputBody](docs/RenameOutputBody.md) - [ReplacementValue](docs/ReplacementValue.md) @@ -491,6 +503,8 @@ Class | Method | HTTP request | Description - [SingleCodeSignatureModel](docs/SingleCodeSignatureModel.md) - [SinglePDBEntryModel](docs/SinglePDBEntryModel.md) - [SingleSectionModel](docs/SingleSectionModel.md) + - [SourceDeltaEvent](docs/SourceDeltaEvent.md) + - [SourceResetEvent](docs/SourceResetEvent.md) - [SseEventContextCompactedData](docs/SseEventContextCompactedData.md) - [SseEventRunCancelledData](docs/SseEventRunCancelledData.md) - [SseEventRunErrorData](docs/SseEventRunErrorData.md) @@ -512,6 +526,7 @@ Class | Method | HTTP request | Description - [StatusInput](docs/StatusInput.md) - [StatusOutput](docs/StatusOutput.md) - [StatusResponse](docs/StatusResponse.md) + - [StreamAiDecompilation200ResponseInner](docs/StreamAiDecompilation200ResponseInner.md) - [StreamEvents200ResponseInner](docs/StreamEvents200ResponseInner.md) - [StringFunctions](docs/StringFunctions.md) - [StringSource](docs/StringSource.md) @@ -543,6 +558,7 @@ Class | Method | HTTP request | Description - [UserActivityResponse](docs/UserActivityResponse.md) - [Vulnerabilities](docs/Vulnerabilities.md) - [Vulnerability](docs/Vulnerability.md) + - [WarningEvent](docs/WarningEvent.md) - [WorkflowProgress](docs/WorkflowProgress.md) - [Workspace](docs/Workspace.md) - [XrefFromResponse](docs/XrefFromResponse.md) diff --git a/docs/AttemptFailedEvent.md b/docs/AttemptFailedEvent.md new file mode 100644 index 00000000..ffd59c67 --- /dev/null +++ b/docs/AttemptFailedEvent.md @@ -0,0 +1,32 @@ +# AttemptFailedEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**error** | **str** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.attempt_failed_event import AttemptFailedEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of AttemptFailedEvent from a JSON string +attempt_failed_event_instance = AttemptFailedEvent.from_json(json) +# print the JSON string representation of the object +print(AttemptFailedEvent.to_json()) + +# convert the object into a dict +attempt_failed_event_dict = attempt_failed_event_instance.to_dict() +# create an instance of AttemptFailedEvent from a dict +attempt_failed_event_from_dict = AttemptFailedEvent.from_dict(attempt_failed_event_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/AttemptStartedEvent.md b/docs/AttemptStartedEvent.md new file mode 100644 index 00000000..53f337ca --- /dev/null +++ b/docs/AttemptStartedEvent.md @@ -0,0 +1,31 @@ +# AttemptStartedEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.attempt_started_event import AttemptStartedEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of AttemptStartedEvent from a JSON string +attempt_started_event_instance = AttemptStartedEvent.from_json(json) +# print the JSON string representation of the object +print(AttemptStartedEvent.to_json()) + +# convert the object into a dict +attempt_started_event_dict = attempt_started_event_instance.to_dict() +# create an instance of AttemptStartedEvent from a dict +attempt_started_event_from_dict = AttemptStartedEvent.from_dict(attempt_started_event_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/AuthenticationUsersApi.md b/docs/AuthenticationUsersApi.md index ecad1ef7..9010f446 100644 --- a/docs/AuthenticationUsersApi.md +++ b/docs/AuthenticationUsersApi.md @@ -4,87 +4,11 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_requester_user_info**](AuthenticationUsersApi.md#get_requester_user_info) | **GET** /v2/users/me | Get the requesters user information [**get_user**](AuthenticationUsersApi.md#get_user) | **GET** /v2/users/{user_id} | Get a user's public information [**get_user_activity**](AuthenticationUsersApi.md#get_user_activity) | **GET** /v2/users/activity | Get auth user activity -[**get_user_comments**](AuthenticationUsersApi.md#get_user_comments) | **GET** /v2/users/me/comments | Get comments by user [**submit_user_feedback**](AuthenticationUsersApi.md#submit_user_feedback) | **POST** /v2/users/feedback | Submit feedback about the application -# **get_requester_user_info** -> BaseResponseGetMeResponse get_requester_user_info() - -Get the requesters user information - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse -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.AuthenticationUsersApi(api_client) - - try: - # Get the requesters user information - api_response = api_instance.get_requester_user_info() - print("The response of AuthenticationUsersApi->get_requester_user_info:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AuthenticationUsersApi->get_requester_user_info: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**BaseResponseGetMeResponse**](BaseResponseGetMeResponse.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_user** > BaseResponseGetPublicUserResponse get_user(user_id) @@ -237,82 +161,6 @@ This endpoint does not need any parameter. [[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_user_comments** -> BaseResponseListCommentResponse get_user_comments() - -Get comments by user - -Retrieves all comments created by a specific user. Only returns comments for resources the requesting user has access to. - -### Example - -* Api Key Authentication (APIKey): - -```python -import revengai -from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse -from revengai.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.reveng.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = revengai.Configuration( - host = "https://api.reveng.ai" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: APIKey -configuration.api_key['APIKey'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['APIKey'] = 'Bearer' - -# Enter a context with an instance of the API client -with revengai.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = revengai.AuthenticationUsersApi(api_client) - - try: - # Get comments by user - api_response = api_instance.get_user_comments() - print("The response of AuthenticationUsersApi->get_user_comments:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AuthenticationUsersApi->get_user_comments: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**BaseResponseListCommentResponse**](BaseResponseListCommentResponse.md) - -### Authorization - -[APIKey](../README.md#APIKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **submit_user_feedback** > BaseResponse submit_user_feedback(submit_user_feedback_request) diff --git a/docs/BaseResponseGetMeResponse.md b/docs/BaseResponseGetMeResponse.md deleted file mode 100644 index da9a5324..00000000 --- a/docs/BaseResponseGetMeResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseGetMeResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**GetMeResponse**](GetMeResponse.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseGetMeResponse from a JSON string -base_response_get_me_response_instance = BaseResponseGetMeResponse.from_json(json) -# print the JSON string representation of the object -print(BaseResponseGetMeResponse.to_json()) - -# convert the object into a dict -base_response_get_me_response_dict = base_response_get_me_response_instance.to_dict() -# create an instance of BaseResponseGetMeResponse from a dict -base_response_get_me_response_from_dict = BaseResponseGetMeResponse.from_dict(base_response_get_me_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DecompFailedEvent.md b/docs/DecompFailedEvent.md new file mode 100644 index 00000000..612926fd --- /dev/null +++ b/docs/DecompFailedEvent.md @@ -0,0 +1,33 @@ +# DecompFailedEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**error** | **str** | | +**error_code** | **str** | | [optional] +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.decomp_failed_event import DecompFailedEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of DecompFailedEvent from a JSON string +decomp_failed_event_instance = DecompFailedEvent.from_json(json) +# print the JSON string representation of the object +print(DecompFailedEvent.to_json()) + +# convert the object into a dict +decomp_failed_event_dict = decomp_failed_event_instance.to_dict() +# create an instance of DecompFailedEvent from a dict +decomp_failed_event_from_dict = DecompFailedEvent.from_dict(decomp_failed_event_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/DecompFinishedEvent.md b/docs/DecompFinishedEvent.md new file mode 100644 index 00000000..c6e1956b --- /dev/null +++ b/docs/DecompFinishedEvent.md @@ -0,0 +1,31 @@ +# DecompFinishedEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.decomp_finished_event import DecompFinishedEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of DecompFinishedEvent from a JSON string +decomp_finished_event_instance = DecompFinishedEvent.from_json(json) +# print the JSON string representation of the object +print(DecompFinishedEvent.to_json()) + +# convert the object into a dict +decomp_finished_event_dict = decomp_finished_event_instance.to_dict() +# create an instance of DecompFinishedEvent from a dict +decomp_finished_event_from_dict = DecompFinishedEvent.from_dict(decomp_finished_event_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/EventAttemptFailed.md b/docs/EventAttemptFailed.md new file mode 100644 index 00000000..d207dd5d --- /dev/null +++ b/docs/EventAttemptFailed.md @@ -0,0 +1,32 @@ +# EventAttemptFailed + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AttemptFailedEvent**](AttemptFailedEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_attempt_failed import EventAttemptFailed + +# TODO update the JSON string below +json = "{}" +# create an instance of EventAttemptFailed from a JSON string +event_attempt_failed_instance = EventAttemptFailed.from_json(json) +# print the JSON string representation of the object +print(EventAttemptFailed.to_json()) + +# convert the object into a dict +event_attempt_failed_dict = event_attempt_failed_instance.to_dict() +# create an instance of EventAttemptFailed from a dict +event_attempt_failed_from_dict = EventAttemptFailed.from_dict(event_attempt_failed_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/EventAttemptStarted.md b/docs/EventAttemptStarted.md new file mode 100644 index 00000000..599f00a9 --- /dev/null +++ b/docs/EventAttemptStarted.md @@ -0,0 +1,32 @@ +# EventAttemptStarted + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AttemptStartedEvent**](AttemptStartedEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_attempt_started import EventAttemptStarted + +# TODO update the JSON string below +json = "{}" +# create an instance of EventAttemptStarted from a JSON string +event_attempt_started_instance = EventAttemptStarted.from_json(json) +# print the JSON string representation of the object +print(EventAttemptStarted.to_json()) + +# convert the object into a dict +event_attempt_started_dict = event_attempt_started_instance.to_dict() +# create an instance of EventAttemptStarted from a dict +event_attempt_started_from_dict = EventAttemptStarted.from_dict(event_attempt_started_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/EventDecompFailed.md b/docs/EventDecompFailed.md new file mode 100644 index 00000000..6b5066da --- /dev/null +++ b/docs/EventDecompFailed.md @@ -0,0 +1,32 @@ +# EventDecompFailed + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**DecompFailedEvent**](DecompFailedEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_decomp_failed import EventDecompFailed + +# TODO update the JSON string below +json = "{}" +# create an instance of EventDecompFailed from a JSON string +event_decomp_failed_instance = EventDecompFailed.from_json(json) +# print the JSON string representation of the object +print(EventDecompFailed.to_json()) + +# convert the object into a dict +event_decomp_failed_dict = event_decomp_failed_instance.to_dict() +# create an instance of EventDecompFailed from a dict +event_decomp_failed_from_dict = EventDecompFailed.from_dict(event_decomp_failed_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/EventDecompFinished.md b/docs/EventDecompFinished.md new file mode 100644 index 00000000..514c765e --- /dev/null +++ b/docs/EventDecompFinished.md @@ -0,0 +1,32 @@ +# EventDecompFinished + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**DecompFinishedEvent**](DecompFinishedEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_decomp_finished import EventDecompFinished + +# TODO update the JSON string below +json = "{}" +# create an instance of EventDecompFinished from a JSON string +event_decomp_finished_instance = EventDecompFinished.from_json(json) +# print the JSON string representation of the object +print(EventDecompFinished.to_json()) + +# convert the object into a dict +event_decomp_finished_dict = event_decomp_finished_instance.to_dict() +# create an instance of EventDecompFinished from a dict +event_decomp_finished_from_dict = EventDecompFinished.from_dict(event_decomp_finished_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/EventProse.md b/docs/EventProse.md new file mode 100644 index 00000000..89b31412 --- /dev/null +++ b/docs/EventProse.md @@ -0,0 +1,32 @@ +# EventProse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ProseEvent**](ProseEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_prose import EventProse + +# TODO update the JSON string below +json = "{}" +# create an instance of EventProse from a JSON string +event_prose_instance = EventProse.from_json(json) +# print the JSON string representation of the object +print(EventProse.to_json()) + +# convert the object into a dict +event_prose_dict = event_prose_instance.to_dict() +# create an instance of EventProse from a dict +event_prose_from_dict = EventProse.from_dict(event_prose_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/EventRenameApplied.md b/docs/EventRenameApplied.md new file mode 100644 index 00000000..5621ed9a --- /dev/null +++ b/docs/EventRenameApplied.md @@ -0,0 +1,32 @@ +# EventRenameApplied + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RenameAppliedEvent**](RenameAppliedEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_rename_applied import EventRenameApplied + +# TODO update the JSON string below +json = "{}" +# create an instance of EventRenameApplied from a JSON string +event_rename_applied_instance = EventRenameApplied.from_json(json) +# print the JSON string representation of the object +print(EventRenameApplied.to_json()) + +# convert the object into a dict +event_rename_applied_dict = event_rename_applied_instance.to_dict() +# create an instance of EventRenameApplied from a dict +event_rename_applied_from_dict = EventRenameApplied.from_dict(event_rename_applied_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/EventSourceDelta.md b/docs/EventSourceDelta.md new file mode 100644 index 00000000..3b7b0a23 --- /dev/null +++ b/docs/EventSourceDelta.md @@ -0,0 +1,32 @@ +# EventSourceDelta + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**SourceDeltaEvent**](SourceDeltaEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_source_delta import EventSourceDelta + +# TODO update the JSON string below +json = "{}" +# create an instance of EventSourceDelta from a JSON string +event_source_delta_instance = EventSourceDelta.from_json(json) +# print the JSON string representation of the object +print(EventSourceDelta.to_json()) + +# convert the object into a dict +event_source_delta_dict = event_source_delta_instance.to_dict() +# create an instance of EventSourceDelta from a dict +event_source_delta_from_dict = EventSourceDelta.from_dict(event_source_delta_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/EventSourceReset.md b/docs/EventSourceReset.md new file mode 100644 index 00000000..dbe9cf0e --- /dev/null +++ b/docs/EventSourceReset.md @@ -0,0 +1,32 @@ +# EventSourceReset + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**SourceResetEvent**](SourceResetEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_source_reset import EventSourceReset + +# TODO update the JSON string below +json = "{}" +# create an instance of EventSourceReset from a JSON string +event_source_reset_instance = EventSourceReset.from_json(json) +# print the JSON string representation of the object +print(EventSourceReset.to_json()) + +# convert the object into a dict +event_source_reset_dict = event_source_reset_instance.to_dict() +# create an instance of EventSourceReset from a dict +event_source_reset_from_dict = EventSourceReset.from_dict(event_source_reset_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/EventWarning.md b/docs/EventWarning.md new file mode 100644 index 00000000..6d33665c --- /dev/null +++ b/docs/EventWarning.md @@ -0,0 +1,32 @@ +# EventWarning + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**WarningEvent**](WarningEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.event_warning import EventWarning + +# TODO update the JSON string below +json = "{}" +# create an instance of EventWarning from a JSON string +event_warning_instance = EventWarning.from_json(json) +# print the JSON string representation of the object +print(EventWarning.to_json()) + +# convert the object into a dict +event_warning_dict = event_warning_instance.to_dict() +# create an instance of EventWarning from a dict +event_warning_from_dict = EventWarning.from_dict(event_warning_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 380906b4..950849cf 100644 --- a/docs/FunctionsAIDecompilationApi.md +++ b/docs/FunctionsAIDecompilationApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**patch_ai_decompilation_inline_comment**](FunctionsAIDecompilationApi.md#patch_ai_decompilation_inline_comment) | **PATCH** /v3/functions/{function_id}/ai-decompilation/inline-comments | Update a single inline comment [**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 +[**stream_ai_decompilation**](FunctionsAIDecompilationApi.md#stream_ai_decompilation) | **GET** /v3/functions/{function_id}/ai-decompilation/events | Stream live AI decompilation output (SSE) [**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 @@ -1663,6 +1664,86 @@ 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) +# **stream_ai_decompilation** +> List[StreamAiDecompilation200ResponseInner] stream_ai_decompilation(function_id) + +Stream live AI decompilation output (SSE) + +Opens a Server-Sent Events stream of incremental decompilation events for the given function. Each event has a `type` discriminator (also used as the SSE `event:` line) and a per-attempt monotonic `seq`. Terminal events: `decomp_finished` (success) or `decomp_failed` (all retries exhausted). `attempt_failed` is per-attempt and non-terminal — Temporal may retry the activity. Clients should treat `attempt` changes as a reset signal. `last_event_id` is not supported — clients fall back to polling the standard GET endpoint after the stream ends. + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner +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: + # Stream live AI decompilation output (SSE) + api_response = api_instance.stream_ai_decompilation(function_id) + print("The response of FunctionsAIDecompilationApi->stream_ai_decompilation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->stream_ai_decompilation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**List[StreamAiDecompilation200ResponseInner]**](StreamAiDecompilation200ResponseInner.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**0** | 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) diff --git a/docs/GetMeResponse.md b/docs/GetMeResponse.md deleted file mode 100644 index a855e5c2..00000000 --- a/docs/GetMeResponse.md +++ /dev/null @@ -1,36 +0,0 @@ -# GetMeResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | | -**user_id** | **int** | | -**first_name** | **str** | | -**last_name** | **str** | | -**email** | **str** | | -**creation** | **datetime** | | -**tutorial_seen** | **bool** | | -**role** | **str** | | - -## Example - -```python -from revengai.models.get_me_response import GetMeResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of GetMeResponse from a JSON string -get_me_response_instance = GetMeResponse.from_json(json) -# print the JSON string representation of the object -print(GetMeResponse.to_json()) - -# convert the object into a dict -get_me_response_dict = get_me_response_instance.to_dict() -# create an instance of GetMeResponse from a dict -get_me_response_from_dict = GetMeResponse.from_dict(get_me_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ProseEvent.md b/docs/ProseEvent.md new file mode 100644 index 00000000..538ed1be --- /dev/null +++ b/docs/ProseEvent.md @@ -0,0 +1,32 @@ +# ProseEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**seq** | **int** | | +**text** | **str** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.prose_event import ProseEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of ProseEvent from a JSON string +prose_event_instance = ProseEvent.from_json(json) +# print the JSON string representation of the object +print(ProseEvent.to_json()) + +# convert the object into a dict +prose_event_dict = prose_event_instance.to_dict() +# create an instance of ProseEvent from a dict +prose_event_from_dict = ProseEvent.from_dict(prose_event_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/RenameAppliedEvent.md b/docs/RenameAppliedEvent.md new file mode 100644 index 00000000..394329fa --- /dev/null +++ b/docs/RenameAppliedEvent.md @@ -0,0 +1,34 @@ +# RenameAppliedEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addr_hex** | **str** | | [optional] +**attempt** | **int** | | +**new_name** | **str** | | +**old_name** | **str** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.rename_applied_event import RenameAppliedEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of RenameAppliedEvent from a JSON string +rename_applied_event_instance = RenameAppliedEvent.from_json(json) +# print the JSON string representation of the object +print(RenameAppliedEvent.to_json()) + +# convert the object into a dict +rename_applied_event_dict = rename_applied_event_instance.to_dict() +# create an instance of RenameAppliedEvent from a dict +rename_applied_event_from_dict = RenameAppliedEvent.from_dict(rename_applied_event_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/SourceDeltaEvent.md b/docs/SourceDeltaEvent.md new file mode 100644 index 00000000..050d1752 --- /dev/null +++ b/docs/SourceDeltaEvent.md @@ -0,0 +1,32 @@ +# SourceDeltaEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**content** | **str** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.source_delta_event import SourceDeltaEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of SourceDeltaEvent from a JSON string +source_delta_event_instance = SourceDeltaEvent.from_json(json) +# print the JSON string representation of the object +print(SourceDeltaEvent.to_json()) + +# convert the object into a dict +source_delta_event_dict = source_delta_event_instance.to_dict() +# create an instance of SourceDeltaEvent from a dict +source_delta_event_from_dict = SourceDeltaEvent.from_dict(source_delta_event_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/SourceResetEvent.md b/docs/SourceResetEvent.md new file mode 100644 index 00000000..e9d157a3 --- /dev/null +++ b/docs/SourceResetEvent.md @@ -0,0 +1,31 @@ +# SourceResetEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.source_reset_event import SourceResetEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of SourceResetEvent from a JSON string +source_reset_event_instance = SourceResetEvent.from_json(json) +# print the JSON string representation of the object +print(SourceResetEvent.to_json()) + +# convert the object into a dict +source_reset_event_dict = source_reset_event_instance.to_dict() +# create an instance of SourceResetEvent from a dict +source_reset_event_from_dict = SourceResetEvent.from_dict(source_reset_event_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/StreamAiDecompilation200ResponseInner.md b/docs/StreamAiDecompilation200ResponseInner.md new file mode 100644 index 00000000..a81447ca --- /dev/null +++ b/docs/StreamAiDecompilation200ResponseInner.md @@ -0,0 +1,32 @@ +# StreamAiDecompilation200ResponseInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**WarningEvent**](WarningEvent.md) | | +**event** | **str** | The event name. | +**id** | **int** | The event ID. | [optional] +**retry** | **int** | The retry time in milliseconds. | [optional] + +## Example + +```python +from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner + +# TODO update the JSON string below +json = "{}" +# create an instance of StreamAiDecompilation200ResponseInner from a JSON string +stream_ai_decompilation200_response_inner_instance = StreamAiDecompilation200ResponseInner.from_json(json) +# print the JSON string representation of the object +print(StreamAiDecompilation200ResponseInner.to_json()) + +# convert the object into a dict +stream_ai_decompilation200_response_inner_dict = stream_ai_decompilation200_response_inner_instance.to_dict() +# create an instance of StreamAiDecompilation200ResponseInner from a dict +stream_ai_decompilation200_response_inner_from_dict = StreamAiDecompilation200ResponseInner.from_dict(stream_ai_decompilation200_response_inner_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/WarningEvent.md b/docs/WarningEvent.md new file mode 100644 index 00000000..2c95f7f9 --- /dev/null +++ b/docs/WarningEvent.md @@ -0,0 +1,34 @@ +# WarningEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attempt** | **int** | | +**identifiers** | **List[str]** | | [optional] +**kind** | **str** | | +**message** | **str** | | +**seq** | **int** | | +**type** | **str** | | + +## Example + +```python +from revengai.models.warning_event import WarningEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of WarningEvent from a JSON string +warning_event_instance = WarningEvent.from_json(json) +# print the JSON string representation of the object +print(WarningEvent.to_json()) + +# convert the object into a dict +warning_event_dict = warning_event_instance.to_dict() +# create an instance of WarningEvent from a dict +warning_event_from_dict = WarningEvent.from_dict(warning_event_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 9b53e6bc..7744ebec 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.85.0" +__version__ = "v3.85.1" # Define package exports __all__ = [ @@ -82,6 +82,8 @@ "AppApiRestV2FunctionsTypesFunction", "AppApiRestV2InfoTypesCapability", "Argument", + "AttemptFailedEvent", + "AttemptStartedEvent", "AutoRunAgents", "AutoUnstripRequest", "AutoUnstripResponse", @@ -128,7 +130,6 @@ "BaseResponseGenerateFunctionDataTypes", "BaseResponseGenerationStatusList", "BaseResponseGetAiDecompilationTask", - "BaseResponseGetMeResponse", "BaseResponseGetPublicUserResponse", "BaseResponseListCalleesCallerFunctionsResponse", "BaseResponseListCollectionResults", @@ -202,6 +203,8 @@ "CreateAIDecompOutputBody", "CreateConversationRequest", "Created", + "DecompFailedEvent", + "DecompFinishedEvent", "DecompilationCommentContext", "DecompilationData", "DieMatch", @@ -222,13 +225,21 @@ "ErrorBody", "ErrorModel", "Event", + "EventAttemptFailed", + "EventAttemptStarted", "EventCONTEXTCOMPACTED", + "EventDecompFailed", + "EventDecompFinished", + "EventProse", "EventRUNCANCELLED", "EventRUNERROR", "EventRUNFINISHED", "EventRUNSTARTED", + "EventRenameApplied", "EventSTEPFINISHED", "EventSTEPSTARTED", + "EventSourceDelta", + "EventSourceReset", "EventTEXTMESSAGECONTENT", "EventTEXTMESSAGEEND", "EventTEXTMESSAGESTART", @@ -238,6 +249,7 @@ "EventTOOLCALLRESULT", "EventTOOLCALLSTART", "EventTOOLCONFIRMATIONREQUIRED", + "EventWarning", "ExportModel", "ExternalResponse", "ExtractedURL", @@ -289,7 +301,6 @@ "GenerationStatusList", "GetAiDecompilationRatingResponse", "GetAiDecompilationTask", - "GetMeResponse", "GetPublicUserResponse", "GlobalVariable", "HistoryEntry", @@ -330,6 +341,7 @@ "ProcessNode", "ProcessTree", "ProgressMessage", + "ProseEvent", "PutAnalysisStringsRequest", "QueuePositionResponse", "QueuedWorkflowTaskResponse", @@ -339,6 +351,7 @@ "RegenerateTarget", "RegistryOperation", "RelativeBinaryResponse", + "RenameAppliedEvent", "RenameInputBody", "RenameOutputBody", "ReplacementValue", @@ -362,6 +375,8 @@ "SingleCodeSignatureModel", "SinglePDBEntryModel", "SingleSectionModel", + "SourceDeltaEvent", + "SourceResetEvent", "SseEventContextCompactedData", "SseEventRunCancelledData", "SseEventRunErrorData", @@ -383,6 +398,7 @@ "StatusInput", "StatusOutput", "StatusResponse", + "StreamAiDecompilation200ResponseInner", "StreamEvents200ResponseInner", "StringFunctions", "StringSource", @@ -414,6 +430,7 @@ "UserActivityResponse", "Vulnerabilities", "Vulnerability", + "WarningEvent", "WorkflowProgress", "Workspace", "XrefFromResponse", @@ -491,6 +508,8 @@ from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction as AppApiRestV2FunctionsTypesFunction from revengai.models.app_api_rest_v2_info_types_capability import AppApiRestV2InfoTypesCapability as AppApiRestV2InfoTypesCapability from revengai.models.argument import Argument as Argument +from revengai.models.attempt_failed_event import AttemptFailedEvent as AttemptFailedEvent +from revengai.models.attempt_started_event import AttemptStartedEvent as AttemptStartedEvent from revengai.models.auto_run_agents import AutoRunAgents as AutoRunAgents from revengai.models.auto_unstrip_request import AutoUnstripRequest as AutoUnstripRequest from revengai.models.auto_unstrip_response import AutoUnstripResponse as AutoUnstripResponse @@ -537,7 +556,6 @@ from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes as BaseResponseGenerateFunctionDataTypes from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList as BaseResponseGenerationStatusList from revengai.models.base_response_get_ai_decompilation_task import BaseResponseGetAiDecompilationTask as BaseResponseGetAiDecompilationTask -from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse as BaseResponseGetMeResponse from revengai.models.base_response_get_public_user_response import BaseResponseGetPublicUserResponse as BaseResponseGetPublicUserResponse from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse as BaseResponseListCalleesCallerFunctionsResponse from revengai.models.base_response_list_collection_results import BaseResponseListCollectionResults as BaseResponseListCollectionResults @@ -611,6 +629,8 @@ 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.decomp_failed_event import DecompFailedEvent as DecompFailedEvent +from revengai.models.decomp_finished_event import DecompFinishedEvent as DecompFinishedEvent 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 @@ -631,13 +651,21 @@ from revengai.models.error_body import ErrorBody as ErrorBody from revengai.models.error_model import ErrorModel as ErrorModel from revengai.models.event import Event as Event +from revengai.models.event_attempt_failed import EventAttemptFailed as EventAttemptFailed +from revengai.models.event_attempt_started import EventAttemptStarted as EventAttemptStarted from revengai.models.event_contextcompacted import EventCONTEXTCOMPACTED as EventCONTEXTCOMPACTED +from revengai.models.event_decomp_failed import EventDecompFailed as EventDecompFailed +from revengai.models.event_decomp_finished import EventDecompFinished as EventDecompFinished +from revengai.models.event_prose import EventProse as EventProse from revengai.models.event_runcancelled import EventRUNCANCELLED as EventRUNCANCELLED from revengai.models.event_runerror import EventRUNERROR as EventRUNERROR from revengai.models.event_runfinished import EventRUNFINISHED as EventRUNFINISHED from revengai.models.event_runstarted import EventRUNSTARTED as EventRUNSTARTED +from revengai.models.event_rename_applied import EventRenameApplied as EventRenameApplied from revengai.models.event_stepfinished import EventSTEPFINISHED as EventSTEPFINISHED from revengai.models.event_stepstarted import EventSTEPSTARTED as EventSTEPSTARTED +from revengai.models.event_source_delta import EventSourceDelta as EventSourceDelta +from revengai.models.event_source_reset import EventSourceReset as EventSourceReset from revengai.models.event_textmessagecontent import EventTEXTMESSAGECONTENT as EventTEXTMESSAGECONTENT from revengai.models.event_textmessageend import EventTEXTMESSAGEEND as EventTEXTMESSAGEEND from revengai.models.event_textmessagestart import EventTEXTMESSAGESTART as EventTEXTMESSAGESTART @@ -647,6 +675,7 @@ from revengai.models.event_toolcallresult import EventTOOLCALLRESULT as EventTOOLCALLRESULT from revengai.models.event_toolcallstart import EventTOOLCALLSTART as EventTOOLCALLSTART from revengai.models.event_toolconfirmationrequired import EventTOOLCONFIRMATIONREQUIRED as EventTOOLCONFIRMATIONREQUIRED +from revengai.models.event_warning import EventWarning as EventWarning from revengai.models.export_model import ExportModel as ExportModel from revengai.models.external_response import ExternalResponse as ExternalResponse from revengai.models.extracted_url import ExtractedURL as ExtractedURL @@ -698,7 +727,6 @@ from revengai.models.generation_status_list import GenerationStatusList as GenerationStatusList from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse as GetAiDecompilationRatingResponse from revengai.models.get_ai_decompilation_task import GetAiDecompilationTask as GetAiDecompilationTask -from revengai.models.get_me_response import GetMeResponse as GetMeResponse from revengai.models.get_public_user_response import GetPublicUserResponse as GetPublicUserResponse from revengai.models.global_variable import GlobalVariable as GlobalVariable from revengai.models.history_entry import HistoryEntry as HistoryEntry @@ -739,6 +767,7 @@ 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.prose_event import ProseEvent as ProseEvent 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 @@ -748,6 +777,7 @@ from revengai.models.regenerate_target import RegenerateTarget as RegenerateTarget from revengai.models.registry_operation import RegistryOperation as RegistryOperation from revengai.models.relative_binary_response import RelativeBinaryResponse as RelativeBinaryResponse +from revengai.models.rename_applied_event import RenameAppliedEvent as RenameAppliedEvent from revengai.models.rename_input_body import RenameInputBody as RenameInputBody from revengai.models.rename_output_body import RenameOutputBody as RenameOutputBody from revengai.models.replacement_value import ReplacementValue as ReplacementValue @@ -771,6 +801,8 @@ from revengai.models.single_code_signature_model import SingleCodeSignatureModel as SingleCodeSignatureModel from revengai.models.single_pdb_entry_model import SinglePDBEntryModel as SinglePDBEntryModel from revengai.models.single_section_model import SingleSectionModel as SingleSectionModel +from revengai.models.source_delta_event import SourceDeltaEvent as SourceDeltaEvent +from revengai.models.source_reset_event import SourceResetEvent as SourceResetEvent from revengai.models.sse_event_context_compacted_data import SseEventContextCompactedData as SseEventContextCompactedData from revengai.models.sse_event_run_cancelled_data import SseEventRunCancelledData as SseEventRunCancelledData from revengai.models.sse_event_run_error_data import SseEventRunErrorData as SseEventRunErrorData @@ -792,6 +824,7 @@ from revengai.models.status_input import StatusInput as StatusInput from revengai.models.status_output import StatusOutput as StatusOutput from revengai.models.status_response import StatusResponse as StatusResponse +from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner as StreamAiDecompilation200ResponseInner from revengai.models.stream_events200_response_inner import StreamEvents200ResponseInner as StreamEvents200ResponseInner from revengai.models.string_functions import StringFunctions as StringFunctions from revengai.models.string_source import StringSource as StringSource @@ -823,6 +856,7 @@ 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.warning_event import WarningEvent as WarningEvent 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 diff --git a/revengai/api/authentication_users_api.py b/revengai/api/authentication_users_api.py index 0124baa0..d0f154c4 100644 --- a/revengai/api/authentication_users_api.py +++ b/revengai/api/authentication_users_api.py @@ -17,9 +17,7 @@ from pydantic import StrictInt from revengai.models.base_response import BaseResponse -from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse from revengai.models.base_response_get_public_user_response import BaseResponseGetPublicUserResponse -from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse from revengai.models.base_response_list_user_activity_response import BaseResponseListUserActivityResponse from revengai.models.submit_user_feedback_request import SubmitUserFeedbackRequest @@ -41,252 +39,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call - def get_requester_user_info( - self, - _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, - ) -> BaseResponseGetMeResponse: - """Get the requesters user information - - - :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_requester_user_info_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetMeResponse", - '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_requester_user_info_with_http_info( - self, - _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[BaseResponseGetMeResponse]: - """Get the requesters user information - - - :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_requester_user_info_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetMeResponse", - '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_requester_user_info_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the requesters user information - - - :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_requester_user_info_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetMeResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_requester_user_info_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # 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/users/me', - 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_user( self, @@ -794,255 +546,6 @@ def _get_user_activity_serialize( - @validate_call - def get_user_comments( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseListCommentResponse: - """Get comments by user - - Retrieves all comments created by a specific user. Only returns comments for resources the requesting user has access to. - - :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_user_comments_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_user_comments_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseListCommentResponse]: - """Get comments by user - - Retrieves all comments created by a specific user. Only returns comments for resources the requesting user has access to. - - :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_user_comments_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_user_comments_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get comments by user - - Retrieves all comments created by a specific user. Only returns comments for resources the requesting user has access to. - - :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_user_comments_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCommentResponse", - '422': "BaseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_user_comments_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # 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/users/me/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 submit_user_feedback( self, diff --git a/revengai/api/functions_ai_decompilation_api.py b/revengai/api/functions_ai_decompilation_api.py index 6d321fde..ab541abc 100644 --- a/revengai/api/functions_ai_decompilation_api.py +++ b/revengai/api/functions_ai_decompilation_api.py @@ -33,6 +33,7 @@ from revengai.models.patch_comment_body import PatchCommentBody from revengai.models.regenerate_output_body import RegenerateOutputBody from revengai.models.regenerate_target import RegenerateTarget +from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner from revengai.models.summary_data import SummaryData from revengai.models.tokenised_data import TokenisedData from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest @@ -5387,6 +5388,268 @@ def _regenerate_ai_decompilation_summary_serialize( + @validate_call + def stream_ai_decompilation( + 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, + ) -> List[StreamAiDecompilation200ResponseInner]: + """Stream live AI decompilation output (SSE) + + Opens a Server-Sent Events stream of incremental decompilation events for the given function. Each event has a `type` discriminator (also used as the SSE `event:` line) and a per-attempt monotonic `seq`. Terminal events: `decomp_finished` (success) or `decomp_failed` (all retries exhausted). `attempt_failed` is per-attempt and non-terminal — Temporal may retry the activity. Clients should treat `attempt` changes as a reset signal. `last_event_id` is not supported — clients fall back to polling the standard GET endpoint after the stream ends. + + :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._stream_ai_decompilation_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': "List[StreamAiDecompilation200ResponseInner]", + } + 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 stream_ai_decompilation_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[List[StreamAiDecompilation200ResponseInner]]: + """Stream live AI decompilation output (SSE) + + Opens a Server-Sent Events stream of incremental decompilation events for the given function. Each event has a `type` discriminator (also used as the SSE `event:` line) and a per-attempt monotonic `seq`. Terminal events: `decomp_finished` (success) or `decomp_failed` (all retries exhausted). `attempt_failed` is per-attempt and non-terminal — Temporal may retry the activity. Clients should treat `attempt` changes as a reset signal. `last_event_id` is not supported — clients fall back to polling the standard GET endpoint after the stream ends. + + :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._stream_ai_decompilation_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': "List[StreamAiDecompilation200ResponseInner]", + } + 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 stream_ai_decompilation_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: + """Stream live AI decompilation output (SSE) + + Opens a Server-Sent Events stream of incremental decompilation events for the given function. Each event has a `type` discriminator (also used as the SSE `event:` line) and a per-attempt monotonic `seq`. Terminal events: `decomp_finished` (success) or `decomp_failed` (all retries exhausted). `attempt_failed` is per-attempt and non-terminal — Temporal may retry the activity. Clients should treat `attempt` changes as a reset signal. `last_event_id` is not supported — clients fall back to polling the standard GET endpoint after the stream ends. + + :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._stream_ai_decompilation_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': "List[StreamAiDecompilation200ResponseInner]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stream_ai_decompilation_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( + [ + 'text/event-stream', + '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/events', + 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, diff --git a/revengai/api_client.py b/revengai/api_client.py index 7bb6f419..315519f2 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.85.0/python' + self.user_agent = 'OpenAPI-Generator/v3.85.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 15f4774a..739aa3fe 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.85.0\n"\ - "SDK Package Version: v3.85.0".\ + "Version of the API: v3.85.1\n"\ + "SDK Package Version: v3.85.1".\ 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 1b7126dc..12c34e31 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -48,6 +48,8 @@ from revengai.models.app_api_rest_v2_functions_types_function import AppApiRestV2FunctionsTypesFunction from revengai.models.app_api_rest_v2_info_types_capability import AppApiRestV2InfoTypesCapability from revengai.models.argument import Argument +from revengai.models.attempt_failed_event import AttemptFailedEvent +from revengai.models.attempt_started_event import AttemptStartedEvent from revengai.models.auto_run_agents import AutoRunAgents from revengai.models.auto_unstrip_request import AutoUnstripRequest from revengai.models.auto_unstrip_response import AutoUnstripResponse @@ -94,7 +96,6 @@ from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList from revengai.models.base_response_get_ai_decompilation_task import BaseResponseGetAiDecompilationTask -from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse from revengai.models.base_response_get_public_user_response import BaseResponseGetPublicUserResponse from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse from revengai.models.base_response_list_collection_results import BaseResponseListCollectionResults @@ -168,6 +169,8 @@ 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.decomp_failed_event import DecompFailedEvent +from revengai.models.decomp_finished_event import DecompFinishedEvent from revengai.models.decompilation_comment_context import DecompilationCommentContext from revengai.models.decompilation_data import DecompilationData from revengai.models.die_match import DieMatch @@ -188,13 +191,21 @@ from revengai.models.error_body import ErrorBody from revengai.models.error_model import ErrorModel from revengai.models.event import Event +from revengai.models.event_attempt_failed import EventAttemptFailed +from revengai.models.event_attempt_started import EventAttemptStarted from revengai.models.event_contextcompacted import EventCONTEXTCOMPACTED +from revengai.models.event_decomp_failed import EventDecompFailed +from revengai.models.event_decomp_finished import EventDecompFinished +from revengai.models.event_prose import EventProse from revengai.models.event_runcancelled import EventRUNCANCELLED from revengai.models.event_runerror import EventRUNERROR from revengai.models.event_runfinished import EventRUNFINISHED from revengai.models.event_runstarted import EventRUNSTARTED +from revengai.models.event_rename_applied import EventRenameApplied from revengai.models.event_stepfinished import EventSTEPFINISHED from revengai.models.event_stepstarted import EventSTEPSTARTED +from revengai.models.event_source_delta import EventSourceDelta +from revengai.models.event_source_reset import EventSourceReset from revengai.models.event_textmessagecontent import EventTEXTMESSAGECONTENT from revengai.models.event_textmessageend import EventTEXTMESSAGEEND from revengai.models.event_textmessagestart import EventTEXTMESSAGESTART @@ -204,6 +215,7 @@ from revengai.models.event_toolcallresult import EventTOOLCALLRESULT from revengai.models.event_toolcallstart import EventTOOLCALLSTART from revengai.models.event_toolconfirmationrequired import EventTOOLCONFIRMATIONREQUIRED +from revengai.models.event_warning import EventWarning from revengai.models.export_model import ExportModel from revengai.models.external_response import ExternalResponse from revengai.models.extracted_url import ExtractedURL @@ -255,7 +267,6 @@ from revengai.models.generation_status_list import GenerationStatusList from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse from revengai.models.get_ai_decompilation_task import GetAiDecompilationTask -from revengai.models.get_me_response import GetMeResponse from revengai.models.get_public_user_response import GetPublicUserResponse from revengai.models.global_variable import GlobalVariable from revengai.models.history_entry import HistoryEntry @@ -296,6 +307,7 @@ from revengai.models.process_node import ProcessNode from revengai.models.process_tree import ProcessTree from revengai.models.progress_message import ProgressMessage +from revengai.models.prose_event import ProseEvent 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 @@ -305,6 +317,7 @@ from revengai.models.regenerate_target import RegenerateTarget from revengai.models.registry_operation import RegistryOperation from revengai.models.relative_binary_response import RelativeBinaryResponse +from revengai.models.rename_applied_event import RenameAppliedEvent from revengai.models.rename_input_body import RenameInputBody from revengai.models.rename_output_body import RenameOutputBody from revengai.models.replacement_value import ReplacementValue @@ -328,6 +341,8 @@ from revengai.models.single_code_signature_model import SingleCodeSignatureModel from revengai.models.single_pdb_entry_model import SinglePDBEntryModel from revengai.models.single_section_model import SingleSectionModel +from revengai.models.source_delta_event import SourceDeltaEvent +from revengai.models.source_reset_event import SourceResetEvent from revengai.models.sse_event_context_compacted_data import SseEventContextCompactedData from revengai.models.sse_event_run_cancelled_data import SseEventRunCancelledData from revengai.models.sse_event_run_error_data import SseEventRunErrorData @@ -349,6 +364,7 @@ from revengai.models.status_input import StatusInput from revengai.models.status_output import StatusOutput from revengai.models.status_response import StatusResponse +from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner from revengai.models.stream_events200_response_inner import StreamEvents200ResponseInner from revengai.models.string_functions import StringFunctions from revengai.models.string_source import StringSource @@ -380,6 +396,7 @@ from revengai.models.user_activity_response import UserActivityResponse from revengai.models.vulnerabilities import Vulnerabilities from revengai.models.vulnerability import Vulnerability +from revengai.models.warning_event import WarningEvent from revengai.models.workflow_progress import WorkflowProgress from revengai.models.workspace import Workspace from revengai.models.xref_from_response import XrefFromResponse diff --git a/revengai/models/attempt_failed_event.py b/revengai/models/attempt_failed_event.py new file mode 100644 index 00000000..c76ba67f --- /dev/null +++ b/revengai/models/attempt_failed_event.py @@ -0,0 +1,105 @@ +# 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 AttemptFailedEvent(BaseModel): + """ + AttemptFailedEvent + """ # noqa: E501 + attempt: StrictInt + error: StrictStr + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "error", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttemptFailedEvent 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 AttemptFailedEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "error": obj.get("error"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/attempt_started_event.py b/revengai/models/attempt_started_event.py new file mode 100644 index 00000000..057023aa --- /dev/null +++ b/revengai/models/attempt_started_event.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AttemptStartedEvent(BaseModel): + """ + AttemptStartedEvent + """ # noqa: E501 + attempt: StrictInt + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttemptStartedEvent 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 AttemptStartedEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/decomp_failed_event.py b/revengai/models/decomp_failed_event.py new file mode 100644 index 00000000..9d26a19c --- /dev/null +++ b/revengai/models/decomp_failed_event.py @@ -0,0 +1,107 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DecompFailedEvent(BaseModel): + """ + DecompFailedEvent + """ # noqa: E501 + attempt: StrictInt + error: StrictStr + error_code: Optional[StrictStr] = None + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "error", "error_code", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DecompFailedEvent 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 DecompFailedEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "error": obj.get("error"), + "error_code": obj.get("error_code"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/decomp_finished_event.py b/revengai/models/decomp_finished_event.py new file mode 100644 index 00000000..06be0dd9 --- /dev/null +++ b/revengai/models/decomp_finished_event.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class DecompFinishedEvent(BaseModel): + """ + DecompFinishedEvent + """ # noqa: E501 + attempt: StrictInt + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DecompFinishedEvent 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 DecompFinishedEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/event_attempt_failed.py b/revengai/models/event_attempt_failed.py new file mode 100644 index 00000000..1e4491ff --- /dev/null +++ b/revengai/models/event_attempt_failed.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.attempt_failed_event import AttemptFailedEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventAttemptFailed(BaseModel): + """ + EventAttemptFailed + """ # noqa: E501 + data: AttemptFailedEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['attempt_failed', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('attempt_failed', 'unknown_default_open_api')") + 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 EventAttemptFailed from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventAttemptFailed from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": AttemptFailedEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/event_attempt_started.py b/revengai/models/event_attempt_started.py new file mode 100644 index 00000000..481da356 --- /dev/null +++ b/revengai/models/event_attempt_started.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.attempt_started_event import AttemptStartedEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventAttemptStarted(BaseModel): + """ + EventAttemptStarted + """ # noqa: E501 + data: AttemptStartedEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['attempt_started', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('attempt_started', 'unknown_default_open_api')") + 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 EventAttemptStarted from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventAttemptStarted from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": AttemptStartedEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/event_decomp_failed.py b/revengai/models/event_decomp_failed.py new file mode 100644 index 00000000..9e01a92a --- /dev/null +++ b/revengai/models/event_decomp_failed.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.decomp_failed_event import DecompFailedEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventDecompFailed(BaseModel): + """ + EventDecompFailed + """ # noqa: E501 + data: DecompFailedEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['decomp_failed', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('decomp_failed', 'unknown_default_open_api')") + 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 EventDecompFailed from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventDecompFailed from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": DecompFailedEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/event_decomp_finished.py b/revengai/models/event_decomp_finished.py new file mode 100644 index 00000000..79a58897 --- /dev/null +++ b/revengai/models/event_decomp_finished.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.decomp_finished_event import DecompFinishedEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventDecompFinished(BaseModel): + """ + EventDecompFinished + """ # noqa: E501 + data: DecompFinishedEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['decomp_finished', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('decomp_finished', 'unknown_default_open_api')") + 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 EventDecompFinished from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventDecompFinished from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": DecompFinishedEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/get_me_response.py b/revengai/models/event_prose.py similarity index 63% rename from revengai/models/get_me_response.py rename to revengai/models/event_prose.py index 4eb1fd47..3baccc62 100644 --- a/revengai/models/get_me_response.py +++ b/revengai/models/event_prose.py @@ -16,31 +16,27 @@ import re # noqa: F401 import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.prose_event import ProseEvent from typing import Optional, Set from typing_extensions import Self -class GetMeResponse(BaseModel): +class EventProse(BaseModel): """ - GetMeResponse + EventProse """ # noqa: E501 - username: StrictStr - user_id: StrictInt - first_name: StrictStr - last_name: StrictStr - email: StrictStr - creation: datetime - tutorial_seen: StrictBool - role: StrictStr - __properties: ClassVar[List[str]] = ["username", "user_id", "first_name", "last_name", "email", "creation", "tutorial_seen", "role"] - - @field_validator('role') - def role_validate_enum(cls, value): + data: ProseEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): """Validates the enum""" - if value not in set(['USER', 'ADMIN', 'SUPERADMIN', 'SYSTEM', 'unknown_default_open_api']): - raise ValueError("must be one of enum values ('USER', 'ADMIN', 'SUPERADMIN', 'SYSTEM', 'unknown_default_open_api')") + if value not in set(['prose', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('prose', 'unknown_default_open_api')") return value model_config = ConfigDict( @@ -61,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GetMeResponse from a JSON string""" + """Create an instance of EventProse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,11 +78,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetMeResponse from a dict""" + """Create an instance of EventProse from a dict""" if obj is None: return None @@ -94,14 +93,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "username": obj.get("username"), - "user_id": obj.get("user_id"), - "first_name": obj.get("first_name"), - "last_name": obj.get("last_name"), - "email": obj.get("email"), - "creation": obj.get("creation"), - "tutorial_seen": obj.get("tutorial_seen"), - "role": obj.get("role") + "data": ProseEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") }) return _obj diff --git a/revengai/models/event_rename_applied.py b/revengai/models/event_rename_applied.py new file mode 100644 index 00000000..4d4f3221 --- /dev/null +++ b/revengai/models/event_rename_applied.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.rename_applied_event import RenameAppliedEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventRenameApplied(BaseModel): + """ + EventRenameApplied + """ # noqa: E501 + data: RenameAppliedEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['rename_applied', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('rename_applied', 'unknown_default_open_api')") + 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 EventRenameApplied from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventRenameApplied from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": RenameAppliedEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/base_response_get_me_response.py b/revengai/models/event_source_delta.py similarity index 50% rename from revengai/models/base_response_get_me_response.py rename to revengai/models/event_source_delta.py index b842e55a..e5a84384 100644 --- a/revengai/models/base_response_get_me_response.py +++ b/revengai/models/event_source_delta.py @@ -16,24 +16,28 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.get_me_response import GetMeResponse -from revengai.models.meta_model import MetaModel +from revengai.models.source_delta_event import SourceDeltaEvent from typing import Optional, Set from typing_extensions import Self -class BaseResponseGetMeResponse(BaseModel): +class EventSourceDelta(BaseModel): """ - BaseResponseGetMeResponse + EventSourceDelta """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[GetMeResponse] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] + data: SourceDeltaEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['source_delta', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('source_delta', 'unknown_default_open_api')") + return value model_config = ConfigDict( populate_by_name=True, @@ -53,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseGetMeResponse from a JSON string""" + """Create an instance of EventSourceDelta from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,36 +81,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of data if self.data: _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseGetMeResponse from a dict""" + """Create an instance of EventSourceDelta from a dict""" if obj is None: return None @@ -114,11 +93,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": GetMeResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None + "data": SourceDeltaEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") }) return _obj diff --git a/revengai/models/event_source_reset.py b/revengai/models/event_source_reset.py new file mode 100644 index 00000000..4ae72f59 --- /dev/null +++ b/revengai/models/event_source_reset.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.source_reset_event import SourceResetEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventSourceReset(BaseModel): + """ + EventSourceReset + """ # noqa: E501 + data: SourceResetEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['source_reset', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('source_reset', 'unknown_default_open_api')") + 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 EventSourceReset from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventSourceReset from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": SourceResetEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/event_warning.py b/revengai/models/event_warning.py new file mode 100644 index 00000000..69444ab7 --- /dev/null +++ b/revengai/models/event_warning.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.warning_event import WarningEvent +from typing import Optional, Set +from typing_extensions import Self + +class EventWarning(BaseModel): + """ + EventWarning + """ # noqa: E501 + data: WarningEvent + event: StrictStr = Field(description="The event name.") + id: Optional[StrictInt] = Field(default=None, description="The event ID.") + retry: Optional[StrictInt] = Field(default=None, description="The retry time in milliseconds.") + __properties: ClassVar[List[str]] = ["data", "event", "id", "retry"] + + @field_validator('event') + def event_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['warning', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('warning', 'unknown_default_open_api')") + 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 EventWarning from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventWarning from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": WarningEvent.from_dict(obj["data"]) if obj.get("data") is not None else None, + "event": obj.get("event"), + "id": obj.get("id"), + "retry": obj.get("retry") + }) + return _obj + + diff --git a/revengai/models/prose_event.py b/revengai/models/prose_event.py new file mode 100644 index 00000000..7a4f3e2d --- /dev/null +++ b/revengai/models/prose_event.py @@ -0,0 +1,105 @@ +# 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 ProseEvent(BaseModel): + """ + ProseEvent + """ # noqa: E501 + attempt: StrictInt + seq: StrictInt + text: StrictStr + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "seq", "text", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProseEvent 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 ProseEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "seq": obj.get("seq"), + "text": obj.get("text"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/rename_applied_event.py b/revengai/models/rename_applied_event.py new file mode 100644 index 00000000..1b0af624 --- /dev/null +++ b/revengai/models/rename_applied_event.py @@ -0,0 +1,109 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RenameAppliedEvent(BaseModel): + """ + RenameAppliedEvent + """ # noqa: E501 + addr_hex: Optional[StrictStr] = None + attempt: StrictInt + new_name: StrictStr + old_name: StrictStr + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["addr_hex", "attempt", "new_name", "old_name", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RenameAppliedEvent 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 RenameAppliedEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "addr_hex": obj.get("addr_hex"), + "attempt": obj.get("attempt"), + "new_name": obj.get("new_name"), + "old_name": obj.get("old_name"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/source_delta_event.py b/revengai/models/source_delta_event.py new file mode 100644 index 00000000..b8209353 --- /dev/null +++ b/revengai/models/source_delta_event.py @@ -0,0 +1,105 @@ +# 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 SourceDeltaEvent(BaseModel): + """ + SourceDeltaEvent + """ # noqa: E501 + attempt: StrictInt + content: StrictStr + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "content", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceDeltaEvent 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 SourceDeltaEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "content": obj.get("content"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/source_reset_event.py b/revengai/models/source_reset_event.py new file mode 100644 index 00000000..6cf744fd --- /dev/null +++ b/revengai/models/source_reset_event.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SourceResetEvent(BaseModel): + """ + SourceResetEvent + """ # noqa: E501 + attempt: StrictInt + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceResetEvent 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 SourceResetEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/stream_ai_decompilation200_response_inner.py b/revengai/models/stream_ai_decompilation200_response_inner.py new file mode 100644 index 00000000..88ab1c02 --- /dev/null +++ b/revengai/models/stream_ai_decompilation200_response_inner.py @@ -0,0 +1,234 @@ +# 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from revengai.models.event_attempt_failed import EventAttemptFailed +from revengai.models.event_attempt_started import EventAttemptStarted +from revengai.models.event_decomp_failed import EventDecompFailed +from revengai.models.event_decomp_finished import EventDecompFinished +from revengai.models.event_prose import EventProse +from revengai.models.event_rename_applied import EventRenameApplied +from revengai.models.event_source_delta import EventSourceDelta +from revengai.models.event_source_reset import EventSourceReset +from revengai.models.event_warning import EventWarning +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +STREAMAIDECOMPILATION200RESPONSEINNER_ONE_OF_SCHEMAS = ["EventAttemptFailed", "EventAttemptStarted", "EventDecompFailed", "EventDecompFinished", "EventProse", "EventRenameApplied", "EventSourceDelta", "EventSourceReset", "EventWarning"] + +class StreamAiDecompilation200ResponseInner(BaseModel): + """ + StreamAiDecompilation200ResponseInner + """ + # data type: EventAttemptFailed + oneof_schema_1_validator: Optional[EventAttemptFailed] = None + # data type: EventAttemptStarted + oneof_schema_2_validator: Optional[EventAttemptStarted] = None + # data type: EventDecompFailed + oneof_schema_3_validator: Optional[EventDecompFailed] = None + # data type: EventDecompFinished + oneof_schema_4_validator: Optional[EventDecompFinished] = None + # data type: EventProse + oneof_schema_5_validator: Optional[EventProse] = None + # data type: EventRenameApplied + oneof_schema_6_validator: Optional[EventRenameApplied] = None + # data type: EventSourceDelta + oneof_schema_7_validator: Optional[EventSourceDelta] = None + # data type: EventSourceReset + oneof_schema_8_validator: Optional[EventSourceReset] = None + # data type: EventWarning + oneof_schema_9_validator: Optional[EventWarning] = None + actual_instance: Optional[Union[EventAttemptFailed, EventAttemptStarted, EventDecompFailed, EventDecompFinished, EventProse, EventRenameApplied, EventSourceDelta, EventSourceReset, EventWarning]] = None + one_of_schemas: Set[str] = { "EventAttemptFailed", "EventAttemptStarted", "EventDecompFailed", "EventDecompFinished", "EventProse", "EventRenameApplied", "EventSourceDelta", "EventSourceReset", "EventWarning" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = StreamAiDecompilation200ResponseInner.model_construct() + error_messages = [] + match = 0 + # validate data type: EventAttemptFailed + if not isinstance(v, EventAttemptFailed): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventAttemptFailed`") + else: + match += 1 + # validate data type: EventAttemptStarted + if not isinstance(v, EventAttemptStarted): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventAttemptStarted`") + else: + match += 1 + # validate data type: EventDecompFailed + if not isinstance(v, EventDecompFailed): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventDecompFailed`") + else: + match += 1 + # validate data type: EventDecompFinished + if not isinstance(v, EventDecompFinished): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventDecompFinished`") + else: + match += 1 + # validate data type: EventProse + if not isinstance(v, EventProse): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventProse`") + else: + match += 1 + # validate data type: EventRenameApplied + if not isinstance(v, EventRenameApplied): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventRenameApplied`") + else: + match += 1 + # validate data type: EventSourceDelta + if not isinstance(v, EventSourceDelta): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventSourceDelta`") + else: + match += 1 + # validate data type: EventSourceReset + if not isinstance(v, EventSourceReset): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventSourceReset`") + else: + match += 1 + # validate data type: EventWarning + if not isinstance(v, EventWarning): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventWarning`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in StreamAiDecompilation200ResponseInner with oneOf schemas: EventAttemptFailed, EventAttemptStarted, EventDecompFailed, EventDecompFinished, EventProse, EventRenameApplied, EventSourceDelta, EventSourceReset, EventWarning. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in StreamAiDecompilation200ResponseInner with oneOf schemas: EventAttemptFailed, EventAttemptStarted, EventDecompFailed, EventDecompFinished, EventProse, EventRenameApplied, EventSourceDelta, EventSourceReset, EventWarning. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into EventAttemptFailed + try: + instance.actual_instance = EventAttemptFailed.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventAttemptStarted + try: + instance.actual_instance = EventAttemptStarted.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventDecompFailed + try: + instance.actual_instance = EventDecompFailed.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventDecompFinished + try: + instance.actual_instance = EventDecompFinished.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventProse + try: + instance.actual_instance = EventProse.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventRenameApplied + try: + instance.actual_instance = EventRenameApplied.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventSourceDelta + try: + instance.actual_instance = EventSourceDelta.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventSourceReset + try: + instance.actual_instance = EventSourceReset.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventWarning + try: + instance.actual_instance = EventWarning.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into StreamAiDecompilation200ResponseInner with oneOf schemas: EventAttemptFailed, EventAttemptStarted, EventDecompFailed, EventDecompFinished, EventProse, EventRenameApplied, EventSourceDelta, EventSourceReset, EventWarning. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into StreamAiDecompilation200ResponseInner with oneOf schemas: EventAttemptFailed, EventAttemptStarted, EventDecompFailed, EventDecompFinished, EventProse, EventRenameApplied, EventSourceDelta, EventSourceReset, EventWarning. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], EventAttemptFailed, EventAttemptStarted, EventDecompFailed, EventDecompFinished, EventProse, EventRenameApplied, EventSourceDelta, EventSourceReset, EventWarning]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/revengai/models/warning_event.py b/revengai/models/warning_event.py new file mode 100644 index 00000000..4de09979 --- /dev/null +++ b/revengai/models/warning_event.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WarningEvent(BaseModel): + """ + WarningEvent + """ # noqa: E501 + attempt: StrictInt + identifiers: Optional[List[StrictStr]] = None + kind: StrictStr + message: StrictStr + seq: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attempt", "identifiers", "kind", "message", "seq", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WarningEvent 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 identifiers (nullable) is None + # and model_fields_set contains the field + if self.identifiers is None and "identifiers" in self.model_fields_set: + _dict['identifiers'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WarningEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attempt": obj.get("attempt"), + "identifiers": obj.get("identifiers"), + "kind": obj.get("kind"), + "message": obj.get("message"), + "seq": obj.get("seq"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + +