diff --git a/.sdk-version b/.sdk-version index 03e7678a..37c93bef 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.131.2 +v4.4.0 diff --git a/README.md b/README.md index ee36dfab..498b3444 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,10 @@ Class | Method | HTTP request | Description *AgentApi* | [**get_remediation_result_v2_analyses_analysis_id_agent_remediation_get**](docs/AgentApi.md#get_remediation_result_v2_analyses_analysis_id_agent_remediation_get) | **GET** /v2/analyses/{analysis_id}/agent/remediation | Get Remediation Result *AgentApi* | [**get_report_analysis_result_v2_analyses_analysis_id_agent_report_analysis_get**](docs/AgentApi.md#get_report_analysis_result_v2_analyses_analysis_id_agent_report_analysis_get) | **GET** /v2/analyses/{analysis_id}/agent/report-analysis | Get Report Analysis Result *AgentApi* | [**get_triage_result_v2_analyses_analysis_id_agent_triage_get**](docs/AgentApi.md#get_triage_result_v2_analyses_analysis_id_agent_triage_get) | **GET** /v2/analyses/{analysis_id}/agent/triage | Get Triage Result +*AgentApi* | [**v3_cancel_rename_unnamed_functions**](docs/AgentApi.md#v3_cancel_rename_unnamed_functions) | **POST** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions/cancel | Cancel the rename-unnamed-functions agent. +*AgentApi* | [**v3_get_rename_unnamed_functions_result**](docs/AgentApi.md#v3_get_rename_unnamed_functions_result) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions | Get rename-unnamed-functions agent result. +*AgentApi* | [**v3_get_rename_unnamed_functions_status**](docs/AgentApi.md#v3_get_rename_unnamed_functions_status) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions/status | Get rename-unnamed-functions agent status. +*AgentApi* | [**v3_trigger_rename_unnamed_functions**](docs/AgentApi.md#v3_trigger_rename_unnamed_functions) | **POST** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions | Run the rename-unnamed-functions agent. *AnalysesBulkActionsApi* | [**bulk_add_analysis_tags**](docs/AnalysesBulkActionsApi.md#bulk_add_analysis_tags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags *AnalysesBulkActionsApi* | [**bulk_delete_analyses**](docs/AnalysesBulkActionsApi.md#bulk_delete_analyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses *AnalysesCommentsApi* | [**create_analysis_comment**](docs/AnalysesCommentsApi.md#create_analysis_comment) | **POST** /v2/analyses/{analysis_id}/comments | Create a comment for this analysis @@ -83,6 +87,7 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**update_analysis_tags**](docs/AnalysesCoreApi.md#update_analysis_tags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags *AnalysesCoreApi* | [**upload_file**](docs/AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File *AnalysesCoreApi* | [**v3_get_analysis_auto_unstrip_status**](docs/AnalysesCoreApi.md#v3_get_analysis_auto_unstrip_status) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. +*AnalysesCoreApi* | [**v3_get_analysis_logs**](docs/AnalysesCoreApi.md#v3_get_analysis_logs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log *AnalysesCoreApi* | [**v3_get_analysis_strings**](docs/AnalysesCoreApi.md#v3_get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. *AnalysesCoreApi* | [**v3_get_analysis_strings_status**](docs/AnalysesCoreApi.md#v3_get_analysis_strings_status) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. *AnalysesCoreApi* | [**v3_list_analyses**](docs/AnalysesCoreApi.md#v3_list_analyses) | **GET** /v3/analyses | List analyses @@ -129,6 +134,17 @@ Class | Method | HTTP request | Description *ConversationsApi* | [**list_conversations**](docs/ConversationsApi.md#list_conversations) | **GET** /v2/conversations | List conversations for the authenticated user *ConversationsApi* | [**send_message**](docs/ConversationsApi.md#send_message) | **POST** /v2/conversations/{id}/messages | Send a message and start an agentic run *ConversationsApi* | [**stream_events**](docs/ConversationsApi.md#stream_events) | **GET** /v2/conversations/{id}/events | Stream conversation events (SSE) +*DataTypesApi* | [**v3_copy_function_signatures**](docs/DataTypesApi.md#v3_copy_function_signatures) | **POST** /v3/analyses/{analysis_id}/signatures/copy | Copy function signatures +*DataTypesApi* | [**v3_create_analysis_data_types**](docs/DataTypesApi.md#v3_create_analysis_data_types) | **POST** /v3/analyses/{analysis_id}/data-types | Create an analysis's data types +*DataTypesApi* | [**v3_get_analysis_data_type**](docs/DataTypesApi.md#v3_get_analysis_data_type) | **GET** /v3/analyses/{analysis_id}/data-types/{data_type_id} | Get one of an analysis's data types +*DataTypesApi* | [**v3_get_analysis_data_type_history**](docs/DataTypesApi.md#v3_get_analysis_data_type_history) | **GET** /v3/analyses/{analysis_id}/data-types/{data_type_id}/history | Get a data type's edit history +*DataTypesApi* | [**v3_get_function_signature**](docs/DataTypesApi.md#v3_get_function_signature) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/signature | Get a function's signature +*DataTypesApi* | [**v3_get_function_signature_history**](docs/DataTypesApi.md#v3_get_function_signature_history) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/signature/history | Get a function signature's edit history +*DataTypesApi* | [**v3_list_analysis_data_types**](docs/DataTypesApi.md#v3_list_analysis_data_types) | **GET** /v3/analyses/{analysis_id}/data-types | List an analysis's data types +*DataTypesApi* | [**v3_list_data_type_functions**](docs/DataTypesApi.md#v3_list_data_type_functions) | **GET** /v3/analyses/{analysis_id}/data-types/{data_type_id}/functions | List the functions using a data type +*DataTypesApi* | [**v3_list_function_signatures**](docs/DataTypesApi.md#v3_list_function_signatures) | **GET** /v3/functions/signatures | Get signatures for many functions +*DataTypesApi* | [**v3_update_analysis_data_types**](docs/DataTypesApi.md#v3_update_analysis_data_types) | **PUT** /v3/analyses/{analysis_id}/data-types | Update an analysis's data types +*DataTypesApi* | [**v3_update_function_signature**](docs/DataTypesApi.md#v3_update_function_signature) | **PUT** /v3/analyses/{analysis_id}/functions/{function_id}/signature | Update a function's signature *ExternalSourcesApi* | [**create_external_task_vt**](docs/ExternalSourcesApi.md#create_external_task_vt) | **POST** /v2/analysis/{analysis_id}/external/vt | Pulls data from VirusTotal *ExternalSourcesApi* | [**get_vt_data**](docs/ExternalSourcesApi.md#get_vt_data) | **GET** /v2/analysis/{analysis_id}/external/vt | Get VirusTotal data *ExternalSourcesApi* | [**get_vt_task_status**](docs/ExternalSourcesApi.md#get_vt_task_status) | **GET** /v2/analysis/{analysis_id}/external/vt/status | Check the status of VirusTotal data retrieval @@ -143,13 +159,14 @@ Class | Method | HTTP request | Description *FunctionsAIDecompilationApi* | [**get_ai_decompilation_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_status) | **GET** /v3/functions/{function_id}/ai-decompilation/status | Get AI decompilation workflow status *FunctionsAIDecompilationApi* | [**get_ai_decompilation_summary**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_summary) | **GET** /v3/functions/{function_id}/ai-decompilation/summary | Get AI decompilation summary *FunctionsAIDecompilationApi* | [**get_ai_decompilation_summary_status**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_summary_status) | **GET** /v3/functions/{function_id}/ai-decompilation/summary/status | Get summary generation workflow status -*FunctionsAIDecompilationApi* | [**get_ai_decompilation_tokenised**](docs/FunctionsAIDecompilationApi.md#get_ai_decompilation_tokenised) | **GET** /v3/functions/{function_id}/ai-decompilation/tokenised | Get tokenised AI decompilation with function mapping *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* | [**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 +*FunctionsAIDecompilationApi* | [**v3_get_ai_decompilation_line_attributions**](docs/FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_line_attributions) | **GET** /v3/functions/{function_id}/ai-decompilation/line-attributions | Get AI decompilation line attributions +*FunctionsAIDecompilationApi* | [**v3_get_ai_decompilation_tokens**](docs/FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_tokens) | **GET** /v3/functions/{function_id}/ai-decompilation/tokens | Get AI decompilation tokens and user overrides +*FunctionsAIDecompilationApi* | [**v3_upsert_ai_decompilation_overrides**](docs/FunctionsAIDecompilationApi.md#v3_upsert_ai_decompilation_overrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides *FunctionsCoreApi* | [**add_function_callee**](docs/FunctionsCoreApi.md#add_function_callee) | **POST** /v3/functions/{function_id}/callees | Add a callee to a function *FunctionsCoreApi* | [**add_user_string_to_function**](docs/FunctionsCoreApi.md#add_user_string_to_function) | **POST** /v3/functions/{function_id}/user-provided-strings | Add a user-provided string to a function. *FunctionsCoreApi* | [**get_analysis_strings**](docs/FunctionsCoreApi.md#get_analysis_strings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis @@ -174,15 +191,6 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**list_imported_functions**](docs/FunctionsCoreApi.md#list_imported_functions) | **GET** /v3/analyses/{analysis_id}/imported-functions | List imported functions in an analysis *FunctionsCoreApi* | [**start_functions_matching**](docs/FunctionsCoreApi.md#start_functions_matching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions *FunctionsCoreApi* | [**v3_canonicalize_function_names**](docs/FunctionsCoreApi.md#v3_canonicalize_function_names) | **POST** /v3/functions/canonical-names | Canonicalize a batch of function names -*FunctionsDataTypesApi* | [**batch_update_function_data_types**](docs/FunctionsDataTypesApi.md#batch_update_function_data_types) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types -*FunctionsDataTypesApi* | [**generate_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types -*FunctionsDataTypesApi* | [**generate_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_functions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions -*FunctionsDataTypesApi* | [**get_function_data_types**](docs/FunctionsDataTypesApi.md#get_function_data_types) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/data-types | Get data types for a single function -*FunctionsDataTypesApi* | [**list_analysis_functions_data_types**](docs/FunctionsDataTypesApi.md#list_analysis_functions_data_types) | **GET** /v3/analyses/{analysis_id}/functions/data-types | List data types for all functions in an analysis -*FunctionsDataTypesApi* | [**list_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#list_function_data_types_for_analysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types -*FunctionsDataTypesApi* | [**list_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#list_function_data_types_for_functions) | **GET** /v2/functions/data_types | List Function Data Types -*FunctionsDataTypesApi* | [**list_functions_data_types**](docs/FunctionsDataTypesApi.md#list_functions_data_types) | **GET** /v3/functions/data-types | Get data types for many functions -*FunctionsDataTypesApi* | [**update_function_data_types**](docs/FunctionsDataTypesApi.md#update_function_data_types) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update function data types *FunctionsRenamingHistoryApi* | [**batch_rename_function**](docs/FunctionsRenamingHistoryApi.md#batch_rename_function) | **POST** /v2/functions/rename/batch | Batch Rename Functions *FunctionsRenamingHistoryApi* | [**batch_rename_functions**](docs/FunctionsRenamingHistoryApi.md#batch_rename_functions) | **POST** /v3/functions/rename | Batch rename functions *FunctionsRenamingHistoryApi* | [**get_function_history**](docs/FunctionsRenamingHistoryApi.md#get_function_history) | **GET** /v3/functions/{function_id}/history | Get function name history @@ -205,9 +213,6 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [AIDecompFunctionMapping](docs/AIDecompFunctionMapping.md) - - [AIDecompInverseFunctionMapItem](docs/AIDecompInverseFunctionMapItem.md) - - [AIDecompInverseStringMapItem](docs/AIDecompInverseStringMapItem.md) - [APIError](docs/APIError.md) - [AddCalleeInputBody](docs/AddCalleeInputBody.md) - [AddCollectionBinariesInputBody](docs/AddCollectionBinariesInputBody.md) @@ -227,11 +232,14 @@ Class | Method | HTTP request | Description - [AnalysisConfigSnapshot](docs/AnalysisConfigSnapshot.md) - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) + - [AnalysisDataTypesGroup](docs/AnalysisDataTypesGroup.md) + - [AnalysisDataTypesOutputBody](docs/AnalysisDataTypesOutputBody.md) - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) - [AnalysisFunctions](docs/AnalysisFunctions.md) - [AnalysisFunctionsList](docs/AnalysisFunctionsList.md) + - [AnalysisLogEntry](docs/AnalysisLogEntry.md) - [AnalysisLogMessage](docs/AnalysisLogMessage.md) - [AnalysisLogs](docs/AnalysisLogs.md) - [AnalysisRecord](docs/AnalysisRecord.md) @@ -256,12 +264,14 @@ Class | Method | HTTP request | Description - [AppApiRestV2FunctionsTypesFunction](docs/AppApiRestV2FunctionsTypesFunction.md) - [AppApiRestV2InfoTypesCapability](docs/AppApiRestV2InfoTypesCapability.md) - [ArchiveContentEntry](docs/ArchiveContentEntry.md) - - [Argument](docs/Argument.md) + - [ArrayDataType](docs/ArrayDataType.md) + - [ArrayDefinition](docs/ArrayDefinition.md) - [Artifact](docs/Artifact.md) - [AttemptFailedEvent](docs/AttemptFailedEvent.md) - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - [AutoRunAgents](docs/AutoRunAgents.md) - [AutoUnstripStatusOutputBody](docs/AutoUnstripStatusOutputBody.md) + - [BaseDataType](docs/BaseDataType.md) - [BaseResponse](docs/BaseResponse.md) - [BaseResponseAdditionalDetailsStatusResponse](docs/BaseResponseAdditionalDetailsStatusResponse.md) - [BaseResponseAnalysisBulkAddTagsResponse](docs/BaseResponseAnalysisBulkAddTagsResponse.md) @@ -296,13 +306,9 @@ Class | Method | HTTP request | Description - [BaseResponseExternalResponse](docs/BaseResponseExternalResponse.md) - [BaseResponseFunctionBlocksResponse](docs/BaseResponseFunctionBlocksResponse.md) - [BaseResponseFunctionCapabilityResponse](docs/BaseResponseFunctionCapabilityResponse.md) - - [BaseResponseFunctionDataTypes](docs/BaseResponseFunctionDataTypes.md) - - [BaseResponseFunctionDataTypesList](docs/BaseResponseFunctionDataTypesList.md) - [BaseResponseFunctionSearchResponse](docs/BaseResponseFunctionSearchResponse.md) - [BaseResponseFunctionStringsResponse](docs/BaseResponseFunctionStringsResponse.md) - [BaseResponseFunctionsDetailResponse](docs/BaseResponseFunctionsDetailResponse.md) - - [BaseResponseGenerateFunctionDataTypes](docs/BaseResponseGenerateFunctionDataTypes.md) - - [BaseResponseGenerationStatusList](docs/BaseResponseGenerationStatusList.md) - [BaseResponseGetPublicUserResponse](docs/BaseResponseGetPublicUserResponse.md) - [BaseResponseListCalleesCallerFunctionsResponse](docs/BaseResponseListCalleesCallerFunctionsResponse.md) - [BaseResponseListCollectionResults](docs/BaseResponseListCollectionResults.md) @@ -328,14 +334,11 @@ Class | Method | HTTP request | Description - [BaseResponseXrefResponse](docs/BaseResponseXrefResponse.md) - [Basic](docs/Basic.md) - [BatchBinaryMatchResult](docs/BatchBinaryMatchResult.md) + - [BatchFunctionSignatureEntry](docs/BatchFunctionSignatureEntry.md) - [BatchMatchingOutputBody](docs/BatchMatchingOutputBody.md) - [BatchRenameInputBody](docs/BatchRenameInputBody.md) - [BatchRenameItem](docs/BatchRenameItem.md) - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) - - [BatchUpdateDataTypesInputBody](docs/BatchUpdateDataTypesInputBody.md) - - [BatchUpdateDataTypesItem](docs/BatchUpdateDataTypesItem.md) - - [BatchUpdateDataTypesOutputBody](docs/BatchUpdateDataTypesOutputBody.md) - - [BatchUpdateDataTypesResult](docs/BatchUpdateDataTypesResult.md) - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [Binary](docs/Binary.md) @@ -347,6 +350,7 @@ Class | Method | HTTP request | Description - [BinarySearchResponse](docs/BinarySearchResponse.md) - [BinarySearchResult](docs/BinarySearchResult.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.md) + - [BitfieldDataType](docs/BitfieldDataType.md) - [BulkCreateUserResult](docs/BulkCreateUserResult.md) - [BulkCreateUsersOutputBody](docs/BulkCreateUsersOutputBody.md) - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) @@ -390,20 +394,40 @@ Class | Method | HTTP request | Description - [Conversation](docs/Conversation.md) - [ConversationContext](docs/ConversationContext.md) - [ConversationWithEvents](docs/ConversationWithEvents.md) + - [CopyFunctionSignaturesInputBody](docs/CopyFunctionSignaturesInputBody.md) + - [CopyFunctionSignaturesOutputBody](docs/CopyFunctionSignaturesOutputBody.md) + - [CopySignatureItem](docs/CopySignatureItem.md) - [CreateAIDecompOutputBody](docs/CreateAIDecompOutputBody.md) + - [CreateAnalysisDataTypesInputBody](docs/CreateAnalysisDataTypesInputBody.md) + - [CreateArrayDataType](docs/CreateArrayDataType.md) + - [CreateBaseDataType](docs/CreateBaseDataType.md) + - [CreateBitfieldDataType](docs/CreateBitfieldDataType.md) - [CreateCheckoutSessionInputBody](docs/CreateCheckoutSessionInputBody.md) - [CreateCollectionInputBody](docs/CreateCollectionInputBody.md) - [CreateCollectionOutputBody](docs/CreateCollectionOutputBody.md) - [CreateConversationRequest](docs/CreateConversationRequest.md) + - [CreateDataTypeEntry](docs/CreateDataTypeEntry.md) + - [CreateEnumDataType](docs/CreateEnumDataType.md) + - [CreateFunctionDataType](docs/CreateFunctionDataType.md) - [CreateGroupInputBody](docs/CreateGroupInputBody.md) - [CreateIdentityInputBody](docs/CreateIdentityInputBody.md) - [CreateIssuerInputBody](docs/CreateIssuerInputBody.md) - [CreateOrganisationInputBody](docs/CreateOrganisationInputBody.md) + - [CreatePointerDataType](docs/CreatePointerDataType.md) - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.md) + - [CreateStructDataType](docs/CreateStructDataType.md) - [CreateTeamInputBody](docs/CreateTeamInputBody.md) + - [CreateTypedefDataType](docs/CreateTypedefDataType.md) + - [CreateUnionDataType](docs/CreateUnionDataType.md) + - [CreateUnknownDataType](docs/CreateUnknownDataType.md) - [CreateUserInputBody](docs/CreateUserInputBody.md) - [Created](docs/Created.md) - - [DataTypesEntry](docs/DataTypesEntry.md) + - [DataTypeEntry](docs/DataTypeEntry.md) + - [DataTypeEnumValueEntry](docs/DataTypeEnumValueEntry.md) + - [DataTypeFunctionEntry](docs/DataTypeFunctionEntry.md) + - [DataTypeFunctionParameterEntry](docs/DataTypeFunctionParameterEntry.md) + - [DataTypeMemberEntry](docs/DataTypeMemberEntry.md) + - [DataTypeVersion](docs/DataTypeVersion.md) - [DecompFailedEvent](docs/DecompFailedEvent.md) - [DecompFinishedEvent](docs/DecompFinishedEvent.md) - [DecompilationCommentContext](docs/DecompilationCommentContext.md) @@ -423,7 +447,8 @@ Class | Method | HTTP request | Description - [ELFSymbol](docs/ELFSymbol.md) - [ElfDynamicEntry](docs/ElfDynamicEntry.md) - [EntrypointModel](docs/EntrypointModel.md) - - [Enumeration](docs/Enumeration.md) + - [EnumDataType](docs/EnumDataType.md) + - [EnumDefinition](docs/EnumDefinition.md) - [ErrorBody](docs/ErrorBody.md) - [ErrorModel](docs/ErrorModel.md) - [Event](docs/Event.md) @@ -463,22 +488,14 @@ Class | Method | HTTP request | Description - [FileMetadata](docs/FileMetadata.md) - [Filters](docs/Filters.md) - [FormFile](docs/FormFile.md) - - [FunctionArgument](docs/FunctionArgument.md) - [FunctionBlockDestinationResponse](docs/FunctionBlockDestinationResponse.md) - [FunctionBlockResponse](docs/FunctionBlockResponse.md) - [FunctionBlocksResponse](docs/FunctionBlocksResponse.md) - [FunctionBoundary](docs/FunctionBoundary.md) - [FunctionCallEdges](docs/FunctionCallEdges.md) - [FunctionCapabilityResponse](docs/FunctionCapabilityResponse.md) - - [FunctionDataTypes](docs/FunctionDataTypes.md) - - [FunctionDataTypesList](docs/FunctionDataTypesList.md) - - [FunctionDataTypesListItem](docs/FunctionDataTypesListItem.md) - - [FunctionDataTypesParams](docs/FunctionDataTypesParams.md) - - [FunctionDataTypesStatus](docs/FunctionDataTypesStatus.md) - - [FunctionDependency](docs/FunctionDependency.md) + - [FunctionDataType](docs/FunctionDataType.md) - [FunctionDetailsOutputBody](docs/FunctionDetailsOutputBody.md) - - [FunctionHeader](docs/FunctionHeader.md) - - [FunctionInfo](docs/FunctionInfo.md) - [FunctionListItem](docs/FunctionListItem.md) - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) @@ -489,28 +506,32 @@ Class | Method | HTTP request | Description - [FunctionRenameMap](docs/FunctionRenameMap.md) - [FunctionSearchResponse](docs/FunctionSearchResponse.md) - [FunctionSearchResult](docs/FunctionSearchResult.md) + - [FunctionSignatureBody](docs/FunctionSignatureBody.md) + - [FunctionSignatureEntry](docs/FunctionSignatureEntry.md) + - [FunctionSignatureVersion](docs/FunctionSignatureVersion.md) - [FunctionSourceType](docs/FunctionSourceType.md) - - [FunctionStackVariable](docs/FunctionStackVariable.md) - [FunctionString](docs/FunctionString.md) - [FunctionStringItem](docs/FunctionStringItem.md) - [FunctionStringsResponse](docs/FunctionStringsResponse.md) - - [FunctionType](docs/FunctionType.md) + - [FunctionTypeDefinition](docs/FunctionTypeDefinition.md) - [FunctionsDetailResponse](docs/FunctionsDetailResponse.md) - [FunctionsListRename](docs/FunctionsListRename.md) - - [GenerateFunctionDataTypes](docs/GenerateFunctionDataTypes.md) - [GeneratePDFOutputBody](docs/GeneratePDFOutputBody.md) - - [GenerationStatusList](docs/GenerationStatusList.md) - [GetAdditionalDetailsOutputBody](docs/GetAdditionalDetailsOutputBody.md) - [GetAdditionalDetailsStatusOutputBody](docs/GetAdditionalDetailsStatusOutputBody.md) - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) + - [GetAnalysisLogsOutputBody](docs/GetAnalysisLogsOutputBody.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) - [GetCollectionOutputBody](docs/GetCollectionOutputBody.md) + - [GetDataTypeHistoryBody](docs/GetDataTypeHistoryBody.md) + - [GetFunctionSignatureHistoryBody](docs/GetFunctionSignatureHistoryBody.md) - [GetMatchesOutputBody](docs/GetMatchesOutputBody.md) - [GetMatchesStatusOutputBody](docs/GetMatchesStatusOutputBody.md) - [GetProductsOutputBody](docs/GetProductsOutputBody.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) - - [GlobalVariable](docs/GlobalVariable.md) + - [GetTokensResponse](docs/GetTokensResponse.md) + - [HistoryActor](docs/HistoryActor.md) - [HistoryEntry](docs/HistoryEntry.md) - [HttpRequest](docs/HttpRequest.md) - [IOC](docs/IOC.md) @@ -526,16 +547,18 @@ Class | Method | HTTP request | Description - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) - [InviteUserInputBody](docs/InviteUserInputBody.md) - [IssuerAllowedDomain](docs/IssuerAllowedDomain.md) + - [LineAttributionsData](docs/LineAttributionsData.md) - [ListAnalysesOutputBody](docs/ListAnalysesOutputBody.md) - - [ListAnalysisFunctionsDataTypesOutputBody](docs/ListAnalysisFunctionsDataTypesOutputBody.md) + - [ListAnalysisDataTypesOutputBody](docs/ListAnalysisDataTypesOutputBody.md) - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListArchiveContentsOutputBody](docs/ListArchiveContentsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) + - [ListDataTypeFunctionsBody](docs/ListDataTypeFunctionsBody.md) - [ListExampleAnalysesOutputBody](docs/ListExampleAnalysesOutputBody.md) + - [ListFunctionSignaturesOutputBody](docs/ListFunctionSignaturesOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) - - [ListFunctionsDataTypesOutputBody](docs/ListFunctionsDataTypesOutputBody.md) - [ListImportedFunctionsOutputBody](docs/ListImportedFunctionsOutputBody.md) - [ListTeamsOutputBody](docs/ListTeamsOutputBody.md) - [ListUsersOutputBody](docs/ListUsersOutputBody.md) @@ -575,6 +598,8 @@ Class | Method | HTTP request | Description - [PcapBodyInfo](docs/PcapBodyInfo.md) - [Permissions](docs/Permissions.md) - [Platform](docs/Platform.md) + - [PointerDataType](docs/PointerDataType.md) + - [PointerDefinition](docs/PointerDefinition.md) - [PriceOutput](docs/PriceOutput.md) - [PriceSummary](docs/PriceSummary.md) - [ProcessActivityEntry](docs/ProcessActivityEntry.md) @@ -599,11 +624,13 @@ Class | Method | HTTP request | Description - [RenameAppliedEvent](docs/RenameAppliedEvent.md) - [RenameInputBody](docs/RenameInputBody.md) - [RenameOutputBody](docs/RenameOutputBody.md) - - [ReplacementValue](docs/ReplacementValue.md) + - [RenameUnnamedFunctionsResult](docs/RenameUnnamedFunctionsResult.md) + - [RenderedToken](docs/RenderedToken.md) - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) - [ReportEvent](docs/ReportEvent.md) - [ReportInfo](docs/ReportInfo.md) - [ReportOptions](docs/ReportOptions.md) + - [ResolvedEntity](docs/ResolvedEntity.md) - [RevokeBody](docs/RevokeBody.md) - [SSOProvider](docs/SSOProvider.md) - [SSOProvidersOutputBody](docs/SSOProvidersOutputBody.md) @@ -618,6 +645,10 @@ Class | Method | HTTP request | Description - [SendMessageRequest](docs/SendMessageRequest.md) - [ServiceEntry](docs/ServiceEntry.md) - [SessionOutputBody](docs/SessionOutputBody.md) + - [SignatureParameterEntry](docs/SignatureParameterEntry.md) + - [SignatureParameterInput](docs/SignatureParameterInput.md) + - [SignatureStorageEntry](docs/SignatureStorageEntry.md) + - [SignatureStorageInput](docs/SignatureStorageInput.md) - [SingleCodeCertificateModel](docs/SingleCodeCertificateModel.md) - [SingleCodeSignatureModel](docs/SingleCodeSignatureModel.md) - [SinglePDBEntryModel](docs/SinglePDBEntryModel.md) @@ -641,12 +672,12 @@ Class | Method | HTTP request | Description - [SseEventToolCallResultData](docs/SseEventToolCallResultData.md) - [SseEventToolCallStartData](docs/SseEventToolCallStartData.md) - [SseEventToolConfirmationRequiredData](docs/SseEventToolConfirmationRequiredData.md) - - [StackVariable](docs/StackVariable.md) - [StartBatchMatchingInputBody](docs/StartBatchMatchingInputBody.md) - [StartMatchingForAnalysisInputBody](docs/StartMatchingForAnalysisInputBody.md) - [StartMatchingForFunctionsInputBody](docs/StartMatchingForFunctionsInputBody.md) - [StartMatchingOutputBody](docs/StartMatchingOutputBody.md) - [StartupInfo](docs/StartupInfo.md) + - [StatusBody](docs/StatusBody.md) - [StatusInput](docs/StatusInput.md) - [StatusOutput](docs/StatusOutput.md) - [StatusResponse](docs/StatusResponse.md) @@ -654,8 +685,8 @@ Class | Method | HTTP request | Description - [StreamEvents200ResponseInner](docs/StreamEvents200ResponseInner.md) - [StringFunctions](docs/StringFunctions.md) - [StringSource](docs/StringSource.md) - - [Structure](docs/Structure.md) - - [StructureMember](docs/StructureMember.md) + - [StructDataType](docs/StructDataType.md) + - [StructDefinition](docs/StructDefinition.md) - [SubmitUserFeedbackRequest](docs/SubmitUserFeedbackRequest.md) - [SummaryData](docs/SummaryData.md) - [Symbols](docs/Symbols.md) @@ -671,21 +702,38 @@ Class | Method | HTTP request | Description - [Team](docs/Team.md) - [TeamMember](docs/TeamMember.md) - [TimestampModel](docs/TimestampModel.md) + - [Token](docs/Token.md) - [TokenInputBody](docs/TokenInputBody.md) - [TokenResponse](docs/TokenResponse.md) - [TokenisedData](docs/TokenisedData.md) - [TriageFunctionResponse](docs/TriageFunctionResponse.md) - [TriageReportResponse](docs/TriageReportResponse.md) - [TriggerDynamicExecutionInputBody](docs/TriggerDynamicExecutionInputBody.md) + - [TriggerRenameUnnamedFunctionsInputBody](docs/TriggerRenameUnnamedFunctionsInputBody.md) - [Ttp](docs/Ttp.md) - - [TypeDefinition](docs/TypeDefinition.md) - - [UpdateDataTypesInputBody](docs/UpdateDataTypesInputBody.md) - - [UpdateDataTypesOutputBody](docs/UpdateDataTypesOutputBody.md) + - [TypedefDataType](docs/TypedefDataType.md) + - [TypedefDefinition](docs/TypedefDefinition.md) + - [UnionDataType](docs/UnionDataType.md) + - [UnionDefinition](docs/UnionDefinition.md) + - [UnknownDataType](docs/UnknownDataType.md) + - [UpdateAnalysisDataTypesInputBody](docs/UpdateAnalysisDataTypesInputBody.md) + - [UpdateArrayDataType](docs/UpdateArrayDataType.md) + - [UpdateBaseDataType](docs/UpdateBaseDataType.md) + - [UpdateBitfieldDataType](docs/UpdateBitfieldDataType.md) + - [UpdateDataTypeEntry](docs/UpdateDataTypeEntry.md) + - [UpdateEnumDataType](docs/UpdateEnumDataType.md) + - [UpdateFunctionDataType](docs/UpdateFunctionDataType.md) + - [UpdateFunctionSignatureInputBody](docs/UpdateFunctionSignatureInputBody.md) - [UpdateIssuerInputBody](docs/UpdateIssuerInputBody.md) - [UpdateOrganisationInputBody](docs/UpdateOrganisationInputBody.md) - [UpdatePasswordInputBody](docs/UpdatePasswordInputBody.md) + - [UpdatePointerDataType](docs/UpdatePointerDataType.md) - [UpdateProfileInputBody](docs/UpdateProfileInputBody.md) + - [UpdateStructDataType](docs/UpdateStructDataType.md) - [UpdateTeamInputBody](docs/UpdateTeamInputBody.md) + - [UpdateTypedefDataType](docs/UpdateTypedefDataType.md) + - [UpdateUnionDataType](docs/UpdateUnionDataType.md) + - [UpdateUnknownDataType](docs/UpdateUnknownDataType.md) - [UpdateUserCreditsInputBody](docs/UpdateUserCreditsInputBody.md) - [UpdateUserInputBody](docs/UpdateUserInputBody.md) - [UpdateUserPasswordInputBody](docs/UpdateUserPasswordInputBody.md) @@ -699,10 +747,6 @@ Class | Method | HTTP request | Description - [UserCredits](docs/UserCredits.md) - [UserIdentity](docs/UserIdentity.md) - [UserProfile](docs/UserProfile.md) - - [V2FunctionHeader](docs/V2FunctionHeader.md) - - [V2FunctionInfo](docs/V2FunctionInfo.md) - - [V2FunctionInfoFuncDepsInner](docs/V2FunctionInfoFuncDepsInner.md) - - [V2FunctionType](docs/V2FunctionType.md) - [WarningEvent](docs/WarningEvent.md) - [WorkflowProgress](docs/WorkflowProgress.md) - [Workspace](docs/Workspace.md) diff --git a/docs/AIDecompFunctionMapping.md b/docs/AIDecompFunctionMapping.md deleted file mode 100644 index 0167aacd..00000000 --- a/docs/AIDecompFunctionMapping.md +++ /dev/null @@ -1,42 +0,0 @@ -# AIDecompFunctionMapping - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fields** | **Dict[str, Dict[str, ReplacementValue]]** | | -**inverse_function_map** | [**Dict[str, AIDecompInverseFunctionMapItem]**](AIDecompInverseFunctionMapItem.md) | | -**inverse_string_map** | [**Dict[str, AIDecompInverseStringMapItem]**](AIDecompInverseStringMapItem.md) | | -**unmatched_custom_function_pointers** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_custom_types** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_enums** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_external_vars** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_functions** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_global_vars** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_go_to_labels** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_strings** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_variadic_lists** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**unmatched_vars** | [**Dict[str, ReplacementValue]**](ReplacementValue.md) | | -**user_override_mappings** | **Dict[str, str]** | | - -## Example - -```python -from revengai.models.ai_decomp_function_mapping import AIDecompFunctionMapping - -# TODO update the JSON string below -json = "{}" -# create an instance of AIDecompFunctionMapping from a JSON string -ai_decomp_function_mapping_instance = AIDecompFunctionMapping.from_json(json) -# print the JSON string representation of the object -print(AIDecompFunctionMapping.to_json()) - -# convert the object into a dict -ai_decomp_function_mapping_dict = ai_decomp_function_mapping_instance.to_dict() -# create an instance of AIDecompFunctionMapping from a dict -ai_decomp_function_mapping_from_dict = AIDecompFunctionMapping.from_dict(ai_decomp_function_mapping_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/AIDecompInverseFunctionMapItem.md b/docs/AIDecompInverseFunctionMapItem.md deleted file mode 100644 index 1e48fc85..00000000 --- a/docs/AIDecompInverseFunctionMapItem.md +++ /dev/null @@ -1,31 +0,0 @@ -# AIDecompInverseFunctionMapItem - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addr** | **int** | | -**is_external** | **bool** | | -**name** | **str** | | - -## Example - -```python -from revengai.models.ai_decomp_inverse_function_map_item import AIDecompInverseFunctionMapItem - -# TODO update the JSON string below -json = "{}" -# create an instance of AIDecompInverseFunctionMapItem from a JSON string -ai_decomp_inverse_function_map_item_instance = AIDecompInverseFunctionMapItem.from_json(json) -# print the JSON string representation of the object -print(AIDecompInverseFunctionMapItem.to_json()) - -# convert the object into a dict -ai_decomp_inverse_function_map_item_dict = ai_decomp_inverse_function_map_item_instance.to_dict() -# create an instance of AIDecompInverseFunctionMapItem from a dict -ai_decomp_inverse_function_map_item_from_dict = AIDecompInverseFunctionMapItem.from_dict(ai_decomp_inverse_function_map_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AIDecompInverseStringMapItem.md b/docs/AIDecompInverseStringMapItem.md deleted file mode 100644 index 00c34f79..00000000 --- a/docs/AIDecompInverseStringMapItem.md +++ /dev/null @@ -1,30 +0,0 @@ -# AIDecompInverseStringMapItem - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addr** | **int** | | -**string** | **str** | | - -## Example - -```python -from revengai.models.ai_decomp_inverse_string_map_item import AIDecompInverseStringMapItem - -# TODO update the JSON string below -json = "{}" -# create an instance of AIDecompInverseStringMapItem from a JSON string -ai_decomp_inverse_string_map_item_instance = AIDecompInverseStringMapItem.from_json(json) -# print the JSON string representation of the object -print(AIDecompInverseStringMapItem.to_json()) - -# convert the object into a dict -ai_decomp_inverse_string_map_item_dict = ai_decomp_inverse_string_map_item_instance.to_dict() -# create an instance of AIDecompInverseStringMapItem from a dict -ai_decomp_inverse_string_map_item_from_dict = AIDecompInverseStringMapItem.from_dict(ai_decomp_inverse_string_map_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AgentApi.md b/docs/AgentApi.md index 7bd1d056..b87f6026 100644 --- a/docs/AgentApi.md +++ b/docs/AgentApi.md @@ -16,6 +16,10 @@ Method | HTTP request | Description [**get_remediation_result_v2_analyses_analysis_id_agent_remediation_get**](AgentApi.md#get_remediation_result_v2_analyses_analysis_id_agent_remediation_get) | **GET** /v2/analyses/{analysis_id}/agent/remediation | Get Remediation Result [**get_report_analysis_result_v2_analyses_analysis_id_agent_report_analysis_get**](AgentApi.md#get_report_analysis_result_v2_analyses_analysis_id_agent_report_analysis_get) | **GET** /v2/analyses/{analysis_id}/agent/report-analysis | Get Report Analysis Result [**get_triage_result_v2_analyses_analysis_id_agent_triage_get**](AgentApi.md#get_triage_result_v2_analyses_analysis_id_agent_triage_get) | **GET** /v2/analyses/{analysis_id}/agent/triage | Get Triage Result +[**v3_cancel_rename_unnamed_functions**](AgentApi.md#v3_cancel_rename_unnamed_functions) | **POST** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions/cancel | Cancel the rename-unnamed-functions agent. +[**v3_get_rename_unnamed_functions_result**](AgentApi.md#v3_get_rename_unnamed_functions_result) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions | Get rename-unnamed-functions agent result. +[**v3_get_rename_unnamed_functions_status**](AgentApi.md#v3_get_rename_unnamed_functions_status) | **GET** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions/status | Get rename-unnamed-functions agent status. +[**v3_trigger_rename_unnamed_functions**](AgentApi.md#v3_trigger_rename_unnamed_functions) | **POST** /v3/analyses/{analysis_id}/agents/rename-unnamed-functions | Run the rename-unnamed-functions agent. # **check_capabilities_task_status_v2_analyses_analysis_id_agent_capabilities_status_get** @@ -1040,3 +1044,380 @@ 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) +# **v3_cancel_rename_unnamed_functions** +> v3_cancel_rename_unnamed_functions(analysis_id) + +Cancel the rename-unnamed-functions agent. + +Requests cancellation of the currently running rename-unnamed-functions run for the analysis. Returns 404 if no run is in progress. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.AgentApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Cancel the rename-unnamed-functions agent. + api_instance.v3_cancel_rename_unnamed_functions(analysis_id) + except Exception as e: + print("Exception when calling AgentApi->v3_cancel_rename_unnamed_functions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +void (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_rename_unnamed_functions_result** +> RenameUnnamedFunctionsResult v3_get_rename_unnamed_functions_result(analysis_id) + +Get rename-unnamed-functions agent result. + +Returns the summary of the most recent completed rename-unnamed-functions run. Returns 409 while a run is still in progress and 404 when the agent has never produced a result for this analysis. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.AgentApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get rename-unnamed-functions agent result. + api_response = api_instance.v3_get_rename_unnamed_functions_result(analysis_id) + print("The response of AgentApi->v3_get_rename_unnamed_functions_result:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->v3_get_rename_unnamed_functions_result: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**RenameUnnamedFunctionsResult**](RenameUnnamedFunctionsResult.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_rename_unnamed_functions_status** +> StatusBody v3_get_rename_unnamed_functions_status(analysis_id) + +Get rename-unnamed-functions agent status. + +Returns the status of the most recent rename-unnamed-functions run for the analysis. `UNINITIALISED` means the agent has never been triggered, so it is safe to start one. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.status_body import StatusBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.AgentApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get rename-unnamed-functions agent status. + api_response = api_instance.v3_get_rename_unnamed_functions_status(analysis_id) + print("The response of AgentApi->v3_get_rename_unnamed_functions_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->v3_get_rename_unnamed_functions_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**StatusBody**](StatusBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_trigger_rename_unnamed_functions** +> StatusBody v3_trigger_rename_unnamed_functions(analysis_id, trigger_rename_unnamed_functions_input_body) + +Run the rename-unnamed-functions agent. + +Starts an agent that renames the analysis' unnamed functions from their AI decompilations. Each function costs an AI decompilation, so a whole-analysis run can be expensive — use `limit` to bound it. Returns 409 while a run is already in progress for this analysis. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.status_body import StatusBody +from revengai.models.trigger_rename_unnamed_functions_input_body import TriggerRenameUnnamedFunctionsInputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.AgentApi(api_client) + analysis_id = 56 # int | Analysis ID + trigger_rename_unnamed_functions_input_body = revengai.TriggerRenameUnnamedFunctionsInputBody() # TriggerRenameUnnamedFunctionsInputBody | + + try: + # Run the rename-unnamed-functions agent. + api_response = api_instance.v3_trigger_rename_unnamed_functions(analysis_id, trigger_rename_unnamed_functions_input_body) + print("The response of AgentApi->v3_trigger_rename_unnamed_functions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->v3_trigger_rename_unnamed_functions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **trigger_rename_unnamed_functions_input_body** | [**TriggerRenameUnnamedFunctionsInputBody**](TriggerRenameUnnamedFunctionsInputBody.md)| | + +### Return type + +[**StatusBody**](StatusBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 3ca883b1..37dea083 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -28,6 +28,7 @@ Method | HTTP request | Description [**update_analysis_tags**](AnalysesCoreApi.md#update_analysis_tags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags [**upload_file**](AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File [**v3_get_analysis_auto_unstrip_status**](AnalysesCoreApi.md#v3_get_analysis_auto_unstrip_status) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. +[**v3_get_analysis_logs**](AnalysesCoreApi.md#v3_get_analysis_logs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log [**v3_get_analysis_strings**](AnalysesCoreApi.md#v3_get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. [**v3_get_analysis_strings_status**](AnalysesCoreApi.md#v3_get_analysis_strings_status) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. [**v3_list_analyses**](AnalysesCoreApi.md#v3_list_analyses) | **GET** /v3/analyses | List analyses @@ -2231,6 +2232,99 @@ 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) +# **v3_get_analysis_logs** +> GetAnalysisLogsOutputBody v3_get_analysis_logs(analysis_id) + +Get the Analysis log + +Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get the Analysis log + api_response = api_instance.v3_get_analysis_logs(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_logs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_get_analysis_logs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**GetAnalysisLogsOutputBody**](GetAnalysisLogsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_get_analysis_strings** > ListAnalysisStringsOutputBody v3_get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, search_operator=search_operator, function_search=function_search, order_by=order_by, sort_order=sort_order) diff --git a/docs/AnalysisBasicInfoOutputBody.md b/docs/AnalysisBasicInfoOutputBody.md index f2015ff6..9904d4ab 100644 --- a/docs/AnalysisBasicInfoOutputBody.md +++ b/docs/AnalysisBasicInfoOutputBody.md @@ -13,6 +13,9 @@ Name | Type | Description | Notes **binary_uuid** | **str** | UUID of the binary, omitted when not set | **creation** | **datetime** | When the binary was uploaded | **debug** | **bool** | True when the binary was analysed with debug symbols | +**detected_architecture** | **str** | Detected instruction-set architecture; empty when unavailable | +**detected_binary_format** | **str** | Detected binary container format; empty when unavailable | +**detected_binary_type** | **str** | Detected operating-system platform; empty when unavailable | **function_count** | **int** | Number of functions in the binary | **is_advanced** | **bool** | True when the analysis was run in advanced mode | **is_owner** | **bool** | True when the caller is the analysis owner | @@ -22,6 +25,9 @@ Name | Type | Description | Notes **owner_username** | **str** | Username of the analysis owner | **sequencer_version** | **str** | Sequencer version, omitted when not set | [optional] **sha_256_hash** | **str** | SHA-256 hash of the binary | +**supplied_architecture** | **str** | User-supplied instruction-set architecture; \"AUTO\" when not overridden | +**supplied_binary_format** | **str** | User-supplied binary container format; \"AUTO\" when not overridden | +**supplied_binary_type** | **str** | User-supplied operating-system platform; \"AUTO\" when not overridden | **team_id** | **int** | Team ID of the analysis | ## Example diff --git a/docs/AnalysisDataTypesGroup.md b/docs/AnalysisDataTypesGroup.md new file mode 100644 index 00000000..6deb9f27 --- /dev/null +++ b/docs/AnalysisDataTypesGroup.md @@ -0,0 +1,30 @@ +# AnalysisDataTypesGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | | +**items** | [**List[DataTypeEntry]**](DataTypeEntry.md) | The analysis's types the returned signatures name, ordered by data_type_id. | + +## Example + +```python +from revengai.models.analysis_data_types_group import AnalysisDataTypesGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisDataTypesGroup from a JSON string +analysis_data_types_group_instance = AnalysisDataTypesGroup.from_json(json) +# print the JSON string representation of the object +print(AnalysisDataTypesGroup.to_json()) + +# convert the object into a dict +analysis_data_types_group_dict = analysis_data_types_group_instance.to_dict() +# create an instance of AnalysisDataTypesGroup from a dict +analysis_data_types_group_from_dict = AnalysisDataTypesGroup.from_dict(analysis_data_types_group_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/AnalysisDataTypesOutputBody.md b/docs/AnalysisDataTypesOutputBody.md new file mode 100644 index 00000000..686d118d --- /dev/null +++ b/docs/AnalysisDataTypesOutputBody.md @@ -0,0 +1,29 @@ +# AnalysisDataTypesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | [**List[DataTypeEntry]**](DataTypeEntry.md) | The stored types, ordered by data_type_id. | + +## Example + +```python +from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisDataTypesOutputBody from a JSON string +analysis_data_types_output_body_instance = AnalysisDataTypesOutputBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisDataTypesOutputBody.to_json()) + +# convert the object into a dict +analysis_data_types_output_body_dict = analysis_data_types_output_body_instance.to_dict() +# create an instance of AnalysisDataTypesOutputBody from a dict +analysis_data_types_output_body_from_dict = AnalysisDataTypesOutputBody.from_dict(analysis_data_types_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalysisLogEntry.md b/docs/AnalysisLogEntry.md new file mode 100644 index 00000000..e2f7b052 --- /dev/null +++ b/docs/AnalysisLogEntry.md @@ -0,0 +1,32 @@ +# AnalysisLogEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**level** | **str** | Severity | +**source** | **str** | Component that emitted the line | +**text** | **str** | Log line text | +**timestamp** | **datetime** | When the line was emitted (UTC) | + +## Example + +```python +from revengai.models.analysis_log_entry import AnalysisLogEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisLogEntry from a JSON string +analysis_log_entry_instance = AnalysisLogEntry.from_json(json) +# print the JSON string representation of the object +print(AnalysisLogEntry.to_json()) + +# convert the object into a dict +analysis_log_entry_dict = analysis_log_entry_instance.to_dict() +# create an instance of AnalysisLogEntry from a dict +analysis_log_entry_from_dict = AnalysisLogEntry.from_dict(analysis_log_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalysisRecordBody.md b/docs/AnalysisRecordBody.md index 876326ba..0c05318f 100644 --- a/docs/AnalysisRecordBody.md +++ b/docs/AnalysisRecordBody.md @@ -12,12 +12,18 @@ Name | Type | Description | Notes **binary_name** | **str** | Binary filename | **binary_size** | **int** | Binary size in bytes | **creation** | **datetime** | When the analysis was created | +**detected_architecture** | **str** | Detected instruction-set architecture; empty when unavailable | +**detected_binary_format** | **str** | Detected binary container format; empty when unavailable | +**detected_binary_type** | **str** | Detected operating-system platform; empty when unavailable | **function_boundaries_hash** | **str** | Hash of the binary's provided function boundaries | **is_owner** | **bool** | True when the caller owns the analysis | **model_id** | **int** | Model ID | **model_name** | **str** | Model name | **sha_256_hash** | **str** | SHA-256 hash of the binary | **status** | **str** | Analysis status | +**supplied_architecture** | **str** | User-supplied instruction-set architecture; \"AUTO\" when not overridden | +**supplied_binary_format** | **str** | User-supplied binary container format; \"AUTO\" when not overridden | +**supplied_binary_type** | **str** | User-supplied operating-system platform; \"AUTO\" when not overridden | **tags** | [**List[AnalysisTagBody]**](AnalysisTagBody.md) | Tags associated with the binary | **username** | **str** | Username of the analysis owner | diff --git a/docs/Argument.md b/docs/Argument.md deleted file mode 100644 index 7de2becc..00000000 --- a/docs/Argument.md +++ /dev/null @@ -1,33 +0,0 @@ -# Argument - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**offset** | **int** | Offset of the argument in the function signature | -**name** | **str** | Name of the argument | -**type** | **str** | Data type of the argument | -**size** | **int** | Size of the argument in bytes | - -## Example - -```python -from revengai.models.argument import Argument - -# TODO update the JSON string below -json = "{}" -# create an instance of Argument from a JSON string -argument_instance = Argument.from_json(json) -# print the JSON string representation of the object -print(Argument.to_json()) - -# convert the object into a dict -argument_dict = argument_instance.to_dict() -# create an instance of Argument from a dict -argument_from_dict = Argument.from_dict(argument_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/ArrayDataType.md b/docs/ArrayDataType.md new file mode 100644 index 00000000..97d9a53c --- /dev/null +++ b/docs/ArrayDataType.md @@ -0,0 +1,38 @@ +# ArrayDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**ArrayDefinition**](ArrayDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.array_data_type import ArrayDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of ArrayDataType from a JSON string +array_data_type_instance = ArrayDataType.from_json(json) +# print the JSON string representation of the object +print(ArrayDataType.to_json()) + +# convert the object into a dict +array_data_type_dict = array_data_type_instance.to_dict() +# create an instance of ArrayDataType from a dict +array_data_type_from_dict = ArrayDataType.from_dict(array_data_type_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/ArrayDefinition.md b/docs/ArrayDefinition.md new file mode 100644 index 00000000..c2b60b09 --- /dev/null +++ b/docs/ArrayDefinition.md @@ -0,0 +1,30 @@ +# ArrayDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | Element count. Zero is a genuinely empty trailing array; absent means it could not be determined. | [optional] +**element_data_type_id** | **int** | The element type. | [optional] + +## Example + +```python +from revengai.models.array_definition import ArrayDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of ArrayDefinition from a JSON string +array_definition_instance = ArrayDefinition.from_json(json) +# print the JSON string representation of the object +print(ArrayDefinition.to_json()) + +# convert the object into a dict +array_definition_dict = array_definition_instance.to_dict() +# create an instance of ArrayDefinition from a dict +array_definition_from_dict = ArrayDefinition.from_dict(array_definition_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/BaseDataType.md b/docs/BaseDataType.md new file mode 100644 index 00000000..ebfd2983 --- /dev/null +++ b/docs/BaseDataType.md @@ -0,0 +1,37 @@ +# BaseDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.base_data_type import BaseDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseDataType from a JSON string +base_data_type_instance = BaseDataType.from_json(json) +# print the JSON string representation of the object +print(BaseDataType.to_json()) + +# convert the object into a dict +base_data_type_dict = base_data_type_instance.to_dict() +# create an instance of BaseDataType from a dict +base_data_type_from_dict = BaseDataType.from_dict(base_data_type_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/BaseResponseFunctionDataTypes.md b/docs/BaseResponseFunctionDataTypes.md deleted file mode 100644 index f0bc91ed..00000000 --- a/docs/BaseResponseFunctionDataTypes.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseFunctionDataTypes - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**FunctionDataTypes**](FunctionDataTypes.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseFunctionDataTypes from a JSON string -base_response_function_data_types_instance = BaseResponseFunctionDataTypes.from_json(json) -# print the JSON string representation of the object -print(BaseResponseFunctionDataTypes.to_json()) - -# convert the object into a dict -base_response_function_data_types_dict = base_response_function_data_types_instance.to_dict() -# create an instance of BaseResponseFunctionDataTypes from a dict -base_response_function_data_types_from_dict = BaseResponseFunctionDataTypes.from_dict(base_response_function_data_types_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/BaseResponseFunctionDataTypesList.md b/docs/BaseResponseFunctionDataTypesList.md deleted file mode 100644 index b3991403..00000000 --- a/docs/BaseResponseFunctionDataTypesList.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseFunctionDataTypesList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**FunctionDataTypesList**](FunctionDataTypesList.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseFunctionDataTypesList from a JSON string -base_response_function_data_types_list_instance = BaseResponseFunctionDataTypesList.from_json(json) -# print the JSON string representation of the object -print(BaseResponseFunctionDataTypesList.to_json()) - -# convert the object into a dict -base_response_function_data_types_list_dict = base_response_function_data_types_list_instance.to_dict() -# create an instance of BaseResponseFunctionDataTypesList from a dict -base_response_function_data_types_list_from_dict = BaseResponseFunctionDataTypesList.from_dict(base_response_function_data_types_list_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/BaseResponseGenerateFunctionDataTypes.md b/docs/BaseResponseGenerateFunctionDataTypes.md deleted file mode 100644 index 2d74b8e1..00000000 --- a/docs/BaseResponseGenerateFunctionDataTypes.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseGenerateFunctionDataTypes - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**GenerateFunctionDataTypes**](GenerateFunctionDataTypes.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseGenerateFunctionDataTypes from a JSON string -base_response_generate_function_data_types_instance = BaseResponseGenerateFunctionDataTypes.from_json(json) -# print the JSON string representation of the object -print(BaseResponseGenerateFunctionDataTypes.to_json()) - -# convert the object into a dict -base_response_generate_function_data_types_dict = base_response_generate_function_data_types_instance.to_dict() -# create an instance of BaseResponseGenerateFunctionDataTypes from a dict -base_response_generate_function_data_types_from_dict = BaseResponseGenerateFunctionDataTypes.from_dict(base_response_generate_function_data_types_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/BaseResponseGenerationStatusList.md b/docs/BaseResponseGenerationStatusList.md deleted file mode 100644 index d2e7600a..00000000 --- a/docs/BaseResponseGenerationStatusList.md +++ /dev/null @@ -1,33 +0,0 @@ -# BaseResponseGenerationStatusList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**GenerationStatusList**](GenerationStatusList.md) | | [optional] -**message** | **str** | | [optional] -**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] -**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] - -## Example - -```python -from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList - -# TODO update the JSON string below -json = "{}" -# create an instance of BaseResponseGenerationStatusList from a JSON string -base_response_generation_status_list_instance = BaseResponseGenerationStatusList.from_json(json) -# print the JSON string representation of the object -print(BaseResponseGenerationStatusList.to_json()) - -# convert the object into a dict -base_response_generation_status_list_dict = base_response_generation_status_list_instance.to_dict() -# create an instance of BaseResponseGenerationStatusList from a dict -base_response_generation_status_list_from_dict = BaseResponseGenerationStatusList.from_dict(base_response_generation_status_list_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/BatchFunctionSignatureEntry.md b/docs/BatchFunctionSignatureEntry.md new file mode 100644 index 00000000..e4fbaa1c --- /dev/null +++ b/docs/BatchFunctionSignatureEntry.md @@ -0,0 +1,38 @@ +# BatchFunctionSignatureEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | The analysis this signature belongs to. Its data_type_ids resolve against this analysis only. | +**calling_convention** | **str** | Calling convention, when the producer reported one. | [optional] +**created_at** | **datetime** | When this signature was extracted. | [optional] +**function_id** | **int** | | +**function_name** | **str** | Current name of the function. | +**has_signature** | **bool** | Whether a signature was extracted for this function. False is a normal result: no signature is recorded unless data type extraction ran for the analysis, and thunks and external functions are skipped when it does. | +**parameters** | [**List[SignatureParameterEntry]**](SignatureParameterEntry.md) | Parameters in argument order. Empty with has_signature true means the function is known to take no arguments. | +**return_data_type_id** | **int** | Return type, resolvable against the analysis data types list. Absent for an unresolved return type. | [optional] +**source_function_id** | **int** | The function this signature was copied from, when it was transferred rather than extracted. | [optional] +**source_type** | **str** | Where this signature came from. | [optional] + +## Example + +```python +from revengai.models.batch_function_signature_entry import BatchFunctionSignatureEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchFunctionSignatureEntry from a JSON string +batch_function_signature_entry_instance = BatchFunctionSignatureEntry.from_json(json) +# print the JSON string representation of the object +print(BatchFunctionSignatureEntry.to_json()) + +# convert the object into a dict +batch_function_signature_entry_dict = batch_function_signature_entry_instance.to_dict() +# create an instance of BatchFunctionSignatureEntry from a dict +batch_function_signature_entry_from_dict = BatchFunctionSignatureEntry.from_dict(batch_function_signature_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchUpdateDataTypesInputBody.md b/docs/BatchUpdateDataTypesInputBody.md deleted file mode 100644 index f351805a..00000000 --- a/docs/BatchUpdateDataTypesInputBody.md +++ /dev/null @@ -1,29 +0,0 @@ -# BatchUpdateDataTypesInputBody - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**functions** | [**List[BatchUpdateDataTypesItem]**](BatchUpdateDataTypesItem.md) | List of functions to update. All function IDs must belong to the analysis in the URL. | - -## Example - -```python -from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody - -# TODO update the JSON string below -json = "{}" -# create an instance of BatchUpdateDataTypesInputBody from a JSON string -batch_update_data_types_input_body_instance = BatchUpdateDataTypesInputBody.from_json(json) -# print the JSON string representation of the object -print(BatchUpdateDataTypesInputBody.to_json()) - -# convert the object into a dict -batch_update_data_types_input_body_dict = batch_update_data_types_input_body_instance.to_dict() -# create an instance of BatchUpdateDataTypesInputBody from a dict -batch_update_data_types_input_body_from_dict = BatchUpdateDataTypesInputBody.from_dict(batch_update_data_types_input_body_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchUpdateDataTypesItem.md b/docs/BatchUpdateDataTypesItem.md deleted file mode 100644 index f23a885b..00000000 --- a/docs/BatchUpdateDataTypesItem.md +++ /dev/null @@ -1,31 +0,0 @@ -# BatchUpdateDataTypesItem - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_types** | **object** | | -**data_types_version** | **int** | Current stored version. Pass 0 on the first write. | -**function_id** | **int** | Function ID | - -## Example - -```python -from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem - -# TODO update the JSON string below -json = "{}" -# create an instance of BatchUpdateDataTypesItem from a JSON string -batch_update_data_types_item_instance = BatchUpdateDataTypesItem.from_json(json) -# print the JSON string representation of the object -print(BatchUpdateDataTypesItem.to_json()) - -# convert the object into a dict -batch_update_data_types_item_dict = batch_update_data_types_item_instance.to_dict() -# create an instance of BatchUpdateDataTypesItem from a dict -batch_update_data_types_item_from_dict = BatchUpdateDataTypesItem.from_dict(batch_update_data_types_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchUpdateDataTypesOutputBody.md b/docs/BatchUpdateDataTypesOutputBody.md deleted file mode 100644 index de881636..00000000 --- a/docs/BatchUpdateDataTypesOutputBody.md +++ /dev/null @@ -1,29 +0,0 @@ -# BatchUpdateDataTypesOutputBody - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**results** | [**List[BatchUpdateDataTypesResult]**](BatchUpdateDataTypesResult.md) | Per-function outcomes in the same order as the input | - -## Example - -```python -from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody - -# TODO update the JSON string below -json = "{}" -# create an instance of BatchUpdateDataTypesOutputBody from a JSON string -batch_update_data_types_output_body_instance = BatchUpdateDataTypesOutputBody.from_json(json) -# print the JSON string representation of the object -print(BatchUpdateDataTypesOutputBody.to_json()) - -# convert the object into a dict -batch_update_data_types_output_body_dict = batch_update_data_types_output_body_instance.to_dict() -# create an instance of BatchUpdateDataTypesOutputBody from a dict -batch_update_data_types_output_body_from_dict = BatchUpdateDataTypesOutputBody.from_dict(batch_update_data_types_output_body_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchUpdateDataTypesResult.md b/docs/BatchUpdateDataTypesResult.md deleted file mode 100644 index 099b2ede..00000000 --- a/docs/BatchUpdateDataTypesResult.md +++ /dev/null @@ -1,33 +0,0 @@ -# BatchUpdateDataTypesResult - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_types** | **object** | | [optional] -**data_types_version** | **int** | Version after update (present when status is 'updated') | [optional] -**error** | **str** | Error message (present when status is 'error') | [optional] -**function_id** | **int** | Function ID | -**status** | **str** | Outcome for this function | - -## Example - -```python -from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult - -# TODO update the JSON string below -json = "{}" -# create an instance of BatchUpdateDataTypesResult from a JSON string -batch_update_data_types_result_instance = BatchUpdateDataTypesResult.from_json(json) -# print the JSON string representation of the object -print(BatchUpdateDataTypesResult.to_json()) - -# convert the object into a dict -batch_update_data_types_result_dict = batch_update_data_types_result_instance.to_dict() -# create an instance of BatchUpdateDataTypesResult from a dict -batch_update_data_types_result_from_dict = BatchUpdateDataTypesResult.from_dict(batch_update_data_types_result_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/BitfieldDataType.md b/docs/BitfieldDataType.md new file mode 100644 index 00000000..a9a73a9b --- /dev/null +++ b/docs/BitfieldDataType.md @@ -0,0 +1,37 @@ +# BitfieldDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.bitfield_data_type import BitfieldDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of BitfieldDataType from a JSON string +bitfield_data_type_instance = BitfieldDataType.from_json(json) +# print the JSON string representation of the object +print(BitfieldDataType.to_json()) + +# convert the object into a dict +bitfield_data_type_dict = bitfield_data_type_instance.to_dict() +# create an instance of BitfieldDataType from a dict +bitfield_data_type_from_dict = BitfieldDataType.from_dict(bitfield_data_type_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/CollectionsApi.md b/docs/CollectionsApi.md index 88af5999..6642c122 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -849,12 +849,11 @@ Name | Type | Description | Notes Delete a collection. -Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). +Deletes a collection along with its binary links, tags, and hierarchy links. The binaries themselves are not deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict ### Example @@ -930,7 +929,6 @@ void (empty response body) **204** | No Content | - | **403** | Forbidden | - | **404** | Not Found | - | -**409** | Conflict | - | **422** | Unprocessable Entity | - | **500** | Internal Server Error | - | diff --git a/docs/CopyFunctionSignaturesInputBody.md b/docs/CopyFunctionSignaturesInputBody.md new file mode 100644 index 00000000..1ce4b894 --- /dev/null +++ b/docs/CopyFunctionSignaturesInputBody.md @@ -0,0 +1,29 @@ +# CopyFunctionSignaturesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**copies** | [**List[CopySignatureItem]**](CopySignatureItem.md) | Signatures to copy. No target may repeat, and no pair may name the same function twice. | + +## Example + +```python +from revengai.models.copy_function_signatures_input_body import CopyFunctionSignaturesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of CopyFunctionSignaturesInputBody from a JSON string +copy_function_signatures_input_body_instance = CopyFunctionSignaturesInputBody.from_json(json) +# print the JSON string representation of the object +print(CopyFunctionSignaturesInputBody.to_json()) + +# convert the object into a dict +copy_function_signatures_input_body_dict = copy_function_signatures_input_body_instance.to_dict() +# create an instance of CopyFunctionSignaturesInputBody from a dict +copy_function_signatures_input_body_from_dict = CopyFunctionSignaturesInputBody.from_dict(copy_function_signatures_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CopyFunctionSignaturesOutputBody.md b/docs/CopyFunctionSignaturesOutputBody.md new file mode 100644 index 00000000..13c6d344 --- /dev/null +++ b/docs/CopyFunctionSignaturesOutputBody.md @@ -0,0 +1,30 @@ +# CopyFunctionSignaturesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | [**List[DataTypeEntry]**](DataTypeEntry.md) | The data types this analysis gained or had replaced, ordered by data_type_id. Empty when every type the copied signatures need was already stored unchanged. | +**signatures** | [**List[FunctionSignatureEntry]**](FunctionSignatureEntry.md) | The stored signatures of the target functions, in request order. | + +## Example + +```python +from revengai.models.copy_function_signatures_output_body import CopyFunctionSignaturesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of CopyFunctionSignaturesOutputBody from a JSON string +copy_function_signatures_output_body_instance = CopyFunctionSignaturesOutputBody.from_json(json) +# print the JSON string representation of the object +print(CopyFunctionSignaturesOutputBody.to_json()) + +# convert the object into a dict +copy_function_signatures_output_body_dict = copy_function_signatures_output_body_instance.to_dict() +# create an instance of CopyFunctionSignaturesOutputBody from a dict +copy_function_signatures_output_body_from_dict = CopyFunctionSignaturesOutputBody.from_dict(copy_function_signatures_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CopySignatureItem.md b/docs/CopySignatureItem.md new file mode 100644 index 00000000..17c5510a --- /dev/null +++ b/docs/CopySignatureItem.md @@ -0,0 +1,30 @@ +# CopySignatureItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_function_id** | **int** | Function to copy the signature from. May belong to another analysis the caller can read. | +**target_function_id** | **int** | Function to copy the signature to. Must belong to the analysis in the URL. | + +## Example + +```python +from revengai.models.copy_signature_item import CopySignatureItem + +# TODO update the JSON string below +json = "{}" +# create an instance of CopySignatureItem from a JSON string +copy_signature_item_instance = CopySignatureItem.from_json(json) +# print the JSON string representation of the object +print(CopySignatureItem.to_json()) + +# convert the object into a dict +copy_signature_item_dict = copy_signature_item_instance.to_dict() +# create an instance of CopySignatureItem from a dict +copy_signature_item_from_dict = CopySignatureItem.from_dict(copy_signature_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateAnalysisDataTypesInputBody.md b/docs/CreateAnalysisDataTypesInputBody.md new file mode 100644 index 00000000..fa4c3a07 --- /dev/null +++ b/docs/CreateAnalysisDataTypesInputBody.md @@ -0,0 +1,29 @@ +# CreateAnalysisDataTypesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | [**List[CreateDataTypeEntry]**](CreateDataTypeEntry.md) | The types to create. Each namespace, name and kind must be new to the analysis. | + +## Example + +```python +from revengai.models.create_analysis_data_types_input_body import CreateAnalysisDataTypesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAnalysisDataTypesInputBody from a JSON string +create_analysis_data_types_input_body_instance = CreateAnalysisDataTypesInputBody.from_json(json) +# print the JSON string representation of the object +print(CreateAnalysisDataTypesInputBody.to_json()) + +# convert the object into a dict +create_analysis_data_types_input_body_dict = create_analysis_data_types_input_body_instance.to_dict() +# create an instance of CreateAnalysisDataTypesInputBody from a dict +create_analysis_data_types_input_body_from_dict = CreateAnalysisDataTypesInputBody.from_dict(create_analysis_data_types_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateArrayDataType.md b/docs/CreateArrayDataType.md new file mode 100644 index 00000000..d010bdd3 --- /dev/null +++ b/docs/CreateArrayDataType.md @@ -0,0 +1,33 @@ +# CreateArrayDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**ArrayDefinition**](ArrayDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_array_data_type import CreateArrayDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateArrayDataType from a JSON string +create_array_data_type_instance = CreateArrayDataType.from_json(json) +# print the JSON string representation of the object +print(CreateArrayDataType.to_json()) + +# convert the object into a dict +create_array_data_type_dict = create_array_data_type_instance.to_dict() +# create an instance of CreateArrayDataType from a dict +create_array_data_type_from_dict = CreateArrayDataType.from_dict(create_array_data_type_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/CreateBaseDataType.md b/docs/CreateBaseDataType.md new file mode 100644 index 00000000..7de948b1 --- /dev/null +++ b/docs/CreateBaseDataType.md @@ -0,0 +1,32 @@ +# CreateBaseDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_base_data_type import CreateBaseDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateBaseDataType from a JSON string +create_base_data_type_instance = CreateBaseDataType.from_json(json) +# print the JSON string representation of the object +print(CreateBaseDataType.to_json()) + +# convert the object into a dict +create_base_data_type_dict = create_base_data_type_instance.to_dict() +# create an instance of CreateBaseDataType from a dict +create_base_data_type_from_dict = CreateBaseDataType.from_dict(create_base_data_type_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/CreateBitfieldDataType.md b/docs/CreateBitfieldDataType.md new file mode 100644 index 00000000..e4c83e8f --- /dev/null +++ b/docs/CreateBitfieldDataType.md @@ -0,0 +1,32 @@ +# CreateBitfieldDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_bitfield_data_type import CreateBitfieldDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateBitfieldDataType from a JSON string +create_bitfield_data_type_instance = CreateBitfieldDataType.from_json(json) +# print the JSON string representation of the object +print(CreateBitfieldDataType.to_json()) + +# convert the object into a dict +create_bitfield_data_type_dict = create_bitfield_data_type_instance.to_dict() +# create an instance of CreateBitfieldDataType from a dict +create_bitfield_data_type_from_dict = CreateBitfieldDataType.from_dict(create_bitfield_data_type_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/CreateDataTypeEntry.md b/docs/CreateDataTypeEntry.md new file mode 100644 index 00000000..afa540e7 --- /dev/null +++ b/docs/CreateDataTypeEntry.md @@ -0,0 +1,34 @@ +# CreateDataTypeEntry + +A data type to create. `kind` selects the variant and so which definition the type must carry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**FunctionTypeDefinition**](FunctionTypeDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_data_type_entry import CreateDataTypeEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateDataTypeEntry from a JSON string +create_data_type_entry_instance = CreateDataTypeEntry.from_json(json) +# print the JSON string representation of the object +print(CreateDataTypeEntry.to_json()) + +# convert the object into a dict +create_data_type_entry_dict = create_data_type_entry_instance.to_dict() +# create an instance of CreateDataTypeEntry from a dict +create_data_type_entry_from_dict = CreateDataTypeEntry.from_dict(create_data_type_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEnumDataType.md b/docs/CreateEnumDataType.md new file mode 100644 index 00000000..0f93e728 --- /dev/null +++ b/docs/CreateEnumDataType.md @@ -0,0 +1,33 @@ +# CreateEnumDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**EnumDefinition**](EnumDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_enum_data_type import CreateEnumDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateEnumDataType from a JSON string +create_enum_data_type_instance = CreateEnumDataType.from_json(json) +# print the JSON string representation of the object +print(CreateEnumDataType.to_json()) + +# convert the object into a dict +create_enum_data_type_dict = create_enum_data_type_instance.to_dict() +# create an instance of CreateEnumDataType from a dict +create_enum_data_type_from_dict = CreateEnumDataType.from_dict(create_enum_data_type_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/CreateFunctionDataType.md b/docs/CreateFunctionDataType.md new file mode 100644 index 00000000..2ff9fe9f --- /dev/null +++ b/docs/CreateFunctionDataType.md @@ -0,0 +1,33 @@ +# CreateFunctionDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**FunctionTypeDefinition**](FunctionTypeDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_function_data_type import CreateFunctionDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateFunctionDataType from a JSON string +create_function_data_type_instance = CreateFunctionDataType.from_json(json) +# print the JSON string representation of the object +print(CreateFunctionDataType.to_json()) + +# convert the object into a dict +create_function_data_type_dict = create_function_data_type_instance.to_dict() +# create an instance of CreateFunctionDataType from a dict +create_function_data_type_from_dict = CreateFunctionDataType.from_dict(create_function_data_type_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/CreatePointerDataType.md b/docs/CreatePointerDataType.md new file mode 100644 index 00000000..4f37f679 --- /dev/null +++ b/docs/CreatePointerDataType.md @@ -0,0 +1,33 @@ +# CreatePointerDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**PointerDefinition**](PointerDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_pointer_data_type import CreatePointerDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatePointerDataType from a JSON string +create_pointer_data_type_instance = CreatePointerDataType.from_json(json) +# print the JSON string representation of the object +print(CreatePointerDataType.to_json()) + +# convert the object into a dict +create_pointer_data_type_dict = create_pointer_data_type_instance.to_dict() +# create an instance of CreatePointerDataType from a dict +create_pointer_data_type_from_dict = CreatePointerDataType.from_dict(create_pointer_data_type_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/CreateStructDataType.md b/docs/CreateStructDataType.md new file mode 100644 index 00000000..7ea5062f --- /dev/null +++ b/docs/CreateStructDataType.md @@ -0,0 +1,33 @@ +# CreateStructDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**StructDefinition**](StructDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_struct_data_type import CreateStructDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateStructDataType from a JSON string +create_struct_data_type_instance = CreateStructDataType.from_json(json) +# print the JSON string representation of the object +print(CreateStructDataType.to_json()) + +# convert the object into a dict +create_struct_data_type_dict = create_struct_data_type_instance.to_dict() +# create an instance of CreateStructDataType from a dict +create_struct_data_type_from_dict = CreateStructDataType.from_dict(create_struct_data_type_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/CreateTypedefDataType.md b/docs/CreateTypedefDataType.md new file mode 100644 index 00000000..57242d78 --- /dev/null +++ b/docs/CreateTypedefDataType.md @@ -0,0 +1,33 @@ +# CreateTypedefDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**TypedefDefinition**](TypedefDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_typedef_data_type import CreateTypedefDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTypedefDataType from a JSON string +create_typedef_data_type_instance = CreateTypedefDataType.from_json(json) +# print the JSON string representation of the object +print(CreateTypedefDataType.to_json()) + +# convert the object into a dict +create_typedef_data_type_dict = create_typedef_data_type_instance.to_dict() +# create an instance of CreateTypedefDataType from a dict +create_typedef_data_type_from_dict = CreateTypedefDataType.from_dict(create_typedef_data_type_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/CreateUnionDataType.md b/docs/CreateUnionDataType.md new file mode 100644 index 00000000..487f6ed0 --- /dev/null +++ b/docs/CreateUnionDataType.md @@ -0,0 +1,33 @@ +# CreateUnionDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition** | [**UnionDefinition**](UnionDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_union_data_type import CreateUnionDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateUnionDataType from a JSON string +create_union_data_type_instance = CreateUnionDataType.from_json(json) +# print the JSON string representation of the object +print(CreateUnionDataType.to_json()) + +# convert the object into a dict +create_union_data_type_dict = create_union_data_type_instance.to_dict() +# create an instance of CreateUnionDataType from a dict +create_union_data_type_from_dict = CreateUnionDataType.from_dict(create_union_data_type_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/CreateUnknownDataType.md b/docs/CreateUnknownDataType.md new file mode 100644 index 00000000..0d1f301a --- /dev/null +++ b/docs/CreateUnknownDataType.md @@ -0,0 +1,32 @@ +# CreateUnknownDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.create_unknown_data_type import CreateUnknownDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateUnknownDataType from a JSON string +create_unknown_data_type_instance = CreateUnknownDataType.from_json(json) +# print the JSON string representation of the object +print(CreateUnknownDataType.to_json()) + +# convert the object into a dict +create_unknown_data_type_dict = create_unknown_data_type_instance.to_dict() +# create an instance of CreateUnknownDataType from a dict +create_unknown_data_type_from_dict = CreateUnknownDataType.from_dict(create_unknown_data_type_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/DataTypeEntry.md b/docs/DataTypeEntry.md new file mode 100644 index 00000000..cb9b13c1 --- /dev/null +++ b/docs/DataTypeEntry.md @@ -0,0 +1,39 @@ +# DataTypeEntry + +A data type extracted from the binary. `kind` selects the variant and so which definition the type carries. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**FunctionTypeDefinition**](FunctionTypeDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.data_type_entry import DataTypeEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of DataTypeEntry from a JSON string +data_type_entry_instance = DataTypeEntry.from_json(json) +# print the JSON string representation of the object +print(DataTypeEntry.to_json()) + +# convert the object into a dict +data_type_entry_dict = data_type_entry_instance.to_dict() +# create an instance of DataTypeEntry from a dict +data_type_entry_from_dict = DataTypeEntry.from_dict(data_type_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DataTypeEnumValueEntry.md b/docs/DataTypeEnumValueEntry.md new file mode 100644 index 00000000..c4784b17 --- /dev/null +++ b/docs/DataTypeEnumValueEntry.md @@ -0,0 +1,30 @@ +# DataTypeEnumValueEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Constant name. | +**value** | **str** | Constant value, a decimal integer as a string, with no leading zeros. A string because the value may be negative or exceed 64 unsigned bits, which a JSON number cannot carry safely. | + +## Example + +```python +from revengai.models.data_type_enum_value_entry import DataTypeEnumValueEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of DataTypeEnumValueEntry from a JSON string +data_type_enum_value_entry_instance = DataTypeEnumValueEntry.from_json(json) +# print the JSON string representation of the object +print(DataTypeEnumValueEntry.to_json()) + +# convert the object into a dict +data_type_enum_value_entry_dict = data_type_enum_value_entry_instance.to_dict() +# create an instance of DataTypeEnumValueEntry from a dict +data_type_enum_value_entry_from_dict = DataTypeEnumValueEntry.from_dict(data_type_enum_value_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DataTypeFunctionEntry.md b/docs/DataTypeFunctionEntry.md new file mode 100644 index 00000000..2b345e79 --- /dev/null +++ b/docs/DataTypeFunctionEntry.md @@ -0,0 +1,30 @@ +# DataTypeFunctionEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_id** | **int** | | +**function_name** | **str** | Current name of the function. | + +## Example + +```python +from revengai.models.data_type_function_entry import DataTypeFunctionEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of DataTypeFunctionEntry from a JSON string +data_type_function_entry_instance = DataTypeFunctionEntry.from_json(json) +# print the JSON string representation of the object +print(DataTypeFunctionEntry.to_json()) + +# convert the object into a dict +data_type_function_entry_dict = data_type_function_entry_instance.to_dict() +# create an instance of DataTypeFunctionEntry from a dict +data_type_function_entry_from_dict = DataTypeFunctionEntry.from_dict(data_type_function_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DataTypeFunctionParameterEntry.md b/docs/DataTypeFunctionParameterEntry.md new file mode 100644 index 00000000..f32a1f01 --- /dev/null +++ b/docs/DataTypeFunctionParameterEntry.md @@ -0,0 +1,32 @@ +# DataTypeFunctionParameterEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The parameter's type. | [optional] +**name** | **str** | Parameter name, when the producer had one. | [optional] +**ordinal** | **int** | Zero-based argument position. | +**size** | **int** | Parameter size in bytes. | + +## Example + +```python +from revengai.models.data_type_function_parameter_entry import DataTypeFunctionParameterEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of DataTypeFunctionParameterEntry from a JSON string +data_type_function_parameter_entry_instance = DataTypeFunctionParameterEntry.from_json(json) +# print the JSON string representation of the object +print(DataTypeFunctionParameterEntry.to_json()) + +# convert the object into a dict +data_type_function_parameter_entry_dict = data_type_function_parameter_entry_instance.to_dict() +# create an instance of DataTypeFunctionParameterEntry from a dict +data_type_function_parameter_entry_from_dict = DataTypeFunctionParameterEntry.from_dict(data_type_function_parameter_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DataTypeMemberEntry.md b/docs/DataTypeMemberEntry.md new file mode 100644 index 00000000..a7972f22 --- /dev/null +++ b/docs/DataTypeMemberEntry.md @@ -0,0 +1,35 @@ +# DataTypeMemberEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bit_offset** | **int** | Bit offset from the start of the containing type, for bitfields. | [optional] +**bit_size** | **int** | Width in bits, for bitfields. | [optional] +**data_type_id** | **int** | The member's type. | [optional] +**is_bitfield** | **bool** | Whether this member is a bitfield. | +**name** | **str** | Member name, absent for unnamed padding. | [optional] +**offset** | **int** | Byte offset from the start of the containing type. | +**size** | **int** | Member size in bytes. | + +## Example + +```python +from revengai.models.data_type_member_entry import DataTypeMemberEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of DataTypeMemberEntry from a JSON string +data_type_member_entry_instance = DataTypeMemberEntry.from_json(json) +# print the JSON string representation of the object +print(DataTypeMemberEntry.to_json()) + +# convert the object into a dict +data_type_member_entry_dict = data_type_member_entry_instance.to_dict() +# create an instance of DataTypeMemberEntry from a dict +data_type_member_entry_from_dict = DataTypeMemberEntry.from_dict(data_type_member_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DataTypeVersion.md b/docs/DataTypeVersion.md new file mode 100644 index 00000000..db523faf --- /dev/null +++ b/docs/DataTypeVersion.md @@ -0,0 +1,31 @@ +# DataTypeVersion + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updated_at** | **datetime** | When this version was written. Absent on a version that predates the recorded history. | [optional] +**updated_by** | [**HistoryActor**](HistoryActor.md) | Who wrote this version. Absent on a version that predates the recorded history. | [optional] +**value** | [**DataTypeEntry**](DataTypeEntry.md) | The type as it stood in this version. | + +## Example + +```python +from revengai.models.data_type_version import DataTypeVersion + +# TODO update the JSON string below +json = "{}" +# create an instance of DataTypeVersion from a JSON string +data_type_version_instance = DataTypeVersion.from_json(json) +# print the JSON string representation of the object +print(DataTypeVersion.to_json()) + +# convert the object into a dict +data_type_version_dict = data_type_version_instance.to_dict() +# create an instance of DataTypeVersion from a dict +data_type_version_from_dict = DataTypeVersion.from_dict(data_type_version_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/DataTypesApi.md b/docs/DataTypesApi.md new file mode 100644 index 00000000..3e5f9ad5 --- /dev/null +++ b/docs/DataTypesApi.md @@ -0,0 +1,1113 @@ +# revengai.DataTypesApi + +All URIs are relative to *https://api.reveng.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v3_copy_function_signatures**](DataTypesApi.md#v3_copy_function_signatures) | **POST** /v3/analyses/{analysis_id}/signatures/copy | Copy function signatures +[**v3_create_analysis_data_types**](DataTypesApi.md#v3_create_analysis_data_types) | **POST** /v3/analyses/{analysis_id}/data-types | Create an analysis's data types +[**v3_get_analysis_data_type**](DataTypesApi.md#v3_get_analysis_data_type) | **GET** /v3/analyses/{analysis_id}/data-types/{data_type_id} | Get one of an analysis's data types +[**v3_get_analysis_data_type_history**](DataTypesApi.md#v3_get_analysis_data_type_history) | **GET** /v3/analyses/{analysis_id}/data-types/{data_type_id}/history | Get a data type's edit history +[**v3_get_function_signature**](DataTypesApi.md#v3_get_function_signature) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/signature | Get a function's signature +[**v3_get_function_signature_history**](DataTypesApi.md#v3_get_function_signature_history) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/signature/history | Get a function signature's edit history +[**v3_list_analysis_data_types**](DataTypesApi.md#v3_list_analysis_data_types) | **GET** /v3/analyses/{analysis_id}/data-types | List an analysis's data types +[**v3_list_data_type_functions**](DataTypesApi.md#v3_list_data_type_functions) | **GET** /v3/analyses/{analysis_id}/data-types/{data_type_id}/functions | List the functions using a data type +[**v3_list_function_signatures**](DataTypesApi.md#v3_list_function_signatures) | **GET** /v3/functions/signatures | Get signatures for many functions +[**v3_update_analysis_data_types**](DataTypesApi.md#v3_update_analysis_data_types) | **PUT** /v3/analyses/{analysis_id}/data-types | Update an analysis's data types +[**v3_update_function_signature**](DataTypesApi.md#v3_update_function_signature) | **PUT** /v3/analyses/{analysis_id}/functions/{function_id}/signature | Update a function's signature + + +# **v3_copy_function_signatures** +> CopyFunctionSignaturesOutputBody v3_copy_function_signatures(analysis_id, copy_function_signatures_input_body) + +Copy function signatures + +Replaces each target function's signature with a copy of its source's parameters, return type and calling convention. Every target must belong to this analysis; a source may belong to any analysis the caller can read. The whole request is rejected if any pair is invalid. + +A `data_type_id` means nothing outside the analysis that issued it, so the types a copied signature needs are resolved against this analysis by namespace, name and kind. A type this analysis already has under that key has its definition replaced by the source's; a type it lacks is created. Copied signatures get a `source_type` of `USER` and a `source_function_id`, and their previous value is retained. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.copy_function_signatures_input_body import CopyFunctionSignaturesInputBody +from revengai.models.copy_function_signatures_output_body import CopyFunctionSignaturesOutputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + copy_function_signatures_input_body = revengai.CopyFunctionSignaturesInputBody() # CopyFunctionSignaturesInputBody | + + try: + # Copy function signatures + api_response = api_instance.v3_copy_function_signatures(analysis_id, copy_function_signatures_input_body) + print("The response of DataTypesApi->v3_copy_function_signatures:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_copy_function_signatures: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **copy_function_signatures_input_body** | [**CopyFunctionSignaturesInputBody**](CopyFunctionSignaturesInputBody.md)| | + +### Return type + +[**CopyFunctionSignaturesOutputBody**](CopyFunctionSignaturesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_create_analysis_data_types** +> AnalysisDataTypesOutputBody v3_create_analysis_data_types(analysis_id, create_analysis_data_types_input_body) + +Create an analysis's data types + +Adds user-authored types to an analysis. Many types can be created in one request; the whole request is rejected if any of them is invalid. Ids are assigned by the server and returned here. Stored types get a `source_type` of `USER`. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody +from revengai.models.create_analysis_data_types_input_body import CreateAnalysisDataTypesInputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + create_analysis_data_types_input_body = revengai.CreateAnalysisDataTypesInputBody() # CreateAnalysisDataTypesInputBody | + + try: + # Create an analysis's data types + api_response = api_instance.v3_create_analysis_data_types(analysis_id, create_analysis_data_types_input_body) + print("The response of DataTypesApi->v3_create_analysis_data_types:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_create_analysis_data_types: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **create_analysis_data_types_input_body** | [**CreateAnalysisDataTypesInputBody**](CreateAnalysisDataTypesInputBody.md)| | + +### Return type + +[**AnalysisDataTypesOutputBody**](AnalysisDataTypesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_analysis_data_type** +> DataTypeEntry v3_get_analysis_data_type(analysis_id, data_type_id) + +Get one of an analysis's data types + +Returns a single data type by its `data_type_id`, byte-identical to the entry the data types list returns for it — same variant, same fields, same definition — so a client can cache and invalidate rows from either endpoint interchangeably. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.data_type_entry import DataTypeEntry +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + data_type_id = 56 # int | Data type ID, as returned by the data types list for this analysis. 0 is a valid id. + + try: + # Get one of an analysis's data types + api_response = api_instance.v3_get_analysis_data_type(analysis_id, data_type_id) + print("The response of DataTypesApi->v3_get_analysis_data_type:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_get_analysis_data_type: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **data_type_id** | **int**| Data type ID, as returned by the data types list for this analysis. 0 is a valid id. | + +### Return type + +[**DataTypeEntry**](DataTypeEntry.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_analysis_data_type_history** +> GetDataTypeHistoryBody v3_get_analysis_data_type_history(analysis_id, data_type_id) + +Get a data type's edit history + +The versions a data type has held, newest first, each attributed to the edit that wrote it. The first value is the current value. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + data_type_id = 56 # int | Data type ID, as returned by the data types list for this analysis. 0 is a valid id. + + try: + # Get a data type's edit history + api_response = api_instance.v3_get_analysis_data_type_history(analysis_id, data_type_id) + print("The response of DataTypesApi->v3_get_analysis_data_type_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_get_analysis_data_type_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **data_type_id** | **int**| Data type ID, as returned by the data types list for this analysis. 0 is a valid id. | + +### Return type + +[**GetDataTypeHistoryBody**](GetDataTypeHistoryBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_function_signature** +> FunctionSignatureBody v3_get_function_signature(analysis_id, function_id, include_data_types=include_data_types) + +Get a function's signature + +Returns the extracted signature for one function: its parameters, return type and calling convention. Pass `include_data_types=true` to also get the data types it names. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.function_signature_body import FunctionSignatureBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + function_id = 56 # int | Function ID + include_data_types = True # bool | Include the data types the signature names in the response. (optional) + + try: + # Get a function's signature + api_response = api_instance.v3_get_function_signature(analysis_id, function_id, include_data_types=include_data_types) + print("The response of DataTypesApi->v3_get_function_signature:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_get_function_signature: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **function_id** | **int**| Function ID | + **include_data_types** | **bool**| Include the data types the signature names in the response. | [optional] + +### Return type + +[**FunctionSignatureBody**](FunctionSignatureBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_function_signature_history** +> GetFunctionSignatureHistoryBody v3_get_function_signature_history(analysis_id, function_id) + +Get a function signature's edit history + +The versions a function's signature has held, newest first, each attributed to the edit that wrote it. The first value is the current value. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + function_id = 56 # int | Function ID + + try: + # Get a function signature's edit history + api_response = api_instance.v3_get_function_signature_history(analysis_id, function_id) + print("The response of DataTypesApi->v3_get_function_signature_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_get_function_signature_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **function_id** | **int**| Function ID | + +### Return type + +[**GetFunctionSignatureHistoryBody**](GetFunctionSignatureHistoryBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_list_analysis_data_types** +> ListAnalysisDataTypesOutputBody v3_list_analysis_data_types(analysis_id, offset=offset, limit=limit, kind=kind, namespace=namespace, search=search, source_type=source_type, order_by=order_by, order=order) + +List an analysis's data types + +Paginated, filterable list of the data types extracted from the binary — structs, unions, enums, typedefs and the rest. Every entry carries its full definition, so paging this list once resolves every `data_type_id` a definition or signature refers to; no follow-up request per id is needed. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.list_analysis_data_types_output_body import ListAnalysisDataTypesOutputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + offset = 0 # int | Pagination offset. (optional) (default to 0) + limit = 100 # int | Page size. (optional) (default to 100) + kind = ['kind_example'] # List[str] | Only return types of these kinds. Repeat for more than one; empty means no filter. (optional) + namespace = ['namespace_example'] # List[Optional[str]] | Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace. (optional) + search = 'search_example' # str | Only return types whose name contains this term. Wildcards in the term are matched literally. (optional) + source_type = ['source_type_example'] # List[str] | Only return types from these sources. Empty means no filter. (optional) + order_by = name # str | Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind. (optional) (default to name) + order = ASC # str | Sort direction. (optional) (default to ASC) + + try: + # List an analysis's data types + api_response = api_instance.v3_list_analysis_data_types(analysis_id, offset=offset, limit=limit, kind=kind, namespace=namespace, search=search, source_type=source_type, order_by=order_by, order=order) + print("The response of DataTypesApi->v3_list_analysis_data_types:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_list_analysis_data_types: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **offset** | **int**| Pagination offset. | [optional] [default to 0] + **limit** | **int**| Page size. | [optional] [default to 100] + **kind** | [**List[str]**](str.md)| Only return types of these kinds. Repeat for more than one; empty means no filter. | [optional] + **namespace** | [**List[Optional[str]]**](str.md)| Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace. | [optional] + **search** | **str**| Only return types whose name contains this term. Wildcards in the term are matched literally. | [optional] + **source_type** | [**List[str]**](str.md)| Only return types from these sources. Empty means no filter. | [optional] + **order_by** | **str**| Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind. | [optional] [default to name] + **order** | **str**| Sort direction. | [optional] [default to ASC] + +### Return type + +[**ListAnalysisDataTypesOutputBody**](ListAnalysisDataTypesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_list_data_type_functions** +> ListDataTypeFunctionsBody v3_list_data_type_functions(analysis_id, data_type_id, page_size=page_size, after_function_id=after_function_id) + +List the functions using a data type + +Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.list_data_type_functions_body import ListDataTypeFunctionsBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + data_type_id = 56 # int | Data type ID, as returned by the data types list for this analysis. 0 is a valid id. + page_size = 50 # int | Page size. (optional) (default to 50) + after_function_id = 0 # int | Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function. (optional) (default to 0) + + try: + # List the functions using a data type + api_response = api_instance.v3_list_data_type_functions(analysis_id, data_type_id, page_size=page_size, after_function_id=after_function_id) + print("The response of DataTypesApi->v3_list_data_type_functions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_list_data_type_functions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **data_type_id** | **int**| Data type ID, as returned by the data types list for this analysis. 0 is a valid id. | + **page_size** | **int**| Page size. | [optional] [default to 50] + **after_function_id** | **int**| Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function. | [optional] [default to 0] + +### Return type + +[**ListDataTypeFunctionsBody**](ListDataTypeFunctionsBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_list_function_signatures** +> ListFunctionSignaturesOutputBody v3_list_function_signatures(function_ids, include_data_types=include_data_types) + +Get signatures for many functions + +Returns the extracted signature for each supplied function ID, in request order. The functions need not share an analysis; each entry names the analysis its `data_type_id`s resolve against. Pass `include_data_types=true` to also get those data types, grouped by analysis. The caller must have read access to every function or the request is rejected. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.list_function_signatures_output_body import ListFunctionSignaturesOutputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + function_ids = [56] # List[int] | Function IDs to fetch signatures for. + include_data_types = True # bool | Include the data types the signatures name in the response. (optional) + + try: + # Get signatures for many functions + api_response = api_instance.v3_list_function_signatures(function_ids, include_data_types=include_data_types) + print("The response of DataTypesApi->v3_list_function_signatures:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_list_function_signatures: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_ids** | [**List[int]**](int.md)| Function IDs to fetch signatures for. | + **include_data_types** | **bool**| Include the data types the signatures name in the response. | [optional] + +### Return type + +[**ListFunctionSignaturesOutputBody**](ListFunctionSignaturesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_update_analysis_data_types** +> AnalysisDataTypesOutputBody v3_update_analysis_data_types(analysis_id, update_analysis_data_types_input_body) + +Update an analysis's data types + +Replaces stored types in full: a field left out of the request is cleared. Many types can be updated in one request; the whole request is rejected if any of them is invalid. `kind` may be changed, and the definition must then match the new kind. Updated types get a `source_type` of `USER`, and their previous value is retained. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody +from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + update_analysis_data_types_input_body = revengai.UpdateAnalysisDataTypesInputBody() # UpdateAnalysisDataTypesInputBody | + + try: + # Update an analysis's data types + api_response = api_instance.v3_update_analysis_data_types(analysis_id, update_analysis_data_types_input_body) + print("The response of DataTypesApi->v3_update_analysis_data_types:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_update_analysis_data_types: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **update_analysis_data_types_input_body** | [**UpdateAnalysisDataTypesInputBody**](UpdateAnalysisDataTypesInputBody.md)| | + +### Return type + +[**AnalysisDataTypesOutputBody**](AnalysisDataTypesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_update_function_signature** +> FunctionSignatureEntry v3_update_function_signature(analysis_id, function_id, update_function_signature_input_body) + +Update a function's signature + +Replaces a function's parameters, return type and calling convention in full — anything left out of the request is cleared. Parameter and return types are `data_type_id`s belonging to this analysis. Edits an extracted signature only: a function with `has_signature` false is rejected with 404. The stored signature gets a `source_type` of `USER`, and its previous value is retained. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.function_signature_entry import FunctionSignatureEntry +from revengai.models.update_function_signature_input_body import UpdateFunctionSignatureInputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.DataTypesApi(api_client) + analysis_id = 56 # int | Analysis ID + function_id = 56 # int | Function ID + update_function_signature_input_body = revengai.UpdateFunctionSignatureInputBody() # UpdateFunctionSignatureInputBody | + + try: + # Update a function's signature + api_response = api_instance.v3_update_function_signature(analysis_id, function_id, update_function_signature_input_body) + print("The response of DataTypesApi->v3_update_function_signature:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DataTypesApi->v3_update_function_signature: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **function_id** | **int**| Function ID | + **update_function_signature_input_body** | [**UpdateFunctionSignatureInputBody**](UpdateFunctionSignatureInputBody.md)| | + +### Return type + +[**FunctionSignatureEntry**](FunctionSignatureEntry.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/DataTypesEntry.md b/docs/DataTypesEntry.md deleted file mode 100644 index 3774cbce..00000000 --- a/docs/DataTypesEntry.md +++ /dev/null @@ -1,31 +0,0 @@ -# DataTypesEntry - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_types** | [**FunctionInfo**](FunctionInfo.md) | | [optional] -**data_types_version** | **int** | Current version of the function data types. Pass this back on the next write to satisfy the CAS check. | -**function_id** | **int** | | - -## Example - -```python -from revengai.models.data_types_entry import DataTypesEntry - -# TODO update the JSON string below -json = "{}" -# create an instance of DataTypesEntry from a JSON string -data_types_entry_instance = DataTypesEntry.from_json(json) -# print the JSON string representation of the object -print(DataTypesEntry.to_json()) - -# convert the object into a dict -data_types_entry_dict = data_types_entry_instance.to_dict() -# create an instance of DataTypesEntry from a dict -data_types_entry_from_dict = DataTypesEntry.from_dict(data_types_entry_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DisassemblyOutputBody.md b/docs/DisassemblyOutputBody.md index 93640b39..5f0ca2b3 100644 --- a/docs/DisassemblyOutputBody.md +++ b/docs/DisassemblyOutputBody.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **basic_blocks** | **object** | | [optional] **function_id** | **int** | | +**global_variables** | **object** | | [optional] **local_variables** | **object** | | [optional] **params** | **object** | | [optional] **return_type** | **str** | | [optional] diff --git a/docs/DynamicExecutionStatusResponse.md b/docs/DynamicExecutionStatusResponse.md index 1f4cbce4..699935ce 100644 --- a/docs/DynamicExecutionStatusResponse.md +++ b/docs/DynamicExecutionStatusResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error_message** | **str** | Error detail, set when status is FAILED | [optional] -**logs** | [**AnalysisLogs**](AnalysisLogs.md) | Sandbox status log messages captured during the run. Contains a single \"No logs available\" message when none have been captured yet. | +**logs** | [**AnalysisLogs**](AnalysisLogs.md) | Sandbox status log messages captured during the run. Empty when none have been captured yet. | **status** | **str** | Task status | ## Example diff --git a/docs/EnumDataType.md b/docs/EnumDataType.md new file mode 100644 index 00000000..08b2c0a6 --- /dev/null +++ b/docs/EnumDataType.md @@ -0,0 +1,38 @@ +# EnumDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**EnumDefinition**](EnumDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.enum_data_type import EnumDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of EnumDataType from a JSON string +enum_data_type_instance = EnumDataType.from_json(json) +# print the JSON string representation of the object +print(EnumDataType.to_json()) + +# convert the object into a dict +enum_data_type_dict = enum_data_type_instance.to_dict() +# create an instance of EnumDataType from a dict +enum_data_type_from_dict = EnumDataType.from_dict(enum_data_type_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/EnumDefinition.md b/docs/EnumDefinition.md new file mode 100644 index 00000000..0f1c4a70 --- /dev/null +++ b/docs/EnumDefinition.md @@ -0,0 +1,29 @@ +# EnumDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | [**List[DataTypeEnumValueEntry]**](DataTypeEnumValueEntry.md) | The type's constants. | + +## Example + +```python +from revengai.models.enum_definition import EnumDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of EnumDefinition from a JSON string +enum_definition_instance = EnumDefinition.from_json(json) +# print the JSON string representation of the object +print(EnumDefinition.to_json()) + +# convert the object into a dict +enum_definition_dict = enum_definition_instance.to_dict() +# create an instance of EnumDefinition from a dict +enum_definition_from_dict = EnumDefinition.from_dict(enum_definition_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/Enumeration.md b/docs/Enumeration.md deleted file mode 100644 index 6a9d0229..00000000 --- a/docs/Enumeration.md +++ /dev/null @@ -1,32 +0,0 @@ -# Enumeration - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | Name of the enumeration | -**members** | **Dict[str, int]** | Dictionary of enumeration members and their values | -**artifact_type** | **str** | Type of artifact that the enumeration is associated with | [optional] - -## Example - -```python -from revengai.models.enumeration import Enumeration - -# TODO update the JSON string below -json = "{}" -# create an instance of Enumeration from a JSON string -enumeration_instance = Enumeration.from_json(json) -# print the JSON string representation of the object -print(Enumeration.to_json()) - -# convert the object into a dict -enumeration_dict = enumeration_instance.to_dict() -# create an instance of Enumeration from a dict -enumeration_from_dict = Enumeration.from_dict(enumeration_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/FunctionArgument.md b/docs/FunctionArgument.md deleted file mode 100644 index 2e4c35fc..00000000 --- a/docs/FunctionArgument.md +++ /dev/null @@ -1,34 +0,0 @@ -# FunctionArgument - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | | -**offset** | **int** | | -**scope** | **str** | | [optional] -**size** | **int** | | -**type** | **str** | | - -## Example - -```python -from revengai.models.function_argument import FunctionArgument - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionArgument from a JSON string -function_argument_instance = FunctionArgument.from_json(json) -# print the JSON string representation of the object -print(FunctionArgument.to_json()) - -# convert the object into a dict -function_argument_dict = function_argument_instance.to_dict() -# create an instance of FunctionArgument from a dict -function_argument_from_dict = FunctionArgument.from_dict(function_argument_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/FunctionDataType.md b/docs/FunctionDataType.md new file mode 100644 index 00000000..6a39add9 --- /dev/null +++ b/docs/FunctionDataType.md @@ -0,0 +1,38 @@ +# FunctionDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**FunctionTypeDefinition**](FunctionTypeDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.function_data_type import FunctionDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionDataType from a JSON string +function_data_type_instance = FunctionDataType.from_json(json) +# print the JSON string representation of the object +print(FunctionDataType.to_json()) + +# convert the object into a dict +function_data_type_dict = function_data_type_instance.to_dict() +# create an instance of FunctionDataType from a dict +function_data_type_from_dict = FunctionDataType.from_dict(function_data_type_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/FunctionDataTypes.md b/docs/FunctionDataTypes.md deleted file mode 100644 index 4d2de0ec..00000000 --- a/docs/FunctionDataTypes.md +++ /dev/null @@ -1,32 +0,0 @@ -# FunctionDataTypes - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**completed** | **bool** | Whether the service has completed data types generation | -**status** | **str** | The current status of the data types service | -**data_types** | [**V2FunctionInfo**](V2FunctionInfo.md) | | [optional] -**data_types_version** | **int** | | [optional] - -## Example - -```python -from revengai.models.function_data_types import FunctionDataTypes - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionDataTypes from a JSON string -function_data_types_instance = FunctionDataTypes.from_json(json) -# print the JSON string representation of the object -print(FunctionDataTypes.to_json()) - -# convert the object into a dict -function_data_types_dict = function_data_types_instance.to_dict() -# create an instance of FunctionDataTypes from a dict -function_data_types_from_dict = FunctionDataTypes.from_dict(function_data_types_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/FunctionDataTypesList.md b/docs/FunctionDataTypesList.md deleted file mode 100644 index 31535113..00000000 --- a/docs/FunctionDataTypesList.md +++ /dev/null @@ -1,31 +0,0 @@ -# FunctionDataTypesList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_count** | **int** | Total number of functions in analysis | [optional] [default to 0] -**total_data_types_count** | **int** | Total number of functions with data types | [optional] [default to 0] -**items** | [**List[FunctionDataTypesListItem]**](FunctionDataTypesListItem.md) | List of function data types information | - -## Example - -```python -from revengai.models.function_data_types_list import FunctionDataTypesList - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionDataTypesList from a JSON string -function_data_types_list_instance = FunctionDataTypesList.from_json(json) -# print the JSON string representation of the object -print(FunctionDataTypesList.to_json()) - -# convert the object into a dict -function_data_types_list_dict = function_data_types_list_instance.to_dict() -# create an instance of FunctionDataTypesList from a dict -function_data_types_list_from_dict = FunctionDataTypesList.from_dict(function_data_types_list_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/FunctionDataTypesListItem.md b/docs/FunctionDataTypesListItem.md deleted file mode 100644 index 3d55b95c..00000000 --- a/docs/FunctionDataTypesListItem.md +++ /dev/null @@ -1,33 +0,0 @@ -# FunctionDataTypesListItem - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**completed** | **bool** | Whether the service has completed data types generation | -**status** | **str** | The current status of the data types service | -**data_types** | [**V2FunctionInfo**](V2FunctionInfo.md) | | [optional] -**data_types_version** | **int** | | [optional] -**function_id** | **int** | Function id | - -## Example - -```python -from revengai.models.function_data_types_list_item import FunctionDataTypesListItem - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionDataTypesListItem from a JSON string -function_data_types_list_item_instance = FunctionDataTypesListItem.from_json(json) -# print the JSON string representation of the object -print(FunctionDataTypesListItem.to_json()) - -# convert the object into a dict -function_data_types_list_item_dict = function_data_types_list_item_instance.to_dict() -# create an instance of FunctionDataTypesListItem from a dict -function_data_types_list_item_from_dict = FunctionDataTypesListItem.from_dict(function_data_types_list_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FunctionDataTypesParams.md b/docs/FunctionDataTypesParams.md deleted file mode 100644 index d400fe7e..00000000 --- a/docs/FunctionDataTypesParams.md +++ /dev/null @@ -1,29 +0,0 @@ -# FunctionDataTypesParams - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**function_ids** | **List[int]** | The function ID's to generate/get data types for | - -## Example - -```python -from revengai.models.function_data_types_params import FunctionDataTypesParams - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionDataTypesParams from a JSON string -function_data_types_params_instance = FunctionDataTypesParams.from_json(json) -# print the JSON string representation of the object -print(FunctionDataTypesParams.to_json()) - -# convert the object into a dict -function_data_types_params_dict = function_data_types_params_instance.to_dict() -# create an instance of FunctionDataTypesParams from a dict -function_data_types_params_from_dict = FunctionDataTypesParams.from_dict(function_data_types_params_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/FunctionDataTypesStatus.md b/docs/FunctionDataTypesStatus.md deleted file mode 100644 index c2964262..00000000 --- a/docs/FunctionDataTypesStatus.md +++ /dev/null @@ -1,31 +0,0 @@ -# FunctionDataTypesStatus - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**function_id** | **int** | Function id | -**completed** | **bool** | Whether the service has completed data types generation | -**status** | **str** | The current status of the data types service | - -## Example - -```python -from revengai.models.function_data_types_status import FunctionDataTypesStatus - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionDataTypesStatus from a JSON string -function_data_types_status_instance = FunctionDataTypesStatus.from_json(json) -# print the JSON string representation of the object -print(FunctionDataTypesStatus.to_json()) - -# convert the object into a dict -function_data_types_status_dict = function_data_types_status_instance.to_dict() -# create an instance of FunctionDataTypesStatus from a dict -function_data_types_status_from_dict = FunctionDataTypesStatus.from_dict(function_data_types_status_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/FunctionDependency.md b/docs/FunctionDependency.md deleted file mode 100644 index 5c84b67e..00000000 --- a/docs/FunctionDependency.md +++ /dev/null @@ -1,36 +0,0 @@ -# FunctionDependency - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addr** | **int** | Memory address (GlobalVariable). | [optional] -**artifact_type** | **str** | | [optional] -**last_change** | **str** | | [optional] -**members** | **object** | | [optional] -**name** | **str** | | -**scope** | **str** | | [optional] -**size** | **int** | Total byte size (Struct, GlobalVariable). | [optional] -**type** | **str** | Underlying type (TypeDefinition, GlobalVariable). | [optional] - -## Example - -```python -from revengai.models.function_dependency import FunctionDependency - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionDependency from a JSON string -function_dependency_instance = FunctionDependency.from_json(json) -# print the JSON string representation of the object -print(FunctionDependency.to_json()) - -# convert the object into a dict -function_dependency_dict = function_dependency_instance.to_dict() -# create an instance of FunctionDependency from a dict -function_dependency_from_dict = FunctionDependency.from_dict(function_dependency_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/FunctionHeader.md b/docs/FunctionHeader.md deleted file mode 100644 index 01617e00..00000000 --- a/docs/FunctionHeader.md +++ /dev/null @@ -1,34 +0,0 @@ -# FunctionHeader - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addr** | **int** | | -**args** | [**Dict[str, FunctionArgument]**](FunctionArgument.md) | Argument map keyed by ordinal hex (e.g. \"0x0\", \"0x1\"). | -**last_change** | **str** | | [optional] -**name** | **str** | | -**scope** | **str** | | [optional] -**type** | **str** | | - -## Example - -```python -from revengai.models.function_header import FunctionHeader - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionHeader from a JSON string -function_header_instance = FunctionHeader.from_json(json) -# print the JSON string representation of the object -print(FunctionHeader.to_json()) - -# convert the object into a dict -function_header_dict = function_header_instance.to_dict() -# create an instance of FunctionHeader from a dict -function_header_from_dict = FunctionHeader.from_dict(function_header_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/FunctionInfo.md b/docs/FunctionInfo.md deleted file mode 100644 index f8fc4aa1..00000000 --- a/docs/FunctionInfo.md +++ /dev/null @@ -1,30 +0,0 @@ -# FunctionInfo - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**func_deps** | [**List[FunctionDependency]**](FunctionDependency.md) | | -**func_types** | [**FunctionType**](FunctionType.md) | | [optional] - -## Example - -```python -from revengai.models.function_info import FunctionInfo - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionInfo from a JSON string -function_info_instance = FunctionInfo.from_json(json) -# print the JSON string representation of the object -print(FunctionInfo.to_json()) - -# convert the object into a dict -function_info_dict = function_info_instance.to_dict() -# create an instance of FunctionInfo from a dict -function_info_from_dict = FunctionInfo.from_dict(function_info_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/FunctionSignatureBody.md b/docs/FunctionSignatureBody.md new file mode 100644 index 00000000..214c3134 --- /dev/null +++ b/docs/FunctionSignatureBody.md @@ -0,0 +1,38 @@ +# FunctionSignatureBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**calling_convention** | **str** | Calling convention, when the producer reported one. | [optional] +**created_at** | **datetime** | When this signature was extracted. | [optional] +**data_types** | [**List[DataTypeEntry]**](DataTypeEntry.md) | The types the signature names — its parameter types and its return type — ordered by data_type_id. Each entry is identical to the one the data types endpoints serve for that id. Returned only when include_data_types is true. | [optional] +**function_id** | **int** | | +**function_name** | **str** | Current name of the function. | +**has_signature** | **bool** | Whether a signature was extracted for this function. False is a normal result: no signature is recorded unless data type extraction ran for the analysis, and thunks and external functions are skipped when it does. | +**parameters** | [**List[SignatureParameterEntry]**](SignatureParameterEntry.md) | Parameters in argument order. Empty with has_signature true means the function is known to take no arguments. | +**return_data_type_id** | **int** | Return type, resolvable against the analysis data types list. Absent for an unresolved return type. | [optional] +**source_function_id** | **int** | The function this signature was copied from, when it was transferred rather than extracted. | [optional] +**source_type** | **str** | Where this signature came from. | [optional] + +## Example + +```python +from revengai.models.function_signature_body import FunctionSignatureBody + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionSignatureBody from a JSON string +function_signature_body_instance = FunctionSignatureBody.from_json(json) +# print the JSON string representation of the object +print(FunctionSignatureBody.to_json()) + +# convert the object into a dict +function_signature_body_dict = function_signature_body_instance.to_dict() +# create an instance of FunctionSignatureBody from a dict +function_signature_body_from_dict = FunctionSignatureBody.from_dict(function_signature_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FunctionSignatureEntry.md b/docs/FunctionSignatureEntry.md new file mode 100644 index 00000000..e1e10fa1 --- /dev/null +++ b/docs/FunctionSignatureEntry.md @@ -0,0 +1,37 @@ +# FunctionSignatureEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**calling_convention** | **str** | Calling convention, when the producer reported one. | [optional] +**created_at** | **datetime** | When this signature was extracted. | [optional] +**function_id** | **int** | | +**function_name** | **str** | Current name of the function. | +**has_signature** | **bool** | Whether a signature was extracted for this function. False is a normal result: no signature is recorded unless data type extraction ran for the analysis, and thunks and external functions are skipped when it does. | +**parameters** | [**List[SignatureParameterEntry]**](SignatureParameterEntry.md) | Parameters in argument order. Empty with has_signature true means the function is known to take no arguments. | +**return_data_type_id** | **int** | Return type, resolvable against the analysis data types list. Absent for an unresolved return type. | [optional] +**source_function_id** | **int** | The function this signature was copied from, when it was transferred rather than extracted. | [optional] +**source_type** | **str** | Where this signature came from. | [optional] + +## Example + +```python +from revengai.models.function_signature_entry import FunctionSignatureEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionSignatureEntry from a JSON string +function_signature_entry_instance = FunctionSignatureEntry.from_json(json) +# print the JSON string representation of the object +print(FunctionSignatureEntry.to_json()) + +# convert the object into a dict +function_signature_entry_dict = function_signature_entry_instance.to_dict() +# create an instance of FunctionSignatureEntry from a dict +function_signature_entry_from_dict = FunctionSignatureEntry.from_dict(function_signature_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FunctionSignatureVersion.md b/docs/FunctionSignatureVersion.md new file mode 100644 index 00000000..453a68d2 --- /dev/null +++ b/docs/FunctionSignatureVersion.md @@ -0,0 +1,31 @@ +# FunctionSignatureVersion + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updated_at** | **datetime** | When this version was written. Absent on a version that predates the recorded history. | [optional] +**updated_by** | [**HistoryActor**](HistoryActor.md) | Who wrote this version. Absent on a version that predates the recorded history. | [optional] +**value** | [**FunctionSignatureEntry**](FunctionSignatureEntry.md) | The signature as it stood in this version. | + +## Example + +```python +from revengai.models.function_signature_version import FunctionSignatureVersion + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionSignatureVersion from a JSON string +function_signature_version_instance = FunctionSignatureVersion.from_json(json) +# print the JSON string representation of the object +print(FunctionSignatureVersion.to_json()) + +# convert the object into a dict +function_signature_version_dict = function_signature_version_instance.to_dict() +# create an instance of FunctionSignatureVersion from a dict +function_signature_version_from_dict = FunctionSignatureVersion.from_dict(function_signature_version_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/FunctionStackVariable.md b/docs/FunctionStackVariable.md deleted file mode 100644 index 84c73197..00000000 --- a/docs/FunctionStackVariable.md +++ /dev/null @@ -1,35 +0,0 @@ -# FunctionStackVariable - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addr** | **int** | | -**last_change** | **str** | | [optional] -**name** | **str** | | -**offset** | **int** | | -**scope** | **str** | | [optional] -**size** | **int** | | -**type** | **str** | | - -## Example - -```python -from revengai.models.function_stack_variable import FunctionStackVariable - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionStackVariable from a JSON string -function_stack_variable_instance = FunctionStackVariable.from_json(json) -# print the JSON string representation of the object -print(FunctionStackVariable.to_json()) - -# convert the object into a dict -function_stack_variable_dict = function_stack_variable_instance.to_dict() -# create an instance of FunctionStackVariable from a dict -function_stack_variable_from_dict = FunctionStackVariable.from_dict(function_stack_variable_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/FunctionType.md b/docs/FunctionType.md deleted file mode 100644 index 6bc961cd..00000000 --- a/docs/FunctionType.md +++ /dev/null @@ -1,37 +0,0 @@ -# FunctionType - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**addr** | **int** | | -**artifact_type** | **str** | | [optional] -**header** | [**FunctionHeader**](FunctionHeader.md) | | -**last_change** | **str** | | [optional] -**name** | **str** | | -**scope** | **str** | | [optional] -**size** | **int** | | -**stack_vars** | [**Dict[str, FunctionStackVariable]**](FunctionStackVariable.md) | Stack variables keyed by offset hex. | [optional] -**type** | **str** | | - -## Example - -```python -from revengai.models.function_type import FunctionType - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionType from a JSON string -function_type_instance = FunctionType.from_json(json) -# print the JSON string representation of the object -print(FunctionType.to_json()) - -# convert the object into a dict -function_type_dict = function_type_instance.to_dict() -# create an instance of FunctionType from a dict -function_type_from_dict = FunctionType.from_dict(function_type_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/FunctionTypeDefinition.md b/docs/FunctionTypeDefinition.md new file mode 100644 index 00000000..3c82ebef --- /dev/null +++ b/docs/FunctionTypeDefinition.md @@ -0,0 +1,30 @@ +# FunctionTypeDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parameters** | [**List[DataTypeFunctionParameterEntry]**](DataTypeFunctionParameterEntry.md) | The parameters, in argument order. | +**return_data_type_id** | **int** | The return type. | [optional] + +## Example + +```python +from revengai.models.function_type_definition import FunctionTypeDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionTypeDefinition from a JSON string +function_type_definition_instance = FunctionTypeDefinition.from_json(json) +# print the JSON string representation of the object +print(FunctionTypeDefinition.to_json()) + +# convert the object into a dict +function_type_definition_dict = function_type_definition_instance.to_dict() +# create an instance of FunctionTypeDefinition from a dict +function_type_definition_from_dict = FunctionTypeDefinition.from_dict(function_type_definition_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 add9b55f..d19dfe23 100644 --- a/docs/FunctionsAIDecompilationApi.md +++ b/docs/FunctionsAIDecompilationApi.md @@ -13,17 +13,18 @@ Method | HTTP request | Description [**get_ai_decompilation_status**](FunctionsAIDecompilationApi.md#get_ai_decompilation_status) | **GET** /v3/functions/{function_id}/ai-decompilation/status | Get AI decompilation workflow status [**get_ai_decompilation_summary**](FunctionsAIDecompilationApi.md#get_ai_decompilation_summary) | **GET** /v3/functions/{function_id}/ai-decompilation/summary | Get AI decompilation summary [**get_ai_decompilation_summary_status**](FunctionsAIDecompilationApi.md#get_ai_decompilation_summary_status) | **GET** /v3/functions/{function_id}/ai-decompilation/summary/status | Get summary generation workflow status -[**get_ai_decompilation_tokenised**](FunctionsAIDecompilationApi.md#get_ai_decompilation_tokenised) | **GET** /v3/functions/{function_id}/ai-decompilation/tokenised | Get tokenised AI decompilation with function mapping [**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) -[**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 +[**v3_get_ai_decompilation_line_attributions**](FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_line_attributions) | **GET** /v3/functions/{function_id}/ai-decompilation/line-attributions | Get AI decompilation line attributions +[**v3_get_ai_decompilation_tokens**](FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_tokens) | **GET** /v3/functions/{function_id}/ai-decompilation/tokens | Get AI decompilation tokens and user overrides +[**v3_upsert_ai_decompilation_overrides**](FunctionsAIDecompilationApi.md#v3_upsert_ai_decompilation_overrides) | **PATCH** /v3/functions/{function_id}/ai-decompilation/overrides | Upsert variable/function name overrides # **create_ai_decompilation** -> CreateAIDecompOutputBody create_ai_decompilation(function_id, context_aware=context_aware, temperature=temperature) +> CreateAIDecompOutputBody create_ai_decompilation(function_id, temperature=temperature) Start AI decompilation @@ -73,12 +74,11 @@ with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) function_id = 56 # int | Function ID - context_aware = False # bool | Use context-aware decompilation (optional) (default to False) temperature = -1 # float | LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. (optional) (default to -1) try: # Start AI decompilation - api_response = api_instance.create_ai_decompilation(function_id, context_aware=context_aware, temperature=temperature) + api_response = api_instance.create_ai_decompilation(function_id, temperature=temperature) print("The response of FunctionsAIDecompilationApi->create_ai_decompilation:\n") pprint(api_response) except Exception as e: @@ -93,7 +93,6 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| Function ID | - **context_aware** | **bool**| Use context-aware decompilation | [optional] [default to False] **temperature** | **float**| LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. | [optional] [default to -1] ### Return type @@ -861,17 +860,16 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_ai_decompilation_tokenised** -> TokenisedData get_ai_decompilation_tokenised(function_id) +# **patch_ai_decompilation_inline_comment** +> CommentsData patch_ai_decompilation_inline_comment(function_id, patch_comment_body) -Get tokenised AI decompilation with function mapping +Update a single inline comment -Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. +Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error ### Example @@ -880,7 +878,8 @@ Returns the decompilation with placeholder tokens, the function mapping for toke ```python import revengai -from revengai.models.tokenised_data import TokenisedData +from revengai.models.comments_data import CommentsData +from revengai.models.patch_comment_body import PatchCommentBody from revengai.rest import ApiException from pprint import pprint @@ -911,14 +910,15 @@ 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 + patch_comment_body = revengai.PatchCommentBody() # PatchCommentBody | try: - # Get tokenised AI decompilation with function mapping - api_response = api_instance.get_ai_decompilation_tokenised(function_id) - print("The response of FunctionsAIDecompilationApi->get_ai_decompilation_tokenised:\n") + # Update a single inline comment + api_response = api_instance.patch_ai_decompilation_inline_comment(function_id, patch_comment_body) + print("The response of FunctionsAIDecompilationApi->patch_ai_decompilation_inline_comment:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->get_ai_decompilation_tokenised: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->patch_ai_decompilation_inline_comment: %s\n" % e) ``` @@ -929,10 +929,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| Function ID | + **patch_comment_body** | [**PatchCommentBody**](PatchCommentBody.md)| | ### Return type -[**TokenisedData**](TokenisedData.md) +[**CommentsData**](CommentsData.md) ### Authorization @@ -940,7 +941,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -955,12 +956,12 @@ 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) -# **patch_ai_decompilation_inline_comment** -> CommentsData patch_ai_decompilation_inline_comment(function_id, patch_comment_body) +# **regenerate_ai_decompilation_inline_comments** +> RegenerateOutputBody regenerate_ai_decompilation_inline_comments(function_id) -Update a single inline comment +Regenerate AI decompilation inline comments -Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. +Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied @@ -973,8 +974,7 @@ Merges a single line comment into the existing AI-generated inline comments. Req ```python import revengai -from revengai.models.comments_data import CommentsData -from revengai.models.patch_comment_body import PatchCommentBody +from revengai.models.regenerate_output_body import RegenerateOutputBody from revengai.rest import ApiException from pprint import pprint @@ -1005,15 +1005,14 @@ 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 - patch_comment_body = revengai.PatchCommentBody() # PatchCommentBody | try: - # Update a single inline comment - api_response = api_instance.patch_ai_decompilation_inline_comment(function_id, patch_comment_body) - print("The response of FunctionsAIDecompilationApi->patch_ai_decompilation_inline_comment:\n") + # Regenerate AI decompilation inline comments + api_response = api_instance.regenerate_ai_decompilation_inline_comments(function_id) + print("The response of FunctionsAIDecompilationApi->regenerate_ai_decompilation_inline_comments:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->patch_ai_decompilation_inline_comment: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->regenerate_ai_decompilation_inline_comments: %s\n" % e) ``` @@ -1024,11 +1023,10 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| Function ID | - **patch_comment_body** | [**PatchCommentBody**](PatchCommentBody.md)| | ### Return type -[**CommentsData**](CommentsData.md) +[**RegenerateOutputBody**](RegenerateOutputBody.md) ### Authorization @@ -1036,14 +1034,14 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**202** | Accepted | - | **403** | Forbidden | - | **404** | Not Found | - | **422** | Unprocessable Entity | - | @@ -1051,12 +1049,12 @@ 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) -# **regenerate_ai_decompilation_inline_comments** -> RegenerateOutputBody regenerate_ai_decompilation_inline_comments(function_id) +# **regenerate_ai_decompilation_summary** +> RegenerateOutputBody regenerate_ai_decompilation_summary(function_id) -Regenerate AI decompilation inline comments +Regenerate AI decompilation summary -Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. +Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied @@ -1102,12 +1100,12 @@ with revengai.ApiClient(configuration) as api_client: function_id = 56 # int | Function ID try: - # Regenerate AI decompilation inline comments - api_response = api_instance.regenerate_ai_decompilation_inline_comments(function_id) - print("The response of FunctionsAIDecompilationApi->regenerate_ai_decompilation_inline_comments:\n") + # Regenerate AI decompilation summary + api_response = api_instance.regenerate_ai_decompilation_summary(function_id) + print("The response of FunctionsAIDecompilationApi->regenerate_ai_decompilation_summary:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->regenerate_ai_decompilation_inline_comments: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->regenerate_ai_decompilation_summary: %s\n" % e) ``` @@ -1144,16 +1142,12 @@ 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) -# **regenerate_ai_decompilation_summary** -> RegenerateOutputBody regenerate_ai_decompilation_summary(function_id) - -Regenerate AI decompilation summary +# **stream_ai_decompilation** +> List[StreamAiDecompilation200ResponseInner] stream_ai_decompilation(function_id) -Starts a new summary generation workflow for the function. Requires an existing decompilation. +Stream live AI decompilation output (SSE) -**Error codes:** -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +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 @@ -1162,7 +1156,7 @@ Starts a new summary generation workflow for the function. Requires an existing ```python import revengai -from revengai.models.regenerate_output_body import RegenerateOutputBody +from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner from revengai.rest import ApiException from pprint import pprint @@ -1195,12 +1189,12 @@ with revengai.ApiClient(configuration) as api_client: function_id = 56 # int | Function ID try: - # Regenerate AI decompilation summary - api_response = api_instance.regenerate_ai_decompilation_summary(function_id) - print("The response of FunctionsAIDecompilationApi->regenerate_ai_decompilation_summary:\n") + # 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->regenerate_ai_decompilation_summary: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->stream_ai_decompilation: %s\n" % e) ``` @@ -1214,7 +1208,7 @@ Name | Type | Description | Notes ### Return type -[**RegenerateOutputBody**](RegenerateOutputBody.md) +[**List[StreamAiDecompilation200ResponseInner]**](StreamAiDecompilation200ResponseInner.md) ### Authorization @@ -1223,26 +1217,115 @@ Name | Type | Description | Notes ### 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) + +# **upsert_ai_decompilation_rating** +> BaseResponse upsert_ai_decompilation_rating(function_id, upsert_ai_decomplation_rating_request) + +Upsert rating for AI decompilation + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.base_response import BaseResponse +from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | The ID of the function being rated + upsert_ai_decomplation_rating_request = revengai.UpsertAiDecomplationRatingRequest() # UpsertAiDecomplationRatingRequest | + + try: + # Upsert rating for AI decompilation + api_response = api_instance.upsert_ai_decompilation_rating(function_id, upsert_ai_decomplation_rating_request) + print("The response of FunctionsAIDecompilationApi->upsert_ai_decompilation_rating:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->upsert_ai_decompilation_rating: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| The ID of the function being rated | + **upsert_ai_decomplation_rating_request** | [**UpsertAiDecomplationRatingRequest**](UpsertAiDecomplationRatingRequest.md)| | + +### Return type + +[**BaseResponse**](BaseResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**202** | Accepted | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | +**201** | 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) -# **stream_ai_decompilation** -> List[StreamAiDecompilation200ResponseInner] stream_ai_decompilation(function_id) +# **v3_get_ai_decompilation_line_attributions** +> LineAttributionsData v3_get_ai_decompilation_line_attributions(function_id) -Stream live AI decompilation output (SSE) +Get AI decompilation line attributions -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. +Returns the correspondence between the function's disassembly line numbers and its AI-decompilation line numbers, grouped by disassembly line. Both sides are 0-indexed and the correspondence has a many-to-many relationship. The mapping is empty until a completed run has produced one, and is empty for a run that produced none. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error ### Example @@ -1251,7 +1334,7 @@ Opens a Server-Sent Events stream of incremental decompilation events for the gi ```python import revengai -from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner +from revengai.models.line_attributions_data import LineAttributionsData from revengai.rest import ApiException from pprint import pprint @@ -1284,12 +1367,12 @@ with revengai.ApiClient(configuration) as 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") + # Get AI decompilation line attributions + api_response = api_instance.v3_get_ai_decompilation_line_attributions(function_id) + print("The response of FunctionsAIDecompilationApi->v3_get_ai_decompilation_line_attributions:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->stream_ai_decompilation: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->v3_get_ai_decompilation_line_attributions: %s\n" % e) ``` @@ -1303,7 +1386,7 @@ Name | Type | Description | Notes ### Return type -[**List[StreamAiDecompilation200ResponseInner]**](StreamAiDecompilation200ResponseInner.md) +[**LineAttributionsData**](LineAttributionsData.md) ### Authorization @@ -1312,28 +1395,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: text/event-stream, application/json + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | -**0** | Error | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **upsert_ai_decompilation_overrides** -> UpsertOverridesData upsert_ai_decompilation_overrides(function_id, upsert_overrides_input_body) +# **v3_get_ai_decompilation_tokens** +> GetTokensResponse v3_get_ai_decompilation_tokens(function_id) -Upsert variable/function name overrides +Get AI decompilation tokens and user overrides -Applies user-provided name overrides to placeholder tokens in the decompilation. +Returns the tokenised AI-decompilation source, the value each token resolves to, and the user's overrides as a separate unmerged map. The source is empty and the overrides are null until a run has succeeded. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error ### Example @@ -1342,8 +1428,7 @@ Applies user-provided name overrides to placeholder tokens in the decompilation. ```python import revengai -from revengai.models.upsert_overrides_data import UpsertOverridesData -from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody +from revengai.models.get_tokens_response import GetTokensResponse from revengai.rest import ApiException from pprint import pprint @@ -1374,15 +1459,14 @@ with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) function_id = 56 # int | Function ID - upsert_overrides_input_body = revengai.UpsertOverridesInputBody() # UpsertOverridesInputBody | try: - # Upsert variable/function name overrides - api_response = api_instance.upsert_ai_decompilation_overrides(function_id, upsert_overrides_input_body) - print("The response of FunctionsAIDecompilationApi->upsert_ai_decompilation_overrides:\n") + # Get AI decompilation tokens and user overrides + api_response = api_instance.v3_get_ai_decompilation_tokens(function_id) + print("The response of FunctionsAIDecompilationApi->v3_get_ai_decompilation_tokens:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->upsert_ai_decompilation_overrides: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->v3_get_ai_decompilation_tokens: %s\n" % e) ``` @@ -1393,11 +1477,10 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| Function ID | - **upsert_overrides_input_body** | [**UpsertOverridesInputBody**](UpsertOverridesInputBody.md)| | ### Return type -[**UpsertOverridesData**](UpsertOverridesData.md) +[**GetTokensResponse**](GetTokensResponse.md) ### Authorization @@ -1405,7 +1488,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -1413,7 +1496,6 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | -**400** | Bad Request | - | **403** | Forbidden | - | **404** | Not Found | - | **422** | Unprocessable Entity | - | @@ -1421,10 +1503,18 @@ 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) -# **upsert_ai_decompilation_rating** -> BaseResponse upsert_ai_decompilation_rating(function_id, upsert_ai_decomplation_rating_request) +# **v3_upsert_ai_decompilation_overrides** +> UpsertOverridesData v3_upsert_ai_decompilation_overrides(function_id, upsert_overrides_input_body) -Upsert rating for AI decompilation +Upsert variable/function name overrides + +Applies user-provided name overrides to placeholder tokens in the decompilation. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error ### Example @@ -1433,8 +1523,8 @@ Upsert rating for AI decompilation ```python import revengai -from revengai.models.base_response import BaseResponse -from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest +from revengai.models.upsert_overrides_data import UpsertOverridesData +from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody from revengai.rest import ApiException from pprint import pprint @@ -1464,16 +1554,16 @@ configuration = revengai.Configuration( with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsAIDecompilationApi(api_client) - function_id = 56 # int | The ID of the function being rated - upsert_ai_decomplation_rating_request = revengai.UpsertAiDecomplationRatingRequest() # UpsertAiDecomplationRatingRequest | + function_id = 56 # int | Function ID + upsert_overrides_input_body = revengai.UpsertOverridesInputBody() # UpsertOverridesInputBody | try: - # Upsert rating for AI decompilation - api_response = api_instance.upsert_ai_decompilation_rating(function_id, upsert_ai_decomplation_rating_request) - print("The response of FunctionsAIDecompilationApi->upsert_ai_decompilation_rating:\n") + # Upsert variable/function name overrides + api_response = api_instance.v3_upsert_ai_decompilation_overrides(function_id, upsert_overrides_input_body) + print("The response of FunctionsAIDecompilationApi->v3_upsert_ai_decompilation_overrides:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsAIDecompilationApi->upsert_ai_decompilation_rating: %s\n" % e) + print("Exception when calling FunctionsAIDecompilationApi->v3_upsert_ai_decompilation_overrides: %s\n" % e) ``` @@ -1483,12 +1573,12 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_id** | **int**| The ID of the function being rated | - **upsert_ai_decomplation_rating_request** | [**UpsertAiDecomplationRatingRequest**](UpsertAiDecomplationRatingRequest.md)| | + **function_id** | **int**| Function ID | + **upsert_overrides_input_body** | [**UpsertOverridesInputBody**](UpsertOverridesInputBody.md)| | ### Return type -[**BaseResponse**](BaseResponse.md) +[**UpsertOverridesData**](UpsertOverridesData.md) ### Authorization @@ -1503,8 +1593,12 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Successful Response | - | -**422** | Invalid request parameters | - | +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 1d989d83..1588f2ef 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -498,11 +498,12 @@ Name | Type | Description | Notes Get function disassembly -Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. +Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. A function that carries no disassembly (externals, thunks) returns 200 with the block fields omitted; disassembly that exists but cannot be read yet returns 409 ANALYSIS_NOT_READY. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready ### Example @@ -581,6 +582,7 @@ Name | Type | Description | Notes **200** | OK | - | **403** | Forbidden | - | **404** | Not Found | - | +**409** | Conflict | - | **422** | Unprocessable Entity | - | **500** | Internal Server Error | - | diff --git a/docs/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md deleted file mode 100644 index bb2ef4b5..00000000 --- a/docs/FunctionsDataTypesApi.md +++ /dev/null @@ -1,854 +0,0 @@ -# revengai.FunctionsDataTypesApi - -All URIs are relative to *https://api.reveng.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**batch_update_function_data_types**](FunctionsDataTypesApi.md#batch_update_function_data_types) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types -[**generate_function_data_types_for_analysis**](FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types -[**generate_function_data_types_for_functions**](FunctionsDataTypesApi.md#generate_function_data_types_for_functions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions -[**get_function_data_types**](FunctionsDataTypesApi.md#get_function_data_types) | **GET** /v3/analyses/{analysis_id}/functions/{function_id}/data-types | Get data types for a single function -[**list_analysis_functions_data_types**](FunctionsDataTypesApi.md#list_analysis_functions_data_types) | **GET** /v3/analyses/{analysis_id}/functions/data-types | List data types for all functions in an analysis -[**list_function_data_types_for_analysis**](FunctionsDataTypesApi.md#list_function_data_types_for_analysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types -[**list_function_data_types_for_functions**](FunctionsDataTypesApi.md#list_function_data_types_for_functions) | **GET** /v2/functions/data_types | List Function Data Types -[**list_functions_data_types**](FunctionsDataTypesApi.md#list_functions_data_types) | **GET** /v3/functions/data-types | Get data types for many functions -[**update_function_data_types**](FunctionsDataTypesApi.md#update_function_data_types) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update function data types - - -# **batch_update_function_data_types** -> BatchUpdateDataTypesOutputBody batch_update_function_data_types(analysis_id, batch_update_data_types_input_body) - -Batch update function data types - -Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. - -**Error codes:** -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody -from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | Analysis ID - batch_update_data_types_input_body = revengai.BatchUpdateDataTypesInputBody() # BatchUpdateDataTypesInputBody | - - try: - # Batch update function data types - api_response = api_instance.batch_update_function_data_types(analysis_id, batch_update_data_types_input_body) - print("The response of FunctionsDataTypesApi->batch_update_function_data_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->batch_update_function_data_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| Analysis ID | - **batch_update_data_types_input_body** | [**BatchUpdateDataTypesInputBody**](BatchUpdateDataTypesInputBody.md)| | - -### Return type - -[**BatchUpdateDataTypesOutputBody**](BatchUpdateDataTypesOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **generate_function_data_types_for_analysis** -> BaseResponseGenerateFunctionDataTypes generate_function_data_types_for_analysis(analysis_id, function_data_types_params) - -Generate Function Data Types - -Submits a request to generate the function data types - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes -from revengai.models.function_data_types_params import FunctionDataTypesParams -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | - function_data_types_params = revengai.FunctionDataTypesParams() # FunctionDataTypesParams | - - try: - # Generate Function Data Types - api_response = api_instance.generate_function_data_types_for_analysis(analysis_id, function_data_types_params) - print("The response of FunctionsDataTypesApi->generate_function_data_types_for_analysis:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->generate_function_data_types_for_analysis: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - **function_data_types_params** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | - -### Return type - -[**BaseResponseGenerateFunctionDataTypes**](BaseResponseGenerateFunctionDataTypes.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **generate_function_data_types_for_functions** -> BaseResponseGenerationStatusList generate_function_data_types_for_functions(function_data_types_params) - -Generate Function Data Types for an arbitrary list of functions - -Submits a request to generate the function data types - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList -from revengai.models.function_data_types_params import FunctionDataTypesParams -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - function_data_types_params = revengai.FunctionDataTypesParams() # FunctionDataTypesParams | - - try: - # Generate Function Data Types for an arbitrary list of functions - api_response = api_instance.generate_function_data_types_for_functions(function_data_types_params) - print("The response of FunctionsDataTypesApi->generate_function_data_types_for_functions:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->generate_function_data_types_for_functions: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_data_types_params** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | - -### Return type - -[**BaseResponseGenerationStatusList**](BaseResponseGenerationStatusList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Successful Response | - | -**422** | Invalid request parameters | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_function_data_types** -> DataTypesEntry get_function_data_types(analysis_id, function_id) - -Get data types for a single function - -Returns the stored data-types blob for one function. The function must belong to the supplied analysis. - -**Error codes:** -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.data_types_entry import DataTypesEntry -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | Analysis ID - function_id = 56 # int | Function ID - - try: - # Get data types for a single function - api_response = api_instance.get_function_data_types(analysis_id, function_id) - print("The response of FunctionsDataTypesApi->get_function_data_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->get_function_data_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| Analysis ID | - **function_id** | **int**| Function ID | - -### Return type - -[**DataTypesEntry**](DataTypesEntry.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_analysis_functions_data_types** -> ListAnalysisFunctionsDataTypesOutputBody list_analysis_functions_data_types(analysis_id, offset=offset, limit=limit) - -List data types for all functions in an analysis - -Paginated read of the stored data-types blob for each function in the analysis. - -**Error codes:** -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | Analysis ID - offset = 56 # int | Pagination offset. Defaults to 0. (optional) - limit = 56 # int | Page size. Defaults to 100. (optional) - - try: - # List data types for all functions in an analysis - api_response = api_instance.list_analysis_functions_data_types(analysis_id, offset=offset, limit=limit) - print("The response of FunctionsDataTypesApi->list_analysis_functions_data_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->list_analysis_functions_data_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| Analysis ID | - **offset** | **int**| Pagination offset. Defaults to 0. | [optional] - **limit** | **int**| Page size. Defaults to 100. | [optional] - -### Return type - -[**ListAnalysisFunctionsDataTypesOutputBody**](ListAnalysisFunctionsDataTypesOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_function_data_types_for_analysis** -> BaseResponseFunctionDataTypesList list_function_data_types_for_analysis(analysis_id, function_ids=function_ids) - -List Function Data Types - -Returns data types for multiple functions with optional function ID filtering - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | - function_ids = [56] # List[Optional[int]] | (optional) - - try: - # List Function Data Types - api_response = api_instance.list_function_data_types_for_analysis(analysis_id, function_ids=function_ids) - print("The response of FunctionsDataTypesApi->list_function_data_types_for_analysis:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->list_function_data_types_for_analysis: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] - -### Return type - -[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### 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) - -# **list_function_data_types_for_functions** -> BaseResponseFunctionDataTypesList list_function_data_types_for_functions(function_ids=function_ids) - -List Function Data Types - -Returns data types for multiple function IDs - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - function_ids = [56] # List[Optional[int]] | (optional) - - try: - # List Function Data Types - api_response = api_instance.list_function_data_types_for_functions(function_ids=function_ids) - print("The response of FunctionsDataTypesApi->list_function_data_types_for_functions:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->list_function_data_types_for_functions: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] - -### Return type - -[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### 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) - -# **list_functions_data_types** -> ListFunctionsDataTypesOutputBody list_functions_data_types(function_ids) - -Get data types for many functions - -Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. - -**Error codes:** -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - function_ids = [56] # List[int] | Function IDs to fetch data-types for. - - try: - # Get data types for many functions - api_response = api_instance.list_functions_data_types(function_ids) - print("The response of FunctionsDataTypesApi->list_functions_data_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->list_functions_data_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **function_ids** | [**List[int]**](int.md)| Function IDs to fetch data-types for. | - -### Return type - -[**ListFunctionsDataTypesOutputBody**](ListFunctionsDataTypesOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_function_data_types** -> UpdateDataTypesOutputBody update_function_data_types(analysis_id, function_id, update_data_types_input_body) - -Update function data types - -Stores user-specific overrides for a function's data types. Uses optimistic concurrency: if the stored version doesn't match `data_types_version`, the update is rejected with 409. - -**Error codes:** -- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found -- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request -- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - -### Example - -* Api Key Authentication (APIKey): -* Bearer Authentication (bearerAuth): - -```python -import revengai -from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody -from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody -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' - -# Configure Bearer authorization: bearerAuth -configuration = revengai.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | Analysis ID - function_id = 56 # int | Function ID - update_data_types_input_body = revengai.UpdateDataTypesInputBody() # UpdateDataTypesInputBody | - - try: - # Update function data types - api_response = api_instance.update_function_data_types(analysis_id, function_id, update_data_types_input_body) - print("The response of FunctionsDataTypesApi->update_function_data_types:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling FunctionsDataTypesApi->update_function_data_types: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| Analysis ID | - **function_id** | **int**| Function ID | - **update_data_types_input_body** | [**UpdateDataTypesInputBody**](UpdateDataTypesInputBody.md)| | - -### Return type - -[**UpdateDataTypesOutputBody**](UpdateDataTypesOutputBody.md) - -### Authorization - -[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | -**403** | Forbidden | - | -**404** | Not Found | - | -**409** | Conflict | - | -**422** | Unprocessable Entity | - | -**500** | Internal Server Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/FunctionsRenamingHistoryApi.md b/docs/FunctionsRenamingHistoryApi.md index 28f05384..65a9dfdb 100644 --- a/docs/FunctionsRenamingHistoryApi.md +++ b/docs/FunctionsRenamingHistoryApi.md @@ -107,7 +107,7 @@ Name | Type | Description | Notes Batch rename functions -Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. +Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied diff --git a/docs/GenerateFunctionDataTypes.md b/docs/GenerateFunctionDataTypes.md deleted file mode 100644 index 9917d9a3..00000000 --- a/docs/GenerateFunctionDataTypes.md +++ /dev/null @@ -1,31 +0,0 @@ -# GenerateFunctionDataTypes - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**queued** | **bool** | [DEPRECATED] This value has been replaced with the `data_types_list` field | -**reference** | **str** | [DEPRECATED] This value has been replaced with the `data_types_list` field | -**data_types_list** | [**GenerationStatusList**](GenerationStatusList.md) | List of function data types information that are either already generated, or now queued for generation | - -## Example - -```python -from revengai.models.generate_function_data_types import GenerateFunctionDataTypes - -# TODO update the JSON string below -json = "{}" -# create an instance of GenerateFunctionDataTypes from a JSON string -generate_function_data_types_instance = GenerateFunctionDataTypes.from_json(json) -# print the JSON string representation of the object -print(GenerateFunctionDataTypes.to_json()) - -# convert the object into a dict -generate_function_data_types_dict = generate_function_data_types_instance.to_dict() -# create an instance of GenerateFunctionDataTypes from a dict -generate_function_data_types_from_dict = GenerateFunctionDataTypes.from_dict(generate_function_data_types_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/GenerationStatusList.md b/docs/GenerationStatusList.md deleted file mode 100644 index 93266aa8..00000000 --- a/docs/GenerationStatusList.md +++ /dev/null @@ -1,31 +0,0 @@ -# GenerationStatusList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_count** | **int** | Total number of functions in analysis | [optional] [default to 0] -**total_data_types_count** | **int** | Total number of functions with data types | [optional] [default to 0] -**items** | [**List[FunctionDataTypesStatus]**](FunctionDataTypesStatus.md) | List of function data types information | - -## Example - -```python -from revengai.models.generation_status_list import GenerationStatusList - -# TODO update the JSON string below -json = "{}" -# create an instance of GenerationStatusList from a JSON string -generation_status_list_instance = GenerationStatusList.from_json(json) -# print the JSON string representation of the object -print(GenerationStatusList.to_json()) - -# convert the object into a dict -generation_status_list_dict = generation_status_list_instance.to_dict() -# create an instance of GenerationStatusList from a dict -generation_status_list_from_dict = GenerationStatusList.from_dict(generation_status_list_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/GetAnalysisLogsOutputBody.md b/docs/GetAnalysisLogsOutputBody.md new file mode 100644 index 00000000..63e928e3 --- /dev/null +++ b/docs/GetAnalysisLogsOutputBody.md @@ -0,0 +1,29 @@ +# GetAnalysisLogsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entries** | [**List[AnalysisLogEntry]**](AnalysisLogEntry.md) | Analysis log lines, oldest first | + +## Example + +```python +from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAnalysisLogsOutputBody from a JSON string +get_analysis_logs_output_body_instance = GetAnalysisLogsOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetAnalysisLogsOutputBody.to_json()) + +# convert the object into a dict +get_analysis_logs_output_body_dict = get_analysis_logs_output_body_instance.to_dict() +# create an instance of GetAnalysisLogsOutputBody from a dict +get_analysis_logs_output_body_from_dict = GetAnalysisLogsOutputBody.from_dict(get_analysis_logs_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetDataTypeHistoryBody.md b/docs/GetDataTypeHistoryBody.md new file mode 100644 index 00000000..f82f236e --- /dev/null +++ b/docs/GetDataTypeHistoryBody.md @@ -0,0 +1,29 @@ +# GetDataTypeHistoryBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**versions** | [**List[DataTypeVersion]**](DataTypeVersion.md) | Every version of the type, newest first. The first element is the current value, so the list is never empty; a type that has never been edited has that one element only. | + +## Example + +```python +from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetDataTypeHistoryBody from a JSON string +get_data_type_history_body_instance = GetDataTypeHistoryBody.from_json(json) +# print the JSON string representation of the object +print(GetDataTypeHistoryBody.to_json()) + +# convert the object into a dict +get_data_type_history_body_dict = get_data_type_history_body_instance.to_dict() +# create an instance of GetDataTypeHistoryBody from a dict +get_data_type_history_body_from_dict = GetDataTypeHistoryBody.from_dict(get_data_type_history_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetFunctionSignatureHistoryBody.md b/docs/GetFunctionSignatureHistoryBody.md new file mode 100644 index 00000000..7d88dbd4 --- /dev/null +++ b/docs/GetFunctionSignatureHistoryBody.md @@ -0,0 +1,29 @@ +# GetFunctionSignatureHistoryBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**versions** | [**List[FunctionSignatureVersion]**](FunctionSignatureVersion.md) | Every version of the signature, newest first. The first element is the current value, so the list is never empty; a signature that has never been edited has that one element only. | + +## Example + +```python +from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetFunctionSignatureHistoryBody from a JSON string +get_function_signature_history_body_instance = GetFunctionSignatureHistoryBody.from_json(json) +# print the JSON string representation of the object +print(GetFunctionSignatureHistoryBody.to_json()) + +# convert the object into a dict +get_function_signature_history_body_dict = get_function_signature_history_body_instance.to_dict() +# create an instance of GetFunctionSignatureHistoryBody from a dict +get_function_signature_history_body_from_dict = GetFunctionSignatureHistoryBody.from_dict(get_function_signature_history_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetTokensResponse.md b/docs/GetTokensResponse.md new file mode 100644 index 00000000..26b39c8e --- /dev/null +++ b/docs/GetTokensResponse.md @@ -0,0 +1,32 @@ +# GetTokensResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ai_decomp** | **str** | Tokenised AI-decompilation. Includes generated comments. Empty until a run has succeeded. | +**analysis_id** | **int** | Analysis the function belongs to. Scopes every data_type_id below. | +**placeholder_to_rendered_token** | [**Dict[str, RenderedToken]**](RenderedToken.md) | Each placeholder token mapped to the value the server would render in its place, and the record it refers to. Null until a run has succeeded. | +**placeholder_to_user_override** | [**Dict[str, Token]**](Token.md) | The caller's own overrides, keyed by token. Null until a run has succeeded. | + +## Example + +```python +from revengai.models.get_tokens_response import GetTokensResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTokensResponse from a JSON string +get_tokens_response_instance = GetTokensResponse.from_json(json) +# print the JSON string representation of the object +print(GetTokensResponse.to_json()) + +# convert the object into a dict +get_tokens_response_dict = get_tokens_response_instance.to_dict() +# create an instance of GetTokensResponse from a dict +get_tokens_response_from_dict = GetTokensResponse.from_dict(get_tokens_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/GlobalVariable.md b/docs/GlobalVariable.md deleted file mode 100644 index 43305693..00000000 --- a/docs/GlobalVariable.md +++ /dev/null @@ -1,34 +0,0 @@ -# GlobalVariable - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**addr** | **int** | Memory address of the global variable | -**name** | **str** | Name of the global variable | -**type** | **str** | Data type of the global variable | -**size** | **int** | Size of the global variable in bytes | -**artifact_type** | **str** | Type of artifact that the global variable is associated with | [optional] - -## Example - -```python -from revengai.models.global_variable import GlobalVariable - -# TODO update the JSON string below -json = "{}" -# create an instance of GlobalVariable from a JSON string -global_variable_instance = GlobalVariable.from_json(json) -# print the JSON string representation of the object -print(GlobalVariable.to_json()) - -# convert the object into a dict -global_variable_dict = global_variable_instance.to_dict() -# create an instance of GlobalVariable from a dict -global_variable_from_dict = GlobalVariable.from_dict(global_variable_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/HistoryActor.md b/docs/HistoryActor.md new file mode 100644 index 00000000..6d60a914 --- /dev/null +++ b/docs/HistoryActor.md @@ -0,0 +1,30 @@ +# HistoryActor + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The user who made the change. | +**username** | **str** | Absent when the user no longer exists. | [optional] + +## Example + +```python +from revengai.models.history_actor import HistoryActor + +# TODO update the JSON string below +json = "{}" +# create an instance of HistoryActor from a JSON string +history_actor_instance = HistoryActor.from_json(json) +# print the JSON string representation of the object +print(HistoryActor.to_json()) + +# convert the object into a dict +history_actor_dict = history_actor_instance.to_dict() +# create an instance of HistoryActor from a dict +history_actor_from_dict = HistoryActor.from_dict(history_actor_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/LineAttributionsData.md b/docs/LineAttributionsData.md new file mode 100644 index 00000000..d9da92a0 --- /dev/null +++ b/docs/LineAttributionsData.md @@ -0,0 +1,29 @@ +# LineAttributionsData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**disassembly_line_number_to_ai_decompilation_line_numbers** | **Dict[str, Optional[List[int]]]** | Each disassembly line number mapped to the AI-decompilation line numbers it fed, e.g. {\"12\": [3, 4, 6], \"17\": [4]}. Both sides 0-based; many-to-many in both directions. Empty when no completed run has produced a correspondence, which is ordinary and not an error. | + +## Example + +```python +from revengai.models.line_attributions_data import LineAttributionsData + +# TODO update the JSON string below +json = "{}" +# create an instance of LineAttributionsData from a JSON string +line_attributions_data_instance = LineAttributionsData.from_json(json) +# print the JSON string representation of the object +print(LineAttributionsData.to_json()) + +# convert the object into a dict +line_attributions_data_dict = line_attributions_data_instance.to_dict() +# create an instance of LineAttributionsData from a dict +line_attributions_data_from_dict = LineAttributionsData.from_dict(line_attributions_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListAnalysisDataTypesOutputBody.md b/docs/ListAnalysisDataTypesOutputBody.md new file mode 100644 index 00000000..a88550cd --- /dev/null +++ b/docs/ListAnalysisDataTypesOutputBody.md @@ -0,0 +1,30 @@ +# ListAnalysisDataTypesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[DataTypeEntry]**](DataTypeEntry.md) | | +**total_count** | **int** | Total types matching the filters, ignoring pagination. | + +## Example + +```python +from revengai.models.list_analysis_data_types_output_body import ListAnalysisDataTypesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListAnalysisDataTypesOutputBody from a JSON string +list_analysis_data_types_output_body_instance = ListAnalysisDataTypesOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListAnalysisDataTypesOutputBody.to_json()) + +# convert the object into a dict +list_analysis_data_types_output_body_dict = list_analysis_data_types_output_body_instance.to_dict() +# create an instance of ListAnalysisDataTypesOutputBody from a dict +list_analysis_data_types_output_body_from_dict = ListAnalysisDataTypesOutputBody.from_dict(list_analysis_data_types_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListAnalysisFunctionsDataTypesOutputBody.md b/docs/ListAnalysisFunctionsDataTypesOutputBody.md deleted file mode 100644 index 4dd66e0e..00000000 --- a/docs/ListAnalysisFunctionsDataTypesOutputBody.md +++ /dev/null @@ -1,30 +0,0 @@ -# ListAnalysisFunctionsDataTypesOutputBody - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | [**List[DataTypesEntry]**](DataTypesEntry.md) | | -**total_count** | **int** | Total functions in the analysis, ignoring pagination. | - -## Example - -```python -from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody - -# TODO update the JSON string below -json = "{}" -# create an instance of ListAnalysisFunctionsDataTypesOutputBody from a JSON string -list_analysis_functions_data_types_output_body_instance = ListAnalysisFunctionsDataTypesOutputBody.from_json(json) -# print the JSON string representation of the object -print(ListAnalysisFunctionsDataTypesOutputBody.to_json()) - -# convert the object into a dict -list_analysis_functions_data_types_output_body_dict = list_analysis_functions_data_types_output_body_instance.to_dict() -# create an instance of ListAnalysisFunctionsDataTypesOutputBody from a dict -list_analysis_functions_data_types_output_body_from_dict = ListAnalysisFunctionsDataTypesOutputBody.from_dict(list_analysis_functions_data_types_output_body_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListDataTypeFunctionsBody.md b/docs/ListDataTypeFunctionsBody.md new file mode 100644 index 00000000..92013be9 --- /dev/null +++ b/docs/ListDataTypeFunctionsBody.md @@ -0,0 +1,30 @@ +# ListDataTypeFunctionsBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[DataTypeFunctionEntry]**](DataTypeFunctionEntry.md) | The page of matching functions, in ascending function ID order. Empty when no function uses the type. | +**next_after_function_id** | **int** | Pass as after_function_id to fetch the next page. Absent on the last page. | [optional] + +## Example + +```python +from revengai.models.list_data_type_functions_body import ListDataTypeFunctionsBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListDataTypeFunctionsBody from a JSON string +list_data_type_functions_body_instance = ListDataTypeFunctionsBody.from_json(json) +# print the JSON string representation of the object +print(ListDataTypeFunctionsBody.to_json()) + +# convert the object into a dict +list_data_type_functions_body_dict = list_data_type_functions_body_instance.to_dict() +# create an instance of ListDataTypeFunctionsBody from a dict +list_data_type_functions_body_from_dict = ListDataTypeFunctionsBody.from_dict(list_data_type_functions_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListFunctionSignaturesOutputBody.md b/docs/ListFunctionSignaturesOutputBody.md new file mode 100644 index 00000000..7f63cc7f --- /dev/null +++ b/docs/ListFunctionSignaturesOutputBody.md @@ -0,0 +1,30 @@ +# ListFunctionSignaturesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | [**List[AnalysisDataTypesGroup]**](AnalysisDataTypesGroup.md) | The types the returned signatures name, grouped by analysis and ordered by analysis_id. Returned only when include_data_types is true. | [optional] +**items** | [**List[BatchFunctionSignatureEntry]**](BatchFunctionSignatureEntry.md) | One entry per distinct requested function ID, in request order. A repeated ID yields one entry. | + +## Example + +```python +from revengai.models.list_function_signatures_output_body import ListFunctionSignaturesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListFunctionSignaturesOutputBody from a JSON string +list_function_signatures_output_body_instance = ListFunctionSignaturesOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListFunctionSignaturesOutputBody.to_json()) + +# convert the object into a dict +list_function_signatures_output_body_dict = list_function_signatures_output_body_instance.to_dict() +# create an instance of ListFunctionSignaturesOutputBody from a dict +list_function_signatures_output_body_from_dict = ListFunctionSignaturesOutputBody.from_dict(list_function_signatures_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListFunctionsDataTypesOutputBody.md b/docs/ListFunctionsDataTypesOutputBody.md deleted file mode 100644 index 8d8a7c61..00000000 --- a/docs/ListFunctionsDataTypesOutputBody.md +++ /dev/null @@ -1,29 +0,0 @@ -# ListFunctionsDataTypesOutputBody - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | [**List[DataTypesEntry]**](DataTypesEntry.md) | | - -## Example - -```python -from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody - -# TODO update the JSON string below -json = "{}" -# create an instance of ListFunctionsDataTypesOutputBody from a JSON string -list_functions_data_types_output_body_instance = ListFunctionsDataTypesOutputBody.from_json(json) -# print the JSON string representation of the object -print(ListFunctionsDataTypesOutputBody.to_json()) - -# convert the object into a dict -list_functions_data_types_output_body_dict = list_functions_data_types_output_body_instance.to_dict() -# create an instance of ListFunctionsDataTypesOutputBody from a dict -list_functions_data_types_output_body_from_dict = ListFunctionsDataTypesOutputBody.from_dict(list_functions_data_types_output_body_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/MatchFilters.md b/docs/MatchFilters.md index 901d73b0..2ea42c75 100644 --- a/docs/MatchFilters.md +++ b/docs/MatchFilters.md @@ -5,13 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**arch** | **str** | Restrict matches to this architecture (multi-platform models only; matches all architectures if omitted). Rejected for single-architecture models. | [optional] +**architectures** | **List[str]** | Restrict matches to candidates whose binary was detected as one of these architectures. Word size is part of the value, so there is no separate bits filter. Matches all architectures if omitted. | [optional] **binary_ids** | **List[int]** | Restrict the candidate pool to these binary IDs. | [optional] -**bits** | **int** | Restrict matches to this word size (multi-platform models only). Rejected for single-architecture models. | [optional] **collection_ids** | **List[int]** | Restrict the candidate pool to binaries in these collection IDs. | [optional] -**debug_types** | **List[str]** | Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER. | [optional] +**debug** | **bool** | Restrict matches to candidates with auto/system debug symbols. Multi-platform models only; rejected for single-architecture models. | [optional] +**debug_types** | **List[Optional[str]]** | Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER. | [optional] **function_ids** | **List[int]** | Restrict the candidate pool to these function IDs. | [optional] -**platform** | **str** | Restrict matches to this platform (multi-platform models only; matches all platforms if omitted). Rejected for single-architecture models. | [optional] +**include_user_debug** | **bool** | When debug is set, also match user-named functions (not only auto/system debug). No effect unless debug is true. | [optional] +**platforms** | **List[str]** | Restrict matches to candidates whose binary was detected as one of these platforms. Matches all platforms if omitted; a binary whose detection has not run is never matched by a non-empty filter. | [optional] **user_ids** | **List[int]** | Restrict the candidate pool to functions owned by these user IDs. | [optional] ## Example diff --git a/docs/PointerDataType.md b/docs/PointerDataType.md new file mode 100644 index 00000000..01e56d17 --- /dev/null +++ b/docs/PointerDataType.md @@ -0,0 +1,38 @@ +# PointerDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**PointerDefinition**](PointerDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.pointer_data_type import PointerDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of PointerDataType from a JSON string +pointer_data_type_instance = PointerDataType.from_json(json) +# print the JSON string representation of the object +print(PointerDataType.to_json()) + +# convert the object into a dict +pointer_data_type_dict = pointer_data_type_instance.to_dict() +# create an instance of PointerDataType from a dict +pointer_data_type_from_dict = PointerDataType.from_dict(pointer_data_type_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/PointerDefinition.md b/docs/PointerDefinition.md new file mode 100644 index 00000000..e3a86352 --- /dev/null +++ b/docs/PointerDefinition.md @@ -0,0 +1,29 @@ +# PointerDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pointee_data_type_id** | **int** | The type pointed at. | [optional] + +## Example + +```python +from revengai.models.pointer_definition import PointerDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of PointerDefinition from a JSON string +pointer_definition_instance = PointerDefinition.from_json(json) +# print the JSON string representation of the object +print(PointerDefinition.to_json()) + +# convert the object into a dict +pointer_definition_dict = pointer_definition_instance.to_dict() +# create an instance of PointerDefinition from a dict +pointer_definition_from_dict = PointerDefinition.from_dict(pointer_definition_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/RenameUnnamedFunctionsResult.md b/docs/RenameUnnamedFunctionsResult.md new file mode 100644 index 00000000..a0743565 --- /dev/null +++ b/docs/RenameUnnamedFunctionsResult.md @@ -0,0 +1,33 @@ +# RenameUnnamedFunctionsResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | Analysis the run was performed against | +**failed** | **int** | Functions whose rename attempt errored | +**renamed** | **int** | Functions successfully renamed | +**skipped** | **int** | Functions the agent chose not to rename | +**total** | **int** | Unnamed functions the run considered | + +## Example + +```python +from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RenameUnnamedFunctionsResult from a JSON string +rename_unnamed_functions_result_instance = RenameUnnamedFunctionsResult.from_json(json) +# print the JSON string representation of the object +print(RenameUnnamedFunctionsResult.to_json()) + +# convert the object into a dict +rename_unnamed_functions_result_dict = rename_unnamed_functions_result_instance.to_dict() +# create an instance of RenameUnnamedFunctionsResult from a dict +rename_unnamed_functions_result_from_dict = RenameUnnamedFunctionsResult.from_dict(rename_unnamed_functions_result_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/RenderedToken.md b/docs/RenderedToken.md new file mode 100644 index 00000000..817ee1d6 --- /dev/null +++ b/docs/RenderedToken.md @@ -0,0 +1,34 @@ +# RenderedToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | Data type this token names, or for a field the type that declares it. Scoped by the response's analysis_id. | [optional] +**function_id** | **int** | Function this token calls or names. Absent when the address reaches no function of this binary. | [optional] +**imported_function_id** | **int** | Imported function this token calls. Set instead of function_id for an external call. | [optional] +**kind** | **str** | What the token names. | +**vaddr** | **int** | Virtual address the token resolves to. Absent for a token with no address. | [optional] +**value** | **str** | Name the token resolves to. | + +## Example + +```python +from revengai.models.rendered_token import RenderedToken + +# TODO update the JSON string below +json = "{}" +# create an instance of RenderedToken from a JSON string +rendered_token_instance = RenderedToken.from_json(json) +# print the JSON string representation of the object +print(RenderedToken.to_json()) + +# convert the object into a dict +rendered_token_dict = rendered_token_instance.to_dict() +# create an instance of RenderedToken from a dict +rendered_token_from_dict = RenderedToken.from_dict(rendered_token_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReplacementValue.md b/docs/ReplacementValue.md deleted file mode 100644 index c2e0673c..00000000 --- a/docs/ReplacementValue.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReplacementValue - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | - -## Example - -```python -from revengai.models.replacement_value import ReplacementValue - -# TODO update the JSON string below -json = "{}" -# create an instance of ReplacementValue from a JSON string -replacement_value_instance = ReplacementValue.from_json(json) -# print the JSON string representation of the object -print(ReplacementValue.to_json()) - -# convert the object into a dict -replacement_value_dict = replacement_value_instance.to_dict() -# create an instance of ReplacementValue from a dict -replacement_value_from_dict = ReplacementValue.from_dict(replacement_value_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ResolvedEntity.md b/docs/ResolvedEntity.md new file mode 100644 index 00000000..cf19e93e --- /dev/null +++ b/docs/ResolvedEntity.md @@ -0,0 +1,52 @@ +# ResolvedEntity + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addr_token** | **str** | | +**all_addr_tokens** | **List[str]** | | +**bit_offset** | **int** | | +**byte_offset** | **int** | | +**byte_size** | **int** | | +**count** | **int** | | +**data_type_index** | **int** | | +**field_status** | **str** | | [optional] +**function_id** | **int** | | [optional] +**imported_function_id** | **int** | | [optional] +**kind** | **str** | | +**name** | **str** | | +**name_source** | **str** | | +**needs_naming** | **bool** | | +**provenance** | **str** | | +**resolved_name** | **str** | | +**suggested_type** | **str** | | +**suggestion_confidence** | **str** | | +**token** | **str** | | +**type_index** | **int** | | +**vaddr** | **int** | | +**value** | **str** | | +**value_confidence** | **str** | | +**value_type** | **str** | | + +## Example + +```python +from revengai.models.resolved_entity import ResolvedEntity + +# TODO update the JSON string below +json = "{}" +# create an instance of ResolvedEntity from a JSON string +resolved_entity_instance = ResolvedEntity.from_json(json) +# print the JSON string representation of the object +print(ResolvedEntity.to_json()) + +# convert the object into a dict +resolved_entity_dict = resolved_entity_instance.to_dict() +# create an instance of ResolvedEntity from a dict +resolved_entity_from_dict = ResolvedEntity.from_dict(resolved_entity_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/SegmentInfo.md b/docs/SegmentInfo.md index d4068bde..325defc2 100644 --- a/docs/SegmentInfo.md +++ b/docs/SegmentInfo.md @@ -1,6 +1,6 @@ # SegmentInfo -Represents the information about a segment. Attributes: name: The name of the segment. r: Determines if the segment has read permission. w: Determines if the segment has write permission. x: Determines if the segment has execute permission. start: The start address of the segment. end: The end address of the segment. +Represents the information about a segment. Attributes: name: The name of the segment. r: Determines if the segment has read permission. w: Determines if the segment has write permission. x: Determines if the segment has execute permission. start: The start address of the segment. end: The end address of the segment (inclusive). kind: Coarse classification of the segment: \"code\", \"data\", or \"other\". ## Properties @@ -12,6 +12,7 @@ Name | Type | Description | Notes **x** | **bool** | | [optional] **start** | **int** | | [optional] [default to 0] **end** | **int** | | [optional] [default to 0] +**kind** | **str** | | [optional] [default to 'other'] ## Example diff --git a/docs/SignatureParameterEntry.md b/docs/SignatureParameterEntry.md new file mode 100644 index 00000000..c93b2ef9 --- /dev/null +++ b/docs/SignatureParameterEntry.md @@ -0,0 +1,33 @@ +# SignatureParameterEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bit_length** | **int** | Width in bits, when the parameter occupies less than its type's full size. | [optional] +**data_type_id** | **int** | The parameter's type, resolvable against the analysis data types list. Absent when the type could not be resolved. | [optional] +**name** | **str** | Parameter name, absent when the producer had none. | [optional] +**ordinal** | **int** | Zero-based argument position. | +**storage** | [**SignatureStorageEntry**](SignatureStorageEntry.md) | Where the parameter is passed. | [optional] + +## Example + +```python +from revengai.models.signature_parameter_entry import SignatureParameterEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of SignatureParameterEntry from a JSON string +signature_parameter_entry_instance = SignatureParameterEntry.from_json(json) +# print the JSON string representation of the object +print(SignatureParameterEntry.to_json()) + +# convert the object into a dict +signature_parameter_entry_dict = signature_parameter_entry_instance.to_dict() +# create an instance of SignatureParameterEntry from a dict +signature_parameter_entry_from_dict = SignatureParameterEntry.from_dict(signature_parameter_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SignatureParameterInput.md b/docs/SignatureParameterInput.md new file mode 100644 index 00000000..f666930c --- /dev/null +++ b/docs/SignatureParameterInput.md @@ -0,0 +1,33 @@ +# SignatureParameterInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bit_length** | **int** | Width in bits, when the parameter occupies less than its type's full size. | [optional] +**data_type_id** | **int** | The parameter's type, which must belong to this analysis. Omit for an unresolved type. | [optional] +**name** | **str** | Parameter name. Omit for an unnamed parameter. | [optional] +**ordinal** | **int** | Zero-based argument position. Must equal the parameter's index in the list. | +**storage** | [**SignatureStorageInput**](SignatureStorageInput.md) | Where the parameter is passed. | [optional] + +## Example + +```python +from revengai.models.signature_parameter_input import SignatureParameterInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SignatureParameterInput from a JSON string +signature_parameter_input_instance = SignatureParameterInput.from_json(json) +# print the JSON string representation of the object +print(SignatureParameterInput.to_json()) + +# convert the object into a dict +signature_parameter_input_dict = signature_parameter_input_instance.to_dict() +# create an instance of SignatureParameterInput from a dict +signature_parameter_input_from_dict = SignatureParameterInput.from_dict(signature_parameter_input_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/SignatureStorageEntry.md b/docs/SignatureStorageEntry.md new file mode 100644 index 00000000..f82822b6 --- /dev/null +++ b/docs/SignatureStorageEntry.md @@ -0,0 +1,30 @@ +# SignatureStorageEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Storage class — typically reg, stack, mem or unknown. Not restricted to a fixed set. | [optional] +**location** | **str** | Register name or stack slot. | [optional] + +## Example + +```python +from revengai.models.signature_storage_entry import SignatureStorageEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of SignatureStorageEntry from a JSON string +signature_storage_entry_instance = SignatureStorageEntry.from_json(json) +# print the JSON string representation of the object +print(SignatureStorageEntry.to_json()) + +# convert the object into a dict +signature_storage_entry_dict = signature_storage_entry_instance.to_dict() +# create an instance of SignatureStorageEntry from a dict +signature_storage_entry_from_dict = SignatureStorageEntry.from_dict(signature_storage_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SignatureStorageInput.md b/docs/SignatureStorageInput.md new file mode 100644 index 00000000..05f3f33a --- /dev/null +++ b/docs/SignatureStorageInput.md @@ -0,0 +1,30 @@ +# SignatureStorageInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Storage class — typically reg, stack, mem or unknown. Not restricted to a fixed set. | [optional] +**location** | **str** | Register name or stack slot. | [optional] + +## Example + +```python +from revengai.models.signature_storage_input import SignatureStorageInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SignatureStorageInput from a JSON string +signature_storage_input_instance = SignatureStorageInput.from_json(json) +# print the JSON string representation of the object +print(SignatureStorageInput.to_json()) + +# convert the object into a dict +signature_storage_input_dict = signature_storage_input_instance.to_dict() +# create an instance of SignatureStorageInput from a dict +signature_storage_input_from_dict = SignatureStorageInput.from_dict(signature_storage_input_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/StackVariable.md b/docs/StackVariable.md deleted file mode 100644 index 4d78f8eb..00000000 --- a/docs/StackVariable.md +++ /dev/null @@ -1,34 +0,0 @@ -# StackVariable - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**offset** | **int** | Offset of the stack variable | -**name** | **str** | Name of the stack variable | -**type** | **str** | Data type of the stack variable | -**size** | **int** | Size of the stack variable in bytes | -**addr** | **int** | Memory address of the stack variable | - -## Example - -```python -from revengai.models.stack_variable import StackVariable - -# TODO update the JSON string below -json = "{}" -# create an instance of StackVariable from a JSON string -stack_variable_instance = StackVariable.from_json(json) -# print the JSON string representation of the object -print(StackVariable.to_json()) - -# convert the object into a dict -stack_variable_dict = stack_variable_instance.to_dict() -# create an instance of StackVariable from a dict -stack_variable_from_dict = StackVariable.from_dict(stack_variable_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/StatusBody.md b/docs/StatusBody.md new file mode 100644 index 00000000..c17d2aaa --- /dev/null +++ b/docs/StatusBody.md @@ -0,0 +1,31 @@ +# StatusBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_message** | **str** | Why the run failed. Only set when status is FAILED. | [optional] +**log_history** | **List[List[object]]** | Progress messages the run recorded, oldest first. | [optional] +**status** | **str** | Run status. UNINITIALISED means the agent has never been triggered for this analysis. | + +## Example + +```python +from revengai.models.status_body import StatusBody + +# TODO update the JSON string below +json = "{}" +# create an instance of StatusBody from a JSON string +status_body_instance = StatusBody.from_json(json) +# print the JSON string representation of the object +print(StatusBody.to_json()) + +# convert the object into a dict +status_body_dict = status_body_instance.to_dict() +# create an instance of StatusBody from a dict +status_body_from_dict = StatusBody.from_dict(status_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructDataType.md b/docs/StructDataType.md new file mode 100644 index 00000000..550a1dc1 --- /dev/null +++ b/docs/StructDataType.md @@ -0,0 +1,38 @@ +# StructDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**StructDefinition**](StructDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.struct_data_type import StructDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of StructDataType from a JSON string +struct_data_type_instance = StructDataType.from_json(json) +# print the JSON string representation of the object +print(StructDataType.to_json()) + +# convert the object into a dict +struct_data_type_dict = struct_data_type_instance.to_dict() +# create an instance of StructDataType from a dict +struct_data_type_from_dict = StructDataType.from_dict(struct_data_type_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/StructDefinition.md b/docs/StructDefinition.md new file mode 100644 index 00000000..3850b70f --- /dev/null +++ b/docs/StructDefinition.md @@ -0,0 +1,29 @@ +# StructDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | [**List[DataTypeMemberEntry]**](DataTypeMemberEntry.md) | The type's fields, in offset order. | + +## Example + +```python +from revengai.models.struct_definition import StructDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of StructDefinition from a JSON string +struct_definition_instance = StructDefinition.from_json(json) +# print the JSON string representation of the object +print(StructDefinition.to_json()) + +# convert the object into a dict +struct_definition_dict = struct_definition_instance.to_dict() +# create an instance of StructDefinition from a dict +struct_definition_from_dict = StructDefinition.from_dict(struct_definition_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/Structure.md b/docs/Structure.md deleted file mode 100644 index faf87db9..00000000 --- a/docs/Structure.md +++ /dev/null @@ -1,33 +0,0 @@ -# Structure - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | Name of the structure | -**size** | **int** | | [optional] -**members** | [**Dict[str, StructureMember]**](StructureMember.md) | Dictionary of structure members | -**artifact_type** | **str** | Type of artifact that the structure is associated with | [optional] - -## Example - -```python -from revengai.models.structure import Structure - -# TODO update the JSON string below -json = "{}" -# create an instance of Structure from a JSON string -structure_instance = Structure.from_json(json) -# print the JSON string representation of the object -print(Structure.to_json()) - -# convert the object into a dict -structure_dict = structure_instance.to_dict() -# create an instance of Structure from a dict -structure_from_dict = Structure.from_dict(structure_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/StructureMember.md b/docs/StructureMember.md deleted file mode 100644 index ff94d507..00000000 --- a/docs/StructureMember.md +++ /dev/null @@ -1,33 +0,0 @@ -# StructureMember - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | Name of the structure member | -**offset** | **int** | Offset of the member within the structure | -**type** | **str** | Data type of the structure member | -**size** | **int** | Size of the structure member in bytes | - -## Example - -```python -from revengai.models.structure_member import StructureMember - -# TODO update the JSON string below -json = "{}" -# create an instance of StructureMember from a JSON string -structure_member_instance = StructureMember.from_json(json) -# print the JSON string representation of the object -print(StructureMember.to_json()) - -# convert the object into a dict -structure_member_dict = structure_member_instance.to_dict() -# create an instance of StructureMember from a dict -structure_member_from_dict = StructureMember.from_dict(structure_member_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/Token.md b/docs/Token.md new file mode 100644 index 00000000..26af7e12 --- /dev/null +++ b/docs/Token.md @@ -0,0 +1,29 @@ +# Token + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Name the token resolves to. An empty string in a request removes the override. | + +## Example + +```python +from revengai.models.token import Token + +# TODO update the JSON string below +json = "{}" +# create an instance of Token from a JSON string +token_instance = Token.from_json(json) +# print the JSON string representation of the object +print(Token.to_json()) + +# convert the object into a dict +token_dict = token_instance.to_dict() +# create an instance of Token from a dict +token_from_dict = Token.from_dict(token_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TokenisedData.md b/docs/TokenisedData.md index d05c88d9..a159c11e 100644 --- a/docs/TokenisedData.md +++ b/docs/TokenisedData.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**function_mapping** | [**AIDecompFunctionMapping**](AIDecompFunctionMapping.md) | Complete mapping data for token resolution | [optional] +**entities** | [**List[ResolvedEntity]**](ResolvedEntity.md) | One entry per token in the tokenised source, with the name it resolves to and its hover metadata. | [optional] +**line_attribution** | **object** | | [optional] **predicted_function_name** | **str** | Predicted function name from the AI model | [optional] **status** | **str** | Task status | **tokenised_decompilation** | **str** | Source code with placeholder tokens | [optional] diff --git a/docs/TriggerRenameUnnamedFunctionsInputBody.md b/docs/TriggerRenameUnnamedFunctionsInputBody.md new file mode 100644 index 00000000..b8a0030f --- /dev/null +++ b/docs/TriggerRenameUnnamedFunctionsInputBody.md @@ -0,0 +1,29 @@ +# TriggerRenameUnnamedFunctionsInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limit** | **int** | Stop after this many functions. Omit to process every unnamed function in the analysis. | [optional] + +## Example + +```python +from revengai.models.trigger_rename_unnamed_functions_input_body import TriggerRenameUnnamedFunctionsInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of TriggerRenameUnnamedFunctionsInputBody from a JSON string +trigger_rename_unnamed_functions_input_body_instance = TriggerRenameUnnamedFunctionsInputBody.from_json(json) +# print the JSON string representation of the object +print(TriggerRenameUnnamedFunctionsInputBody.to_json()) + +# convert the object into a dict +trigger_rename_unnamed_functions_input_body_dict = trigger_rename_unnamed_functions_input_body_instance.to_dict() +# create an instance of TriggerRenameUnnamedFunctionsInputBody from a dict +trigger_rename_unnamed_functions_input_body_from_dict = TriggerRenameUnnamedFunctionsInputBody.from_dict(trigger_rename_unnamed_functions_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TypeDefinition.md b/docs/TypeDefinition.md deleted file mode 100644 index d64f983d..00000000 --- a/docs/TypeDefinition.md +++ /dev/null @@ -1,32 +0,0 @@ -# TypeDefinition - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | Name of the type definition | -**type** | **str** | Underlying type of the type definition | -**artifact_type** | **str** | Type of artifact the type definition is associated with | [optional] - -## Example - -```python -from revengai.models.type_definition import TypeDefinition - -# TODO update the JSON string below -json = "{}" -# create an instance of TypeDefinition from a JSON string -type_definition_instance = TypeDefinition.from_json(json) -# print the JSON string representation of the object -print(TypeDefinition.to_json()) - -# convert the object into a dict -type_definition_dict = type_definition_instance.to_dict() -# create an instance of TypeDefinition from a dict -type_definition_from_dict = TypeDefinition.from_dict(type_definition_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/TypedefDataType.md b/docs/TypedefDataType.md new file mode 100644 index 00000000..185f6ea4 --- /dev/null +++ b/docs/TypedefDataType.md @@ -0,0 +1,38 @@ +# TypedefDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**TypedefDefinition**](TypedefDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.typedef_data_type import TypedefDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of TypedefDataType from a JSON string +typedef_data_type_instance = TypedefDataType.from_json(json) +# print the JSON string representation of the object +print(TypedefDataType.to_json()) + +# convert the object into a dict +typedef_data_type_dict = typedef_data_type_instance.to_dict() +# create an instance of TypedefDataType from a dict +typedef_data_type_from_dict = TypedefDataType.from_dict(typedef_data_type_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/TypedefDefinition.md b/docs/TypedefDefinition.md new file mode 100644 index 00000000..54d3e575 --- /dev/null +++ b/docs/TypedefDefinition.md @@ -0,0 +1,29 @@ +# TypedefDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target_data_type_id** | **int** | The type being aliased. | [optional] + +## Example + +```python +from revengai.models.typedef_definition import TypedefDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of TypedefDefinition from a JSON string +typedef_definition_instance = TypedefDefinition.from_json(json) +# print the JSON string representation of the object +print(TypedefDefinition.to_json()) + +# convert the object into a dict +typedef_definition_dict = typedef_definition_instance.to_dict() +# create an instance of TypedefDefinition from a dict +typedef_definition_from_dict = TypedefDefinition.from_dict(typedef_definition_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/UnionDataType.md b/docs/UnionDataType.md new file mode 100644 index 00000000..e1b76089 --- /dev/null +++ b/docs/UnionDataType.md @@ -0,0 +1,38 @@ +# UnionDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**definition** | [**UnionDefinition**](UnionDefinition.md) | Absent only for a type referenced but never defined. | [optional] +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.union_data_type import UnionDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UnionDataType from a JSON string +union_data_type_instance = UnionDataType.from_json(json) +# print the JSON string representation of the object +print(UnionDataType.to_json()) + +# convert the object into a dict +union_data_type_dict = union_data_type_instance.to_dict() +# create an instance of UnionDataType from a dict +union_data_type_from_dict = UnionDataType.from_dict(union_data_type_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/UnionDefinition.md b/docs/UnionDefinition.md new file mode 100644 index 00000000..a85a5ce3 --- /dev/null +++ b/docs/UnionDefinition.md @@ -0,0 +1,29 @@ +# UnionDefinition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | [**List[DataTypeMemberEntry]**](DataTypeMemberEntry.md) | The type's fields. Every member starts at offset 0. | + +## Example + +```python +from revengai.models.union_definition import UnionDefinition + +# TODO update the JSON string below +json = "{}" +# create an instance of UnionDefinition from a JSON string +union_definition_instance = UnionDefinition.from_json(json) +# print the JSON string representation of the object +print(UnionDefinition.to_json()) + +# convert the object into a dict +union_definition_dict = union_definition_instance.to_dict() +# create an instance of UnionDefinition from a dict +union_definition_from_dict = UnionDefinition.from_dict(union_definition_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/UnknownDataType.md b/docs/UnknownDataType.md new file mode 100644 index 00000000..9c42f80c --- /dev/null +++ b/docs/UnknownDataType.md @@ -0,0 +1,37 @@ +# UnknownDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | When this type was extracted. | +**data_type_id** | **int** | Identifies the type within its analysis. 0 is a valid id. | +**has_definition** | **bool** | Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined. | +**kind** | **str** | | +**name** | **str** | Type name. | +**namespace** | **str** | The scope qualifying the type name. Empty for a program-defined type. | +**size** | **int** | Size in bytes, absent when it could not be determined. | [optional] +**source_function_id** | **int** | The function this type was copied from, when transferred rather than extracted. | [optional] +**source_type** | **str** | Where this type came from. | + +## Example + +```python +from revengai.models.unknown_data_type import UnknownDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UnknownDataType from a JSON string +unknown_data_type_instance = UnknownDataType.from_json(json) +# print the JSON string representation of the object +print(UnknownDataType.to_json()) + +# convert the object into a dict +unknown_data_type_dict = unknown_data_type_instance.to_dict() +# create an instance of UnknownDataType from a dict +unknown_data_type_from_dict = UnknownDataType.from_dict(unknown_data_type_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/UpdateAnalysisDataTypesInputBody.md b/docs/UpdateAnalysisDataTypesInputBody.md new file mode 100644 index 00000000..483141df --- /dev/null +++ b/docs/UpdateAnalysisDataTypesInputBody.md @@ -0,0 +1,29 @@ +# UpdateAnalysisDataTypesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | [**List[UpdateDataTypeEntry]**](UpdateDataTypeEntry.md) | The replacements. Every data_type_id must belong to the analysis, and none may repeat. | + +## Example + +```python +from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAnalysisDataTypesInputBody from a JSON string +update_analysis_data_types_input_body_instance = UpdateAnalysisDataTypesInputBody.from_json(json) +# print the JSON string representation of the object +print(UpdateAnalysisDataTypesInputBody.to_json()) + +# convert the object into a dict +update_analysis_data_types_input_body_dict = update_analysis_data_types_input_body_instance.to_dict() +# create an instance of UpdateAnalysisDataTypesInputBody from a dict +update_analysis_data_types_input_body_from_dict = UpdateAnalysisDataTypesInputBody.from_dict(update_analysis_data_types_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateArrayDataType.md b/docs/UpdateArrayDataType.md new file mode 100644 index 00000000..044c4efe --- /dev/null +++ b/docs/UpdateArrayDataType.md @@ -0,0 +1,34 @@ +# UpdateArrayDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**ArrayDefinition**](ArrayDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_array_data_type import UpdateArrayDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateArrayDataType from a JSON string +update_array_data_type_instance = UpdateArrayDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateArrayDataType.to_json()) + +# convert the object into a dict +update_array_data_type_dict = update_array_data_type_instance.to_dict() +# create an instance of UpdateArrayDataType from a dict +update_array_data_type_from_dict = UpdateArrayDataType.from_dict(update_array_data_type_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/UpdateBaseDataType.md b/docs/UpdateBaseDataType.md new file mode 100644 index 00000000..80ee9a14 --- /dev/null +++ b/docs/UpdateBaseDataType.md @@ -0,0 +1,33 @@ +# UpdateBaseDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_base_data_type import UpdateBaseDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateBaseDataType from a JSON string +update_base_data_type_instance = UpdateBaseDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateBaseDataType.to_json()) + +# convert the object into a dict +update_base_data_type_dict = update_base_data_type_instance.to_dict() +# create an instance of UpdateBaseDataType from a dict +update_base_data_type_from_dict = UpdateBaseDataType.from_dict(update_base_data_type_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/UpdateBitfieldDataType.md b/docs/UpdateBitfieldDataType.md new file mode 100644 index 00000000..9be597dc --- /dev/null +++ b/docs/UpdateBitfieldDataType.md @@ -0,0 +1,33 @@ +# UpdateBitfieldDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_bitfield_data_type import UpdateBitfieldDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateBitfieldDataType from a JSON string +update_bitfield_data_type_instance = UpdateBitfieldDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateBitfieldDataType.to_json()) + +# convert the object into a dict +update_bitfield_data_type_dict = update_bitfield_data_type_instance.to_dict() +# create an instance of UpdateBitfieldDataType from a dict +update_bitfield_data_type_from_dict = UpdateBitfieldDataType.from_dict(update_bitfield_data_type_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/UpdateDataTypeEntry.md b/docs/UpdateDataTypeEntry.md new file mode 100644 index 00000000..27aa7bbc --- /dev/null +++ b/docs/UpdateDataTypeEntry.md @@ -0,0 +1,35 @@ +# UpdateDataTypeEntry + +A replacement for the data type named by `data_type_id`. `kind` selects the variant and so which definition the type must carry; changing it is allowed. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**FunctionTypeDefinition**](FunctionTypeDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_data_type_entry import UpdateDataTypeEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDataTypeEntry from a JSON string +update_data_type_entry_instance = UpdateDataTypeEntry.from_json(json) +# print the JSON string representation of the object +print(UpdateDataTypeEntry.to_json()) + +# convert the object into a dict +update_data_type_entry_dict = update_data_type_entry_instance.to_dict() +# create an instance of UpdateDataTypeEntry from a dict +update_data_type_entry_from_dict = UpdateDataTypeEntry.from_dict(update_data_type_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDataTypesInputBody.md b/docs/UpdateDataTypesInputBody.md deleted file mode 100644 index b79a4c5d..00000000 --- a/docs/UpdateDataTypesInputBody.md +++ /dev/null @@ -1,30 +0,0 @@ -# UpdateDataTypesInputBody - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_types** | **object** | | -**data_types_version** | **int** | Current version of the function data types. The update is rejected if the stored version has moved on. Pass 0 on the first write. | - -## Example - -```python -from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody - -# TODO update the JSON string below -json = "{}" -# create an instance of UpdateDataTypesInputBody from a JSON string -update_data_types_input_body_instance = UpdateDataTypesInputBody.from_json(json) -# print the JSON string representation of the object -print(UpdateDataTypesInputBody.to_json()) - -# convert the object into a dict -update_data_types_input_body_dict = update_data_types_input_body_instance.to_dict() -# create an instance of UpdateDataTypesInputBody from a dict -update_data_types_input_body_from_dict = UpdateDataTypesInputBody.from_dict(update_data_types_input_body_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateDataTypesOutputBody.md b/docs/UpdateDataTypesOutputBody.md deleted file mode 100644 index 7118aeab..00000000 --- a/docs/UpdateDataTypesOutputBody.md +++ /dev/null @@ -1,31 +0,0 @@ -# UpdateDataTypesOutputBody - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_types** | **object** | | -**data_types_version** | **int** | Version of the stored function data types after the update | -**function_id** | **int** | Function ID | - -## Example - -```python -from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody - -# TODO update the JSON string below -json = "{}" -# create an instance of UpdateDataTypesOutputBody from a JSON string -update_data_types_output_body_instance = UpdateDataTypesOutputBody.from_json(json) -# print the JSON string representation of the object -print(UpdateDataTypesOutputBody.to_json()) - -# convert the object into a dict -update_data_types_output_body_dict = update_data_types_output_body_instance.to_dict() -# create an instance of UpdateDataTypesOutputBody from a dict -update_data_types_output_body_from_dict = UpdateDataTypesOutputBody.from_dict(update_data_types_output_body_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateEnumDataType.md b/docs/UpdateEnumDataType.md new file mode 100644 index 00000000..04b45c97 --- /dev/null +++ b/docs/UpdateEnumDataType.md @@ -0,0 +1,34 @@ +# UpdateEnumDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**EnumDefinition**](EnumDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_enum_data_type import UpdateEnumDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateEnumDataType from a JSON string +update_enum_data_type_instance = UpdateEnumDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateEnumDataType.to_json()) + +# convert the object into a dict +update_enum_data_type_dict = update_enum_data_type_instance.to_dict() +# create an instance of UpdateEnumDataType from a dict +update_enum_data_type_from_dict = UpdateEnumDataType.from_dict(update_enum_data_type_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/UpdateFunctionDataType.md b/docs/UpdateFunctionDataType.md new file mode 100644 index 00000000..85069b1e --- /dev/null +++ b/docs/UpdateFunctionDataType.md @@ -0,0 +1,34 @@ +# UpdateFunctionDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**FunctionTypeDefinition**](FunctionTypeDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_function_data_type import UpdateFunctionDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateFunctionDataType from a JSON string +update_function_data_type_instance = UpdateFunctionDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateFunctionDataType.to_json()) + +# convert the object into a dict +update_function_data_type_dict = update_function_data_type_instance.to_dict() +# create an instance of UpdateFunctionDataType from a dict +update_function_data_type_from_dict = UpdateFunctionDataType.from_dict(update_function_data_type_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/UpdateFunctionSignatureInputBody.md b/docs/UpdateFunctionSignatureInputBody.md new file mode 100644 index 00000000..9929d220 --- /dev/null +++ b/docs/UpdateFunctionSignatureInputBody.md @@ -0,0 +1,31 @@ +# UpdateFunctionSignatureInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**calling_convention** | **str** | Calling convention. Omit when there is none to record. | [optional] +**parameters** | [**List[SignatureParameterInput]**](SignatureParameterInput.md) | Parameters in argument order. An empty list records a function that takes no arguments. | +**return_data_type_id** | **int** | Return type, which must belong to this analysis. Omit for an unresolved return type. | [optional] + +## Example + +```python +from revengai.models.update_function_signature_input_body import UpdateFunctionSignatureInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateFunctionSignatureInputBody from a JSON string +update_function_signature_input_body_instance = UpdateFunctionSignatureInputBody.from_json(json) +# print the JSON string representation of the object +print(UpdateFunctionSignatureInputBody.to_json()) + +# convert the object into a dict +update_function_signature_input_body_dict = update_function_signature_input_body_instance.to_dict() +# create an instance of UpdateFunctionSignatureInputBody from a dict +update_function_signature_input_body_from_dict = UpdateFunctionSignatureInputBody.from_dict(update_function_signature_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdatePointerDataType.md b/docs/UpdatePointerDataType.md new file mode 100644 index 00000000..d036366c --- /dev/null +++ b/docs/UpdatePointerDataType.md @@ -0,0 +1,34 @@ +# UpdatePointerDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**PointerDefinition**](PointerDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_pointer_data_type import UpdatePointerDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdatePointerDataType from a JSON string +update_pointer_data_type_instance = UpdatePointerDataType.from_json(json) +# print the JSON string representation of the object +print(UpdatePointerDataType.to_json()) + +# convert the object into a dict +update_pointer_data_type_dict = update_pointer_data_type_instance.to_dict() +# create an instance of UpdatePointerDataType from a dict +update_pointer_data_type_from_dict = UpdatePointerDataType.from_dict(update_pointer_data_type_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/UpdateStructDataType.md b/docs/UpdateStructDataType.md new file mode 100644 index 00000000..7d2c2f77 --- /dev/null +++ b/docs/UpdateStructDataType.md @@ -0,0 +1,34 @@ +# UpdateStructDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**StructDefinition**](StructDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_struct_data_type import UpdateStructDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateStructDataType from a JSON string +update_struct_data_type_instance = UpdateStructDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateStructDataType.to_json()) + +# convert the object into a dict +update_struct_data_type_dict = update_struct_data_type_instance.to_dict() +# create an instance of UpdateStructDataType from a dict +update_struct_data_type_from_dict = UpdateStructDataType.from_dict(update_struct_data_type_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/UpdateTypedefDataType.md b/docs/UpdateTypedefDataType.md new file mode 100644 index 00000000..a0601781 --- /dev/null +++ b/docs/UpdateTypedefDataType.md @@ -0,0 +1,34 @@ +# UpdateTypedefDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**TypedefDefinition**](TypedefDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_typedef_data_type import UpdateTypedefDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateTypedefDataType from a JSON string +update_typedef_data_type_instance = UpdateTypedefDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateTypedefDataType.to_json()) + +# convert the object into a dict +update_typedef_data_type_dict = update_typedef_data_type_instance.to_dict() +# create an instance of UpdateTypedefDataType from a dict +update_typedef_data_type_from_dict = UpdateTypedefDataType.from_dict(update_typedef_data_type_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/UpdateUnionDataType.md b/docs/UpdateUnionDataType.md new file mode 100644 index 00000000..255a172e --- /dev/null +++ b/docs/UpdateUnionDataType.md @@ -0,0 +1,34 @@ +# UpdateUnionDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**definition** | [**UnionDefinition**](UnionDefinition.md) | | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_union_data_type import UpdateUnionDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateUnionDataType from a JSON string +update_union_data_type_instance = UpdateUnionDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateUnionDataType.to_json()) + +# convert the object into a dict +update_union_data_type_dict = update_union_data_type_instance.to_dict() +# create an instance of UpdateUnionDataType from a dict +update_union_data_type_from_dict = UpdateUnionDataType.from_dict(update_union_data_type_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/UpdateUnknownDataType.md b/docs/UpdateUnknownDataType.md new file mode 100644 index 00000000..58e5ce57 --- /dev/null +++ b/docs/UpdateUnknownDataType.md @@ -0,0 +1,33 @@ +# UpdateUnknownDataType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type_id** | **int** | The type to replace, as returned by the data types list for this analysis. | +**kind** | **str** | | +**name** | **str** | Type name. Unique within the analysis for a given namespace and kind. | +**namespace** | **str** | The scope qualifying the type name. Omit for a type of the binary's own. | [optional] +**size** | **int** | Size in bytes. Omit when it is not known. | [optional] + +## Example + +```python +from revengai.models.update_unknown_data_type import UpdateUnknownDataType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateUnknownDataType from a JSON string +update_unknown_data_type_instance = UpdateUnknownDataType.from_json(json) +# print the JSON string representation of the object +print(UpdateUnknownDataType.to_json()) + +# convert the object into a dict +update_unknown_data_type_dict = update_unknown_data_type_instance.to_dict() +# create an instance of UpdateUnknownDataType from a dict +update_unknown_data_type_from_dict = UpdateUnknownDataType.from_dict(update_unknown_data_type_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpsertOverridesData.md b/docs/UpsertOverridesData.md index 7fe350e2..7174d0f0 100644 --- a/docs/UpsertOverridesData.md +++ b/docs/UpsertOverridesData.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**user_override_mappings** | **Dict[str, str]** | Merged override mappings after applying changes | +**placeholder_to_user_override** | [**Dict[str, Token]**](Token.md) | Every override on the function after applying this request, keyed by placeholder token. | ## Example diff --git a/docs/UpsertOverridesInputBody.md b/docs/UpsertOverridesInputBody.md index f94d55da..7b786a6c 100644 --- a/docs/UpsertOverridesInputBody.md +++ b/docs/UpsertOverridesInputBody.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**overrides** | **Dict[str, str]** | Token to name mappings. Empty string removes the override. | +**overrides** | [**Dict[str, Token]**](Token.md) | Overrides keyed by placeholder token. An entry whose value is an empty string removes that override. | ## Example diff --git a/docs/V2FunctionHeader.md b/docs/V2FunctionHeader.md deleted file mode 100644 index 7ce2aa81..00000000 --- a/docs/V2FunctionHeader.md +++ /dev/null @@ -1,33 +0,0 @@ -# V2FunctionHeader - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | Name of the function | -**addr** | **int** | Memory address of the function | -**type** | **str** | Return type of the function | -**args** | [**Dict[str, Argument]**](Argument.md) | Dictionary of function arguments | - -## Example - -```python -from revengai.models.v2_function_header import V2FunctionHeader - -# TODO update the JSON string below -json = "{}" -# create an instance of V2FunctionHeader from a JSON string -v2_function_header_instance = V2FunctionHeader.from_json(json) -# print the JSON string representation of the object -print(V2FunctionHeader.to_json()) - -# convert the object into a dict -v2_function_header_dict = v2_function_header_instance.to_dict() -# create an instance of V2FunctionHeader from a dict -v2_function_header_from_dict = V2FunctionHeader.from_dict(v2_function_header_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/V2FunctionInfo.md b/docs/V2FunctionInfo.md deleted file mode 100644 index 5336003c..00000000 --- a/docs/V2FunctionInfo.md +++ /dev/null @@ -1,30 +0,0 @@ -# V2FunctionInfo - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**func_types** | [**V2FunctionType**](V2FunctionType.md) | | [optional] -**func_deps** | [**List[V2FunctionInfoFuncDepsInner]**](V2FunctionInfoFuncDepsInner.md) | List of function dependencies | - -## Example - -```python -from revengai.models.v2_function_info import V2FunctionInfo - -# TODO update the JSON string below -json = "{}" -# create an instance of V2FunctionInfo from a JSON string -v2_function_info_instance = V2FunctionInfo.from_json(json) -# print the JSON string representation of the object -print(V2FunctionInfo.to_json()) - -# convert the object into a dict -v2_function_info_dict = v2_function_info_instance.to_dict() -# create an instance of V2FunctionInfo from a dict -v2_function_info_from_dict = V2FunctionInfo.from_dict(v2_function_info_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/V2FunctionInfoFuncDepsInner.md b/docs/V2FunctionInfoFuncDepsInner.md deleted file mode 100644 index 7529ac24..00000000 --- a/docs/V2FunctionInfoFuncDepsInner.md +++ /dev/null @@ -1,35 +0,0 @@ -# V2FunctionInfoFuncDepsInner - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**name** | **str** | Name of the global variable | -**size** | **int** | Size of the global variable in bytes | -**members** | **Dict[str, int]** | Dictionary of enumeration members and their values | -**artifact_type** | **str** | Type of artifact that the global variable is associated with | [optional] -**type** | **str** | Data type of the global variable | -**addr** | **int** | Memory address of the global variable | - -## Example - -```python -from revengai.models.v2_function_info_func_deps_inner import V2FunctionInfoFuncDepsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of V2FunctionInfoFuncDepsInner from a JSON string -v2_function_info_func_deps_inner_instance = V2FunctionInfoFuncDepsInner.from_json(json) -# print the JSON string representation of the object -print(V2FunctionInfoFuncDepsInner.to_json()) - -# convert the object into a dict -v2_function_info_func_deps_inner_dict = v2_function_info_func_deps_inner_instance.to_dict() -# create an instance of V2FunctionInfoFuncDepsInner from a dict -v2_function_info_func_deps_inner_from_dict = V2FunctionInfoFuncDepsInner.from_dict(v2_function_info_func_deps_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/V2FunctionType.md b/docs/V2FunctionType.md deleted file mode 100644 index f0f7974a..00000000 --- a/docs/V2FunctionType.md +++ /dev/null @@ -1,36 +0,0 @@ -# V2FunctionType - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**addr** | **int** | Memory address of the function | -**size** | **int** | Size of the function in bytes | -**header** | [**V2FunctionHeader**](V2FunctionHeader.md) | Function header information | -**stack_vars** | [**Dict[str, StackVariable]**](StackVariable.md) | | [optional] -**name** | **str** | Name of the function | -**type** | **str** | Return type of the function | -**artifact_type** | **str** | Type of artifact that the structure is associated with | [optional] [default to 'Function'] - -## Example - -```python -from revengai.models.v2_function_type import V2FunctionType - -# TODO update the JSON string below -json = "{}" -# create an instance of V2FunctionType from a JSON string -v2_function_type_instance = V2FunctionType.from_json(json) -# print the JSON string representation of the object -print(V2FunctionType.to_json()) - -# convert the object into a dict -v2_function_type_dict = v2_function_type_instance.to_dict() -# create an instance of V2FunctionType from a dict -v2_function_type_from_dict = V2FunctionType.from_dict(v2_function_type_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 be3c30b3..1ec9c727 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.131.2" +__version__ = "v4.4.0" # Define package exports __all__ = [ @@ -28,11 +28,11 @@ "CollectionsApi", "ConfigApi", "ConversationsApi", + "DataTypesApi", "ExternalSourcesApi", "FirmwareApi", "FunctionsAIDecompilationApi", "FunctionsCoreApi", - "FunctionsDataTypesApi", "FunctionsRenamingHistoryApi", "IAMUsersApi", "ModelsApi", @@ -47,9 +47,6 @@ "ApiKeyError", "ApiAttributeError", "ApiException", - "AIDecompFunctionMapping", - "AIDecompInverseFunctionMapItem", - "AIDecompInverseStringMapItem", "APIError", "AddCalleeInputBody", "AddCollectionBinariesInputBody", @@ -69,11 +66,14 @@ "AnalysisConfigSnapshot", "AnalysisCreateRequest", "AnalysisCreateResponse", + "AnalysisDataTypesGroup", + "AnalysisDataTypesOutputBody", "AnalysisDetailResponse", "AnalysisFunctionEntry", "AnalysisFunctionMapping", "AnalysisFunctions", "AnalysisFunctionsList", + "AnalysisLogEntry", "AnalysisLogMessage", "AnalysisLogs", "AnalysisRecord", @@ -98,12 +98,14 @@ "AppApiRestV2FunctionsTypesFunction", "AppApiRestV2InfoTypesCapability", "ArchiveContentEntry", - "Argument", + "ArrayDataType", + "ArrayDefinition", "Artifact", "AttemptFailedEvent", "AttemptStartedEvent", "AutoRunAgents", "AutoUnstripStatusOutputBody", + "BaseDataType", "BaseResponse", "BaseResponseAdditionalDetailsStatusResponse", "BaseResponseAnalysisBulkAddTagsResponse", @@ -138,13 +140,9 @@ "BaseResponseExternalResponse", "BaseResponseFunctionBlocksResponse", "BaseResponseFunctionCapabilityResponse", - "BaseResponseFunctionDataTypes", - "BaseResponseFunctionDataTypesList", "BaseResponseFunctionSearchResponse", "BaseResponseFunctionStringsResponse", "BaseResponseFunctionsDetailResponse", - "BaseResponseGenerateFunctionDataTypes", - "BaseResponseGenerationStatusList", "BaseResponseGetPublicUserResponse", "BaseResponseListCalleesCallerFunctionsResponse", "BaseResponseListCollectionResults", @@ -170,14 +168,11 @@ "BaseResponseXrefResponse", "Basic", "BatchBinaryMatchResult", + "BatchFunctionSignatureEntry", "BatchMatchingOutputBody", "BatchRenameInputBody", "BatchRenameItem", "BatchRenameOutputBody", - "BatchUpdateDataTypesInputBody", - "BatchUpdateDataTypesItem", - "BatchUpdateDataTypesOutputBody", - "BatchUpdateDataTypesResult", "BinariesRelatedStatusResponse", "BinariesTaskStatus", "Binary", @@ -189,6 +184,7 @@ "BinarySearchResponse", "BinarySearchResult", "BinaryTaskStatus", + "BitfieldDataType", "BulkCreateUserResult", "BulkCreateUsersOutputBody", "BulkDeleteAnalysesRequest", @@ -232,20 +228,40 @@ "Conversation", "ConversationContext", "ConversationWithEvents", + "CopyFunctionSignaturesInputBody", + "CopyFunctionSignaturesOutputBody", + "CopySignatureItem", "CreateAIDecompOutputBody", + "CreateAnalysisDataTypesInputBody", + "CreateArrayDataType", + "CreateBaseDataType", + "CreateBitfieldDataType", "CreateCheckoutSessionInputBody", "CreateCollectionInputBody", "CreateCollectionOutputBody", "CreateConversationRequest", + "CreateDataTypeEntry", + "CreateEnumDataType", + "CreateFunctionDataType", "CreateGroupInputBody", "CreateIdentityInputBody", "CreateIssuerInputBody", "CreateOrganisationInputBody", + "CreatePointerDataType", "CreatePortalSessionInputBody", + "CreateStructDataType", "CreateTeamInputBody", + "CreateTypedefDataType", + "CreateUnionDataType", + "CreateUnknownDataType", "CreateUserInputBody", "Created", - "DataTypesEntry", + "DataTypeEntry", + "DataTypeEnumValueEntry", + "DataTypeFunctionEntry", + "DataTypeFunctionParameterEntry", + "DataTypeMemberEntry", + "DataTypeVersion", "DecompFailedEvent", "DecompFinishedEvent", "DecompilationCommentContext", @@ -265,7 +281,8 @@ "ELFSymbol", "ElfDynamicEntry", "EntrypointModel", - "Enumeration", + "EnumDataType", + "EnumDefinition", "ErrorBody", "ErrorModel", "Event", @@ -305,22 +322,14 @@ "FileMetadata", "Filters", "FormFile", - "FunctionArgument", "FunctionBlockDestinationResponse", "FunctionBlockResponse", "FunctionBlocksResponse", "FunctionBoundary", "FunctionCallEdges", "FunctionCapabilityResponse", - "FunctionDataTypes", - "FunctionDataTypesList", - "FunctionDataTypesListItem", - "FunctionDataTypesParams", - "FunctionDataTypesStatus", - "FunctionDependency", + "FunctionDataType", "FunctionDetailsOutputBody", - "FunctionHeader", - "FunctionInfo", "FunctionListItem", "FunctionLocalVariableResponse", "FunctionMapping", @@ -331,28 +340,32 @@ "FunctionRenameMap", "FunctionSearchResponse", "FunctionSearchResult", + "FunctionSignatureBody", + "FunctionSignatureEntry", + "FunctionSignatureVersion", "FunctionSourceType", - "FunctionStackVariable", "FunctionString", "FunctionStringItem", "FunctionStringsResponse", - "FunctionType", + "FunctionTypeDefinition", "FunctionsDetailResponse", "FunctionsListRename", - "GenerateFunctionDataTypes", "GeneratePDFOutputBody", - "GenerationStatusList", "GetAdditionalDetailsOutputBody", "GetAdditionalDetailsStatusOutputBody", "GetAiDecompilationRatingResponse", + "GetAnalysisLogsOutputBody", "GetAnalysisStringsStatusOutputBody", "GetCollectionOutputBody", + "GetDataTypeHistoryBody", + "GetFunctionSignatureHistoryBody", "GetMatchesOutputBody", "GetMatchesStatusOutputBody", "GetProductsOutputBody", "GetPublicUserResponse", "GetSubscriptionOutputBody", - "GlobalVariable", + "GetTokensResponse", + "HistoryActor", "HistoryEntry", "HttpRequest", "IOC", @@ -368,16 +381,18 @@ "InsertAnalysisLogRequest", "InviteUserInputBody", "IssuerAllowedDomain", + "LineAttributionsData", "ListAnalysesOutputBody", - "ListAnalysisFunctionsDataTypesOutputBody", + "ListAnalysisDataTypesOutputBody", "ListAnalysisFunctionsOutputBody", "ListAnalysisStringsOutputBody", "ListArchiveContentsOutputBody", "ListCollectionResults", "ListCollectionsOutputBody", + "ListDataTypeFunctionsBody", "ListExampleAnalysesOutputBody", + "ListFunctionSignaturesOutputBody", "ListFunctionStringsOutputBody", - "ListFunctionsDataTypesOutputBody", "ListImportedFunctionsOutputBody", "ListTeamsOutputBody", "ListUsersOutputBody", @@ -417,6 +432,8 @@ "PcapBodyInfo", "Permissions", "Platform", + "PointerDataType", + "PointerDefinition", "PriceOutput", "PriceSummary", "ProcessActivityEntry", @@ -441,11 +458,13 @@ "RenameAppliedEvent", "RenameInputBody", "RenameOutputBody", - "ReplacementValue", + "RenameUnnamedFunctionsResult", + "RenderedToken", "ReportAnalysisResponse", "ReportEvent", "ReportInfo", "ReportOptions", + "ResolvedEntity", "RevokeBody", "SSOProvider", "SSOProvidersOutputBody", @@ -460,6 +479,10 @@ "SendMessageRequest", "ServiceEntry", "SessionOutputBody", + "SignatureParameterEntry", + "SignatureParameterInput", + "SignatureStorageEntry", + "SignatureStorageInput", "SingleCodeCertificateModel", "SingleCodeSignatureModel", "SinglePDBEntryModel", @@ -483,12 +506,12 @@ "SseEventToolCallResultData", "SseEventToolCallStartData", "SseEventToolConfirmationRequiredData", - "StackVariable", "StartBatchMatchingInputBody", "StartMatchingForAnalysisInputBody", "StartMatchingForFunctionsInputBody", "StartMatchingOutputBody", "StartupInfo", + "StatusBody", "StatusInput", "StatusOutput", "StatusResponse", @@ -496,8 +519,8 @@ "StreamEvents200ResponseInner", "StringFunctions", "StringSource", - "Structure", - "StructureMember", + "StructDataType", + "StructDefinition", "SubmitUserFeedbackRequest", "SummaryData", "Symbols", @@ -513,21 +536,38 @@ "Team", "TeamMember", "TimestampModel", + "Token", "TokenInputBody", "TokenResponse", "TokenisedData", "TriageFunctionResponse", "TriageReportResponse", "TriggerDynamicExecutionInputBody", + "TriggerRenameUnnamedFunctionsInputBody", "Ttp", - "TypeDefinition", - "UpdateDataTypesInputBody", - "UpdateDataTypesOutputBody", + "TypedefDataType", + "TypedefDefinition", + "UnionDataType", + "UnionDefinition", + "UnknownDataType", + "UpdateAnalysisDataTypesInputBody", + "UpdateArrayDataType", + "UpdateBaseDataType", + "UpdateBitfieldDataType", + "UpdateDataTypeEntry", + "UpdateEnumDataType", + "UpdateFunctionDataType", + "UpdateFunctionSignatureInputBody", "UpdateIssuerInputBody", "UpdateOrganisationInputBody", "UpdatePasswordInputBody", + "UpdatePointerDataType", "UpdateProfileInputBody", + "UpdateStructDataType", "UpdateTeamInputBody", + "UpdateTypedefDataType", + "UpdateUnionDataType", + "UpdateUnknownDataType", "UpdateUserCreditsInputBody", "UpdateUserInputBody", "UpdateUserPasswordInputBody", @@ -541,10 +581,6 @@ "UserCredits", "UserIdentity", "UserProfile", - "V2FunctionHeader", - "V2FunctionInfo", - "V2FunctionInfoFuncDepsInner", - "V2FunctionType", "WarningEvent", "WorkflowProgress", "Workspace", @@ -565,11 +601,11 @@ from revengai.api.collections_api import CollectionsApi as CollectionsApi from revengai.api.config_api import ConfigApi as ConfigApi from revengai.api.conversations_api import ConversationsApi as ConversationsApi +from revengai.api.data_types_api import DataTypesApi as DataTypesApi from revengai.api.external_sources_api import ExternalSourcesApi as ExternalSourcesApi from revengai.api.firmware_api import FirmwareApi as FirmwareApi from revengai.api.functions_ai_decompilation_api import FunctionsAIDecompilationApi as FunctionsAIDecompilationApi from revengai.api.functions_core_api import FunctionsCoreApi as FunctionsCoreApi -from revengai.api.functions_data_types_api import FunctionsDataTypesApi as FunctionsDataTypesApi from revengai.api.functions_renaming_history_api import FunctionsRenamingHistoryApi as FunctionsRenamingHistoryApi from revengai.api.iam_users_api import IAMUsersApi as IAMUsersApi from revengai.api.models_api import ModelsApi as ModelsApi @@ -588,9 +624,6 @@ from revengai.exceptions import ApiException as ApiException # import models into sdk package -from revengai.models.ai_decomp_function_mapping import AIDecompFunctionMapping as AIDecompFunctionMapping -from revengai.models.ai_decomp_inverse_function_map_item import AIDecompInverseFunctionMapItem as AIDecompInverseFunctionMapItem -from revengai.models.ai_decomp_inverse_string_map_item import AIDecompInverseStringMapItem as AIDecompInverseStringMapItem from revengai.models.api_error import APIError as APIError from revengai.models.add_callee_input_body import AddCalleeInputBody as AddCalleeInputBody from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody as AddCollectionBinariesInputBody @@ -610,11 +643,14 @@ from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot as AnalysisConfigSnapshot from revengai.models.analysis_create_request import AnalysisCreateRequest as AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse as AnalysisCreateResponse +from revengai.models.analysis_data_types_group import AnalysisDataTypesGroup as AnalysisDataTypesGroup +from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody as AnalysisDataTypesOutputBody from revengai.models.analysis_detail_response import AnalysisDetailResponse as AnalysisDetailResponse from revengai.models.analysis_function_entry import AnalysisFunctionEntry as AnalysisFunctionEntry from revengai.models.analysis_function_mapping import AnalysisFunctionMapping as AnalysisFunctionMapping from revengai.models.analysis_functions import AnalysisFunctions as AnalysisFunctions from revengai.models.analysis_functions_list import AnalysisFunctionsList as AnalysisFunctionsList +from revengai.models.analysis_log_entry import AnalysisLogEntry as AnalysisLogEntry from revengai.models.analysis_log_message import AnalysisLogMessage as AnalysisLogMessage from revengai.models.analysis_logs import AnalysisLogs as AnalysisLogs from revengai.models.analysis_record import AnalysisRecord as AnalysisRecord @@ -639,12 +675,14 @@ 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.archive_content_entry import ArchiveContentEntry as ArchiveContentEntry -from revengai.models.argument import Argument as Argument +from revengai.models.array_data_type import ArrayDataType as ArrayDataType +from revengai.models.array_definition import ArrayDefinition as ArrayDefinition from revengai.models.artifact import Artifact as Artifact 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_status_output_body import AutoUnstripStatusOutputBody as AutoUnstripStatusOutputBody +from revengai.models.base_data_type import BaseDataType as BaseDataType from revengai.models.base_response import BaseResponse as BaseResponse from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse as BaseResponseAdditionalDetailsStatusResponse from revengai.models.base_response_analysis_bulk_add_tags_response import BaseResponseAnalysisBulkAddTagsResponse as BaseResponseAnalysisBulkAddTagsResponse @@ -679,13 +717,9 @@ from revengai.models.base_response_external_response import BaseResponseExternalResponse as BaseResponseExternalResponse from revengai.models.base_response_function_blocks_response import BaseResponseFunctionBlocksResponse as BaseResponseFunctionBlocksResponse from revengai.models.base_response_function_capability_response import BaseResponseFunctionCapabilityResponse as BaseResponseFunctionCapabilityResponse -from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes as BaseResponseFunctionDataTypes -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList as BaseResponseFunctionDataTypesList from revengai.models.base_response_function_search_response import BaseResponseFunctionSearchResponse as BaseResponseFunctionSearchResponse from revengai.models.base_response_function_strings_response import BaseResponseFunctionStringsResponse as BaseResponseFunctionStringsResponse from revengai.models.base_response_functions_detail_response import BaseResponseFunctionsDetailResponse as BaseResponseFunctionsDetailResponse -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_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 @@ -711,14 +745,11 @@ from revengai.models.base_response_xref_response import BaseResponseXrefResponse as BaseResponseXrefResponse from revengai.models.basic import Basic as Basic from revengai.models.batch_binary_match_result import BatchBinaryMatchResult as BatchBinaryMatchResult +from revengai.models.batch_function_signature_entry import BatchFunctionSignatureEntry as BatchFunctionSignatureEntry from revengai.models.batch_matching_output_body import BatchMatchingOutputBody as BatchMatchingOutputBody from revengai.models.batch_rename_input_body import BatchRenameInputBody as BatchRenameInputBody from revengai.models.batch_rename_item import BatchRenameItem as BatchRenameItem from revengai.models.batch_rename_output_body import BatchRenameOutputBody as BatchRenameOutputBody -from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody as BatchUpdateDataTypesInputBody -from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem as BatchUpdateDataTypesItem -from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody as BatchUpdateDataTypesOutputBody -from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult as BatchUpdateDataTypesResult from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse as BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus as BinariesTaskStatus from revengai.models.binary import Binary as Binary @@ -730,6 +761,7 @@ from revengai.models.binary_search_response import BinarySearchResponse as BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult as BinarySearchResult from revengai.models.binary_task_status import BinaryTaskStatus as BinaryTaskStatus +from revengai.models.bitfield_data_type import BitfieldDataType as BitfieldDataType from revengai.models.bulk_create_user_result import BulkCreateUserResult as BulkCreateUserResult from revengai.models.bulk_create_users_output_body import BulkCreateUsersOutputBody as BulkCreateUsersOutputBody from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest as BulkDeleteAnalysesRequest @@ -773,20 +805,40 @@ from revengai.models.conversation import Conversation as Conversation from revengai.models.conversation_context import ConversationContext as ConversationContext from revengai.models.conversation_with_events import ConversationWithEvents as ConversationWithEvents +from revengai.models.copy_function_signatures_input_body import CopyFunctionSignaturesInputBody as CopyFunctionSignaturesInputBody +from revengai.models.copy_function_signatures_output_body import CopyFunctionSignaturesOutputBody as CopyFunctionSignaturesOutputBody +from revengai.models.copy_signature_item import CopySignatureItem as CopySignatureItem from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody as CreateAIDecompOutputBody +from revengai.models.create_analysis_data_types_input_body import CreateAnalysisDataTypesInputBody as CreateAnalysisDataTypesInputBody +from revengai.models.create_array_data_type import CreateArrayDataType as CreateArrayDataType +from revengai.models.create_base_data_type import CreateBaseDataType as CreateBaseDataType +from revengai.models.create_bitfield_data_type import CreateBitfieldDataType as CreateBitfieldDataType from revengai.models.create_checkout_session_input_body import CreateCheckoutSessionInputBody as CreateCheckoutSessionInputBody from revengai.models.create_collection_input_body import CreateCollectionInputBody as CreateCollectionInputBody from revengai.models.create_collection_output_body import CreateCollectionOutputBody as CreateCollectionOutputBody from revengai.models.create_conversation_request import CreateConversationRequest as CreateConversationRequest +from revengai.models.create_data_type_entry import CreateDataTypeEntry as CreateDataTypeEntry +from revengai.models.create_enum_data_type import CreateEnumDataType as CreateEnumDataType +from revengai.models.create_function_data_type import CreateFunctionDataType as CreateFunctionDataType from revengai.models.create_group_input_body import CreateGroupInputBody as CreateGroupInputBody from revengai.models.create_identity_input_body import CreateIdentityInputBody as CreateIdentityInputBody from revengai.models.create_issuer_input_body import CreateIssuerInputBody as CreateIssuerInputBody from revengai.models.create_organisation_input_body import CreateOrganisationInputBody as CreateOrganisationInputBody +from revengai.models.create_pointer_data_type import CreatePointerDataType as CreatePointerDataType from revengai.models.create_portal_session_input_body import CreatePortalSessionInputBody as CreatePortalSessionInputBody +from revengai.models.create_struct_data_type import CreateStructDataType as CreateStructDataType from revengai.models.create_team_input_body import CreateTeamInputBody as CreateTeamInputBody +from revengai.models.create_typedef_data_type import CreateTypedefDataType as CreateTypedefDataType +from revengai.models.create_union_data_type import CreateUnionDataType as CreateUnionDataType +from revengai.models.create_unknown_data_type import CreateUnknownDataType as CreateUnknownDataType from revengai.models.create_user_input_body import CreateUserInputBody as CreateUserInputBody from revengai.models.created import Created as Created -from revengai.models.data_types_entry import DataTypesEntry as DataTypesEntry +from revengai.models.data_type_entry import DataTypeEntry as DataTypeEntry +from revengai.models.data_type_enum_value_entry import DataTypeEnumValueEntry as DataTypeEnumValueEntry +from revengai.models.data_type_function_entry import DataTypeFunctionEntry as DataTypeFunctionEntry +from revengai.models.data_type_function_parameter_entry import DataTypeFunctionParameterEntry as DataTypeFunctionParameterEntry +from revengai.models.data_type_member_entry import DataTypeMemberEntry as DataTypeMemberEntry +from revengai.models.data_type_version import DataTypeVersion as DataTypeVersion 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 @@ -806,7 +858,8 @@ from revengai.models.elf_symbol import ELFSymbol as ELFSymbol from revengai.models.elf_dynamic_entry import ElfDynamicEntry as ElfDynamicEntry from revengai.models.entrypoint_model import EntrypointModel as EntrypointModel -from revengai.models.enumeration import Enumeration as Enumeration +from revengai.models.enum_data_type import EnumDataType as EnumDataType +from revengai.models.enum_definition import EnumDefinition as EnumDefinition 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 @@ -846,22 +899,14 @@ from revengai.models.file_metadata import FileMetadata as FileMetadata from revengai.models.filters import Filters as Filters from revengai.models.form_file import FormFile as FormFile -from revengai.models.function_argument import FunctionArgument as FunctionArgument from revengai.models.function_block_destination_response import FunctionBlockDestinationResponse as FunctionBlockDestinationResponse from revengai.models.function_block_response import FunctionBlockResponse as FunctionBlockResponse from revengai.models.function_blocks_response import FunctionBlocksResponse as FunctionBlocksResponse from revengai.models.function_boundary import FunctionBoundary as FunctionBoundary from revengai.models.function_call_edges import FunctionCallEdges as FunctionCallEdges from revengai.models.function_capability_response import FunctionCapabilityResponse as FunctionCapabilityResponse -from revengai.models.function_data_types import FunctionDataTypes as FunctionDataTypes -from revengai.models.function_data_types_list import FunctionDataTypesList as FunctionDataTypesList -from revengai.models.function_data_types_list_item import FunctionDataTypesListItem as FunctionDataTypesListItem -from revengai.models.function_data_types_params import FunctionDataTypesParams as FunctionDataTypesParams -from revengai.models.function_data_types_status import FunctionDataTypesStatus as FunctionDataTypesStatus -from revengai.models.function_dependency import FunctionDependency as FunctionDependency +from revengai.models.function_data_type import FunctionDataType as FunctionDataType from revengai.models.function_details_output_body import FunctionDetailsOutputBody as FunctionDetailsOutputBody -from revengai.models.function_header import FunctionHeader as FunctionHeader -from revengai.models.function_info import FunctionInfo as FunctionInfo from revengai.models.function_list_item import FunctionListItem as FunctionListItem from revengai.models.function_local_variable_response import FunctionLocalVariableResponse as FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping as FunctionMapping @@ -872,28 +917,32 @@ from revengai.models.function_rename_map import FunctionRenameMap as FunctionRenameMap from revengai.models.function_search_response import FunctionSearchResponse as FunctionSearchResponse from revengai.models.function_search_result import FunctionSearchResult as FunctionSearchResult +from revengai.models.function_signature_body import FunctionSignatureBody as FunctionSignatureBody +from revengai.models.function_signature_entry import FunctionSignatureEntry as FunctionSignatureEntry +from revengai.models.function_signature_version import FunctionSignatureVersion as FunctionSignatureVersion from revengai.models.function_source_type import FunctionSourceType as FunctionSourceType -from revengai.models.function_stack_variable import FunctionStackVariable as FunctionStackVariable from revengai.models.function_string import FunctionString as FunctionString from revengai.models.function_string_item import FunctionStringItem as FunctionStringItem from revengai.models.function_strings_response import FunctionStringsResponse as FunctionStringsResponse -from revengai.models.function_type import FunctionType as FunctionType +from revengai.models.function_type_definition import FunctionTypeDefinition as FunctionTypeDefinition from revengai.models.functions_detail_response import FunctionsDetailResponse as FunctionsDetailResponse from revengai.models.functions_list_rename import FunctionsListRename as FunctionsListRename -from revengai.models.generate_function_data_types import GenerateFunctionDataTypes as GenerateFunctionDataTypes from revengai.models.generate_pdf_output_body import GeneratePDFOutputBody as GeneratePDFOutputBody -from revengai.models.generation_status_list import GenerationStatusList as GenerationStatusList from revengai.models.get_additional_details_output_body import GetAdditionalDetailsOutputBody as GetAdditionalDetailsOutputBody from revengai.models.get_additional_details_status_output_body import GetAdditionalDetailsStatusOutputBody as GetAdditionalDetailsStatusOutputBody from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse as GetAiDecompilationRatingResponse +from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody as GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody as GetAnalysisStringsStatusOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody as GetCollectionOutputBody +from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody as GetDataTypeHistoryBody +from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody as GetFunctionSignatureHistoryBody from revengai.models.get_matches_output_body import GetMatchesOutputBody as GetMatchesOutputBody from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody as GetMatchesStatusOutputBody from revengai.models.get_products_output_body import GetProductsOutputBody as GetProductsOutputBody from revengai.models.get_public_user_response import GetPublicUserResponse as GetPublicUserResponse from revengai.models.get_subscription_output_body import GetSubscriptionOutputBody as GetSubscriptionOutputBody -from revengai.models.global_variable import GlobalVariable as GlobalVariable +from revengai.models.get_tokens_response import GetTokensResponse as GetTokensResponse +from revengai.models.history_actor import HistoryActor as HistoryActor from revengai.models.history_entry import HistoryEntry as HistoryEntry from revengai.models.http_request import HttpRequest as HttpRequest from revengai.models.ioc import IOC as IOC @@ -909,16 +958,18 @@ from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest as InsertAnalysisLogRequest from revengai.models.invite_user_input_body import InviteUserInputBody as InviteUserInputBody from revengai.models.issuer_allowed_domain import IssuerAllowedDomain as IssuerAllowedDomain +from revengai.models.line_attributions_data import LineAttributionsData as LineAttributionsData from revengai.models.list_analyses_output_body import ListAnalysesOutputBody as ListAnalysesOutputBody -from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody as ListAnalysisFunctionsDataTypesOutputBody +from revengai.models.list_analysis_data_types_output_body import ListAnalysisDataTypesOutputBody as ListAnalysisDataTypesOutputBody from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody as ListAnalysisFunctionsOutputBody from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody as ListAnalysisStringsOutputBody from revengai.models.list_archive_contents_output_body import ListArchiveContentsOutputBody as ListArchiveContentsOutputBody from revengai.models.list_collection_results import ListCollectionResults as ListCollectionResults from revengai.models.list_collections_output_body import ListCollectionsOutputBody as ListCollectionsOutputBody +from revengai.models.list_data_type_functions_body import ListDataTypeFunctionsBody as ListDataTypeFunctionsBody from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody as ListExampleAnalysesOutputBody +from revengai.models.list_function_signatures_output_body import ListFunctionSignaturesOutputBody as ListFunctionSignaturesOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody as ListFunctionStringsOutputBody -from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody as ListFunctionsDataTypesOutputBody from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody as ListImportedFunctionsOutputBody from revengai.models.list_teams_output_body import ListTeamsOutputBody as ListTeamsOutputBody from revengai.models.list_users_output_body import ListUsersOutputBody as ListUsersOutputBody @@ -958,6 +1009,8 @@ from revengai.models.pcap_body_info import PcapBodyInfo as PcapBodyInfo from revengai.models.permissions import Permissions as Permissions from revengai.models.platform import Platform as Platform +from revengai.models.pointer_data_type import PointerDataType as PointerDataType +from revengai.models.pointer_definition import PointerDefinition as PointerDefinition from revengai.models.price_output import PriceOutput as PriceOutput from revengai.models.price_summary import PriceSummary as PriceSummary from revengai.models.process_activity_entry import ProcessActivityEntry as ProcessActivityEntry @@ -982,11 +1035,13 @@ 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 +from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult as RenameUnnamedFunctionsResult +from revengai.models.rendered_token import RenderedToken as RenderedToken from revengai.models.report_analysis_response import ReportAnalysisResponse as ReportAnalysisResponse from revengai.models.report_event import ReportEvent as ReportEvent from revengai.models.report_info import ReportInfo as ReportInfo from revengai.models.report_options import ReportOptions as ReportOptions +from revengai.models.resolved_entity import ResolvedEntity as ResolvedEntity from revengai.models.revoke_body import RevokeBody as RevokeBody from revengai.models.sso_provider import SSOProvider as SSOProvider from revengai.models.sso_providers_output_body import SSOProvidersOutputBody as SSOProvidersOutputBody @@ -1001,6 +1056,10 @@ from revengai.models.send_message_request import SendMessageRequest as SendMessageRequest from revengai.models.service_entry import ServiceEntry as ServiceEntry from revengai.models.session_output_body import SessionOutputBody as SessionOutputBody +from revengai.models.signature_parameter_entry import SignatureParameterEntry as SignatureParameterEntry +from revengai.models.signature_parameter_input import SignatureParameterInput as SignatureParameterInput +from revengai.models.signature_storage_entry import SignatureStorageEntry as SignatureStorageEntry +from revengai.models.signature_storage_input import SignatureStorageInput as SignatureStorageInput from revengai.models.single_code_certificate_model import SingleCodeCertificateModel as SingleCodeCertificateModel from revengai.models.single_code_signature_model import SingleCodeSignatureModel as SingleCodeSignatureModel from revengai.models.single_pdb_entry_model import SinglePDBEntryModel as SinglePDBEntryModel @@ -1024,12 +1083,12 @@ from revengai.models.sse_event_tool_call_result_data import SseEventToolCallResultData as SseEventToolCallResultData from revengai.models.sse_event_tool_call_start_data import SseEventToolCallStartData as SseEventToolCallStartData from revengai.models.sse_event_tool_confirmation_required_data import SseEventToolConfirmationRequiredData as SseEventToolConfirmationRequiredData -from revengai.models.stack_variable import StackVariable as StackVariable from revengai.models.start_batch_matching_input_body import StartBatchMatchingInputBody as StartBatchMatchingInputBody from revengai.models.start_matching_for_analysis_input_body import StartMatchingForAnalysisInputBody as StartMatchingForAnalysisInputBody from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody as StartMatchingForFunctionsInputBody from revengai.models.start_matching_output_body import StartMatchingOutputBody as StartMatchingOutputBody from revengai.models.startup_info import StartupInfo as StartupInfo +from revengai.models.status_body import StatusBody as StatusBody 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 @@ -1037,8 +1096,8 @@ 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 -from revengai.models.structure import Structure as Structure -from revengai.models.structure_member import StructureMember as StructureMember +from revengai.models.struct_data_type import StructDataType as StructDataType +from revengai.models.struct_definition import StructDefinition as StructDefinition from revengai.models.submit_user_feedback_request import SubmitUserFeedbackRequest as SubmitUserFeedbackRequest from revengai.models.summary_data import SummaryData as SummaryData from revengai.models.symbols import Symbols as Symbols @@ -1054,21 +1113,38 @@ from revengai.models.team import Team as Team from revengai.models.team_member import TeamMember as TeamMember from revengai.models.timestamp_model import TimestampModel as TimestampModel +from revengai.models.token import Token as Token from revengai.models.token_input_body import TokenInputBody as TokenInputBody from revengai.models.token_response import TokenResponse as TokenResponse from revengai.models.tokenised_data import TokenisedData as TokenisedData from revengai.models.triage_function_response import TriageFunctionResponse as TriageFunctionResponse from revengai.models.triage_report_response import TriageReportResponse as TriageReportResponse from revengai.models.trigger_dynamic_execution_input_body import TriggerDynamicExecutionInputBody as TriggerDynamicExecutionInputBody +from revengai.models.trigger_rename_unnamed_functions_input_body import TriggerRenameUnnamedFunctionsInputBody as TriggerRenameUnnamedFunctionsInputBody from revengai.models.ttp import Ttp as Ttp -from revengai.models.type_definition import TypeDefinition as TypeDefinition -from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody as UpdateDataTypesInputBody -from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody as UpdateDataTypesOutputBody +from revengai.models.typedef_data_type import TypedefDataType as TypedefDataType +from revengai.models.typedef_definition import TypedefDefinition as TypedefDefinition +from revengai.models.union_data_type import UnionDataType as UnionDataType +from revengai.models.union_definition import UnionDefinition as UnionDefinition +from revengai.models.unknown_data_type import UnknownDataType as UnknownDataType +from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody as UpdateAnalysisDataTypesInputBody +from revengai.models.update_array_data_type import UpdateArrayDataType as UpdateArrayDataType +from revengai.models.update_base_data_type import UpdateBaseDataType as UpdateBaseDataType +from revengai.models.update_bitfield_data_type import UpdateBitfieldDataType as UpdateBitfieldDataType +from revengai.models.update_data_type_entry import UpdateDataTypeEntry as UpdateDataTypeEntry +from revengai.models.update_enum_data_type import UpdateEnumDataType as UpdateEnumDataType +from revengai.models.update_function_data_type import UpdateFunctionDataType as UpdateFunctionDataType +from revengai.models.update_function_signature_input_body import UpdateFunctionSignatureInputBody as UpdateFunctionSignatureInputBody from revengai.models.update_issuer_input_body import UpdateIssuerInputBody as UpdateIssuerInputBody from revengai.models.update_organisation_input_body import UpdateOrganisationInputBody as UpdateOrganisationInputBody from revengai.models.update_password_input_body import UpdatePasswordInputBody as UpdatePasswordInputBody +from revengai.models.update_pointer_data_type import UpdatePointerDataType as UpdatePointerDataType from revengai.models.update_profile_input_body import UpdateProfileInputBody as UpdateProfileInputBody +from revengai.models.update_struct_data_type import UpdateStructDataType as UpdateStructDataType from revengai.models.update_team_input_body import UpdateTeamInputBody as UpdateTeamInputBody +from revengai.models.update_typedef_data_type import UpdateTypedefDataType as UpdateTypedefDataType +from revengai.models.update_union_data_type import UpdateUnionDataType as UpdateUnionDataType +from revengai.models.update_unknown_data_type import UpdateUnknownDataType as UpdateUnknownDataType from revengai.models.update_user_credits_input_body import UpdateUserCreditsInputBody as UpdateUserCreditsInputBody from revengai.models.update_user_input_body import UpdateUserInputBody as UpdateUserInputBody from revengai.models.update_user_password_input_body import UpdateUserPasswordInputBody as UpdateUserPasswordInputBody @@ -1082,10 +1158,6 @@ from revengai.models.user_credits import UserCredits as UserCredits from revengai.models.user_identity import UserIdentity as UserIdentity from revengai.models.user_profile import UserProfile as UserProfile -from revengai.models.v2_function_header import V2FunctionHeader as V2FunctionHeader -from revengai.models.v2_function_info import V2FunctionInfo as V2FunctionInfo -from revengai.models.v2_function_info_func_deps_inner import V2FunctionInfoFuncDepsInner as V2FunctionInfoFuncDepsInner -from revengai.models.v2_function_type import V2FunctionType as V2FunctionType 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 diff --git a/revengai/api/__init__.py b/revengai/api/__init__.py index 548ecbd0..a8178527 100644 --- a/revengai/api/__init__.py +++ b/revengai/api/__init__.py @@ -12,11 +12,11 @@ from revengai.api.collections_api import CollectionsApi from revengai.api.config_api import ConfigApi from revengai.api.conversations_api import ConversationsApi +from revengai.api.data_types_api import DataTypesApi from revengai.api.external_sources_api import ExternalSourcesApi from revengai.api.firmware_api import FirmwareApi from revengai.api.functions_ai_decompilation_api import FunctionsAIDecompilationApi from revengai.api.functions_core_api import FunctionsCoreApi -from revengai.api.functions_data_types_api import FunctionsDataTypesApi from revengai.api.functions_renaming_history_api import FunctionsRenamingHistoryApi from revengai.api.iam_users_api import IAMUsersApi from revengai.api.models_api import ModelsApi diff --git a/revengai/api/agent_api.py b/revengai/api/agent_api.py index 9f1f2f3b..7dc10024 100644 --- a/revengai/api/agent_api.py +++ b/revengai/api/agent_api.py @@ -15,14 +15,18 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt +from pydantic import Field, StrictInt +from typing_extensions import Annotated from revengai.models.base_response_capabilities_agent_response import BaseResponseCapabilitiesAgentResponse from revengai.models.base_response_queued_workflow_task_response import BaseResponseQueuedWorkflowTaskResponse from revengai.models.base_response_remediation_agent_response import BaseResponseRemediationAgentResponse from revengai.models.base_response_report_analysis_response import BaseResponseReportAnalysisResponse from revengai.models.base_response_triage_report_response import BaseResponseTriageReportResponse from revengai.models.queued_workflow_task_response import QueuedWorkflowTaskResponse +from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult +from revengai.models.status_body import StatusBody from revengai.models.task_status_response import TaskStatusResponse +from revengai.models.trigger_rename_unnamed_functions_input_body import TriggerRenameUnnamedFunctionsInputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -3193,3 +3197,1133 @@ def _get_triage_result_v2_analyses_analysis_id_agent_triage_get_serialize( ) + + + @validate_call + def v3_cancel_rename_unnamed_functions( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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, + ) -> None: + """Cancel the rename-unnamed-functions agent. + + Requests cancellation of the currently running rename-unnamed-functions run for the analysis. Returns 404 if no run is in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + 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._v3_cancel_rename_unnamed_functions_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_cancel_rename_unnamed_functions_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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[None]: + """Cancel the rename-unnamed-functions agent. + + Requests cancellation of the currently running rename-unnamed-functions run for the analysis. Returns 404 if no run is in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + 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._v3_cancel_rename_unnamed_functions_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_cancel_rename_unnamed_functions_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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: + """Cancel the rename-unnamed-functions agent. + + Requests cancellation of the currently running rename-unnamed-functions run for the analysis. Returns 404 if no run is in progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NO_ACTIVE_RUN`](/errors/NO_ACTIVE_RUN) — No Active Run + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + 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._v3_cancel_rename_unnamed_functions_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_cancel_rename_unnamed_functions_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/analyses/{analysis_id}/agents/rename-unnamed-functions/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_rename_unnamed_functions_result( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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, + ) -> RenameUnnamedFunctionsResult: + """Get rename-unnamed-functions agent result. + + Returns the summary of the most recent completed rename-unnamed-functions run. Returns 409 while a run is still in progress and 404 when the agent has never produced a result for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + 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._v3_get_rename_unnamed_functions_result_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RenameUnnamedFunctionsResult", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_rename_unnamed_functions_result_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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[RenameUnnamedFunctionsResult]: + """Get rename-unnamed-functions agent result. + + Returns the summary of the most recent completed rename-unnamed-functions run. Returns 409 while a run is still in progress and 404 when the agent has never produced a result for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + 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._v3_get_rename_unnamed_functions_result_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RenameUnnamedFunctionsResult", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_rename_unnamed_functions_result_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get rename-unnamed-functions agent result. + + Returns the summary of the most recent completed rename-unnamed-functions run. Returns 409 while a run is still in progress and 404 when the agent has never produced a result for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + 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._v3_get_rename_unnamed_functions_result_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RenameUnnamedFunctionsResult", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_rename_unnamed_functions_result_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/agents/rename-unnamed-functions', + 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 v3_get_rename_unnamed_functions_status( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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, + ) -> StatusBody: + """Get rename-unnamed-functions agent status. + + Returns the status of the most recent rename-unnamed-functions run for the analysis. `UNINITIALISED` means the agent has never been triggered, so it is safe to start one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _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._v3_get_rename_unnamed_functions_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StatusBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_rename_unnamed_functions_status_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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[StatusBody]: + """Get rename-unnamed-functions agent status. + + Returns the status of the most recent rename-unnamed-functions run for the analysis. `UNINITIALISED` means the agent has never been triggered, so it is safe to start one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _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._v3_get_rename_unnamed_functions_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StatusBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_rename_unnamed_functions_status_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get rename-unnamed-functions agent status. + + Returns the status of the most recent rename-unnamed-functions run for the analysis. `UNINITIALISED` means the agent has never been triggered, so it is safe to start one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _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._v3_get_rename_unnamed_functions_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StatusBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_rename_unnamed_functions_status_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/agents/rename-unnamed-functions/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_trigger_rename_unnamed_functions( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + trigger_rename_unnamed_functions_input_body: TriggerRenameUnnamedFunctionsInputBody, + _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, + ) -> StatusBody: + """Run the rename-unnamed-functions agent. + + Starts an agent that renames the analysis' unnamed functions from their AI decompilations. Each function costs an AI decompilation, so a whole-analysis run can be expensive — use `limit` to bound it. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param trigger_rename_unnamed_functions_input_body: (required) + :type trigger_rename_unnamed_functions_input_body: TriggerRenameUnnamedFunctionsInputBody + :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._v3_trigger_rename_unnamed_functions_serialize( + analysis_id=analysis_id, + trigger_rename_unnamed_functions_input_body=trigger_rename_unnamed_functions_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "StatusBody", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_trigger_rename_unnamed_functions_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + trigger_rename_unnamed_functions_input_body: TriggerRenameUnnamedFunctionsInputBody, + _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[StatusBody]: + """Run the rename-unnamed-functions agent. + + Starts an agent that renames the analysis' unnamed functions from their AI decompilations. Each function costs an AI decompilation, so a whole-analysis run can be expensive — use `limit` to bound it. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param trigger_rename_unnamed_functions_input_body: (required) + :type trigger_rename_unnamed_functions_input_body: TriggerRenameUnnamedFunctionsInputBody + :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._v3_trigger_rename_unnamed_functions_serialize( + analysis_id=analysis_id, + trigger_rename_unnamed_functions_input_body=trigger_rename_unnamed_functions_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "StatusBody", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_trigger_rename_unnamed_functions_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + trigger_rename_unnamed_functions_input_body: TriggerRenameUnnamedFunctionsInputBody, + _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: + """Run the rename-unnamed-functions agent. + + Starts an agent that renames the analysis' unnamed functions from their AI decompilations. Each function costs an AI decompilation, so a whole-analysis run can be expensive — use `limit` to bound it. Returns 409 while a run is already in progress for this analysis. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param trigger_rename_unnamed_functions_input_body: (required) + :type trigger_rename_unnamed_functions_input_body: TriggerRenameUnnamedFunctionsInputBody + :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._v3_trigger_rename_unnamed_functions_serialize( + analysis_id=analysis_id, + trigger_rename_unnamed_functions_input_body=trigger_rename_unnamed_functions_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "StatusBody", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_trigger_rename_unnamed_functions_serialize( + self, + analysis_id, + trigger_rename_unnamed_functions_input_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if trigger_rename_unnamed_functions_input_body is not None: + _body_params = trigger_rename_unnamed_functions_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/analyses/{analysis_id}/agents/rename-unnamed-functions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index fac441ee..3efa719c 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -41,6 +41,7 @@ from revengai.models.base_response_upload_response import BaseResponseUploadResponse from revengai.models.dynamic_execution_status import DynamicExecutionStatus from revengai.models.dynamic_execution_status_response import DynamicExecutionStatusResponse +from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.get_matches_output_body import GetMatchesOutputBody from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody @@ -2654,7 +2655,7 @@ def get_analysis_logs( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseLogs: - """Gets the logs of an analysis + """(Deprecated) Gets the logs of an analysis Given an analysis ID gets the current logs of an analysis @@ -2681,6 +2682,7 @@ def get_analysis_logs( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/logs is deprecated.", DeprecationWarning) _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, @@ -2722,7 +2724,7 @@ def get_analysis_logs_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseLogs]: - """Gets the logs of an analysis + """(Deprecated) Gets the logs of an analysis Given an analysis ID gets the current logs of an analysis @@ -2749,6 +2751,7 @@ def get_analysis_logs_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/logs is deprecated.", DeprecationWarning) _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, @@ -2790,7 +2793,7 @@ def get_analysis_logs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the logs of an analysis + """(Deprecated) Gets the logs of an analysis Given an analysis ID gets the current logs of an analysis @@ -2817,6 +2820,7 @@ def get_analysis_logs_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/logs is deprecated.", DeprecationWarning) _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, @@ -7070,6 +7074,280 @@ def _v3_get_analysis_auto_unstrip_status_serialize( + @validate_call + def v3_get_analysis_logs( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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, + ) -> GetAnalysisLogsOutputBody: + """Get the Analysis log + + Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _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._v3_get_analysis_logs_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAnalysisLogsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_analysis_logs_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis 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[GetAnalysisLogsOutputBody]: + """Get the Analysis log + + Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _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._v3_get_analysis_logs_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAnalysisLogsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_analysis_logs_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the Analysis log + + Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _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._v3_get_analysis_logs_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAnalysisLogsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_analysis_logs_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/logs', + 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 v3_get_analysis_strings( self, diff --git a/revengai/api/collections_api.py b/revengai/api/collections_api.py index 6c469603..5fad69e4 100644 --- a/revengai/api/collections_api.py +++ b/revengai/api/collections_api.py @@ -2812,7 +2812,7 @@ def v3_delete_collection( ) -> None: """Delete a collection. - Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Deletes a collection along with its binary links, tags, and hierarchy links. The binaries themselves are not deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int @@ -2850,7 +2850,6 @@ def v3_delete_collection( '204': None, '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2884,7 +2883,7 @@ def v3_delete_collection_with_http_info( ) -> ApiResponse[None]: """Delete a collection. - Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Deletes a collection along with its binary links, tags, and hierarchy links. The binaries themselves are not deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int @@ -2922,7 +2921,6 @@ def v3_delete_collection_with_http_info( '204': None, '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2956,7 +2954,7 @@ def v3_delete_collection_without_preload_content( ) -> RESTResponseType: """Delete a collection. - Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Deletes a collection along with its binary links, tags, and hierarchy links. The binaries themselves are not deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int @@ -2994,7 +2992,6 @@ def v3_delete_collection_without_preload_content( '204': None, '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } diff --git a/revengai/api/functions_data_types_api.py b/revengai/api/data_types_api.py similarity index 55% rename from revengai/api/functions_data_types_api.py rename to revengai/api/data_types_api.py index 8f5f23e8..bcd7c85c 100644 --- a/revengai/api/functions_data_types_api.py +++ b/revengai/api/data_types_api.py @@ -15,27 +15,30 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator from typing import List, Optional from typing_extensions import Annotated -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList -from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes -from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList -from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody -from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody -from revengai.models.data_types_entry import DataTypesEntry -from revengai.models.function_data_types_params import FunctionDataTypesParams -from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody -from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody -from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody -from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody +from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody +from revengai.models.copy_function_signatures_input_body import CopyFunctionSignaturesInputBody +from revengai.models.copy_function_signatures_output_body import CopyFunctionSignaturesOutputBody +from revengai.models.create_analysis_data_types_input_body import CreateAnalysisDataTypesInputBody +from revengai.models.data_type_entry import DataTypeEntry +from revengai.models.function_signature_body import FunctionSignatureBody +from revengai.models.function_signature_entry import FunctionSignatureEntry +from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody +from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody +from revengai.models.list_analysis_data_types_output_body import ListAnalysisDataTypesOutputBody +from revengai.models.list_data_type_functions_body import ListDataTypeFunctionsBody +from revengai.models.list_function_signatures_output_body import ListFunctionSignaturesOutputBody +from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody +from revengai.models.update_function_signature_input_body import UpdateFunctionSignatureInputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse from revengai.rest import RESTResponseType -class FunctionsDataTypesApi: +class DataTypesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -49,10 +52,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def batch_update_function_data_types( + def v3_copy_function_signatures( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - batch_update_data_types_input_body: BatchUpdateDataTypesInputBody, + copy_function_signatures_input_body: CopyFunctionSignaturesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -65,15 +68,15 @@ def batch_update_function_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BatchUpdateDataTypesOutputBody: - """Batch update function data types + ) -> CopyFunctionSignaturesOutputBody: + """Copy function signatures - Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Replaces each target function's signature with a copy of its source's parameters, return type and calling convention. Every target must belong to this analysis; a source may belong to any analysis the caller can read. The whole request is rejected if any pair is invalid. A `data_type_id` means nothing outside the analysis that issued it, so the types a copied signature needs are resolved against this analysis by namespace, name and kind. A type this analysis already has under that key has its definition replaced by the source's; a type it lacks is created. Copied signatures get a `source_type` of `USER` and a `source_function_id`, and their previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int - :param batch_update_data_types_input_body: (required) - :type batch_update_data_types_input_body: BatchUpdateDataTypesInputBody + :param copy_function_signatures_input_body: (required) + :type copy_function_signatures_input_body: CopyFunctionSignaturesInputBody :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 @@ -96,9 +99,9 @@ def batch_update_function_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._batch_update_function_data_types_serialize( + _param = self._v3_copy_function_signatures_serialize( analysis_id=analysis_id, - batch_update_data_types_input_body=batch_update_data_types_input_body, + copy_function_signatures_input_body=copy_function_signatures_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -106,10 +109,625 @@ def batch_update_function_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BatchUpdateDataTypesOutputBody", + '200': "CopyFunctionSignaturesOutputBody", '400': "APIError", '403': "APIError", '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_copy_function_signatures_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + copy_function_signatures_input_body: CopyFunctionSignaturesInputBody, + _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[CopyFunctionSignaturesOutputBody]: + """Copy function signatures + + Replaces each target function's signature with a copy of its source's parameters, return type and calling convention. Every target must belong to this analysis; a source may belong to any analysis the caller can read. The whole request is rejected if any pair is invalid. A `data_type_id` means nothing outside the analysis that issued it, so the types a copied signature needs are resolved against this analysis by namespace, name and kind. A type this analysis already has under that key has its definition replaced by the source's; a type it lacks is created. Copied signatures get a `source_type` of `USER` and a `source_function_id`, and their previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param copy_function_signatures_input_body: (required) + :type copy_function_signatures_input_body: CopyFunctionSignaturesInputBody + :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._v3_copy_function_signatures_serialize( + analysis_id=analysis_id, + copy_function_signatures_input_body=copy_function_signatures_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CopyFunctionSignaturesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_copy_function_signatures_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + copy_function_signatures_input_body: CopyFunctionSignaturesInputBody, + _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: + """Copy function signatures + + Replaces each target function's signature with a copy of its source's parameters, return type and calling convention. Every target must belong to this analysis; a source may belong to any analysis the caller can read. The whole request is rejected if any pair is invalid. A `data_type_id` means nothing outside the analysis that issued it, so the types a copied signature needs are resolved against this analysis by namespace, name and kind. A type this analysis already has under that key has its definition replaced by the source's; a type it lacks is created. Copied signatures get a `source_type` of `USER` and a `source_function_id`, and their previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param copy_function_signatures_input_body: (required) + :type copy_function_signatures_input_body: CopyFunctionSignaturesInputBody + :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._v3_copy_function_signatures_serialize( + analysis_id=analysis_id, + copy_function_signatures_input_body=copy_function_signatures_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CopyFunctionSignaturesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_copy_function_signatures_serialize( + self, + analysis_id, + copy_function_signatures_input_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if copy_function_signatures_input_body is not None: + _body_params = copy_function_signatures_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/analyses/{analysis_id}/signatures/copy', + 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 v3_create_analysis_data_types( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + create_analysis_data_types_input_body: CreateAnalysisDataTypesInputBody, + _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, + ) -> AnalysisDataTypesOutputBody: + """Create an analysis's data types + + Adds user-authored types to an analysis. Many types can be created in one request; the whole request is rejected if any of them is invalid. Ids are assigned by the server and returned here. Stored types get a `source_type` of `USER`. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param create_analysis_data_types_input_body: (required) + :type create_analysis_data_types_input_body: CreateAnalysisDataTypesInputBody + :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._v3_create_analysis_data_types_serialize( + analysis_id=analysis_id, + create_analysis_data_types_input_body=create_analysis_data_types_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AnalysisDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_create_analysis_data_types_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + create_analysis_data_types_input_body: CreateAnalysisDataTypesInputBody, + _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[AnalysisDataTypesOutputBody]: + """Create an analysis's data types + + Adds user-authored types to an analysis. Many types can be created in one request; the whole request is rejected if any of them is invalid. Ids are assigned by the server and returned here. Stored types get a `source_type` of `USER`. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param create_analysis_data_types_input_body: (required) + :type create_analysis_data_types_input_body: CreateAnalysisDataTypesInputBody + :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._v3_create_analysis_data_types_serialize( + analysis_id=analysis_id, + create_analysis_data_types_input_body=create_analysis_data_types_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AnalysisDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_create_analysis_data_types_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + create_analysis_data_types_input_body: CreateAnalysisDataTypesInputBody, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an analysis's data types + + Adds user-authored types to an analysis. Many types can be created in one request; the whole request is rejected if any of them is invalid. Ids are assigned by the server and returned here. Stored types get a `source_type` of `USER`. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param create_analysis_data_types_input_body: (required) + :type create_analysis_data_types_input_body: CreateAnalysisDataTypesInputBody + :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._v3_create_analysis_data_types_serialize( + analysis_id=analysis_id, + create_analysis_data_types_input_body=create_analysis_data_types_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AnalysisDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_create_analysis_data_types_serialize( + self, + analysis_id, + create_analysis_data_types_input_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_analysis_data_types_input_body is not None: + _body_params = create_analysis_data_types_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/analyses/{analysis_id}/data-types', + 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 v3_get_analysis_data_type( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid 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, + ) -> DataTypeEntry: + """Get one of an analysis's data types + + Returns a single data type by its `data_type_id`, byte-identical to the entry the data types list returns for it — same variant, same fields, same definition — so a client can cache and invalidate rows from either endpoint interchangeably. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_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._v3_get_analysis_data_type_serialize( + analysis_id=analysis_id, + data_type_id=data_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DataTypeEntry", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -125,10 +743,10 @@ def batch_update_function_data_types( @validate_call - def batch_update_function_data_types_with_http_info( + def v3_get_analysis_data_type_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - batch_update_data_types_input_body: BatchUpdateDataTypesInputBody, + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -141,15 +759,15 @@ def batch_update_function_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BatchUpdateDataTypesOutputBody]: - """Batch update function data types + ) -> ApiResponse[DataTypeEntry]: + """Get one of an analysis's data types - Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Returns a single data type by its `data_type_id`, byte-identical to the entry the data types list returns for it — same variant, same fields, same definition — so a client can cache and invalidate rows from either endpoint interchangeably. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int - :param batch_update_data_types_input_body: (required) - :type batch_update_data_types_input_body: BatchUpdateDataTypesInputBody + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_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 @@ -172,9 +790,9 @@ def batch_update_function_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._batch_update_function_data_types_serialize( + _param = self._v3_get_analysis_data_type_serialize( analysis_id=analysis_id, - batch_update_data_types_input_body=batch_update_data_types_input_body, + data_type_id=data_type_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -182,8 +800,7 @@ def batch_update_function_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BatchUpdateDataTypesOutputBody", - '400': "APIError", + '200': "DataTypeEntry", '403': "APIError", '404': "APIError", '422': "APIError", @@ -201,10 +818,10 @@ def batch_update_function_data_types_with_http_info( @validate_call - def batch_update_function_data_types_without_preload_content( + def v3_get_analysis_data_type_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - batch_update_data_types_input_body: BatchUpdateDataTypesInputBody, + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -218,14 +835,14 @@ def batch_update_function_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Batch update function data types + """Get one of an analysis's data types - Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Returns a single data type by its `data_type_id`, byte-identical to the entry the data types list returns for it — same variant, same fields, same definition — so a client can cache and invalidate rows from either endpoint interchangeably. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int - :param batch_update_data_types_input_body: (required) - :type batch_update_data_types_input_body: BatchUpdateDataTypesInputBody + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_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 @@ -248,9 +865,9 @@ def batch_update_function_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._batch_update_function_data_types_serialize( + _param = self._v3_get_analysis_data_type_serialize( analysis_id=analysis_id, - batch_update_data_types_input_body=batch_update_data_types_input_body, + data_type_id=data_type_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -258,8 +875,7 @@ def batch_update_function_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BatchUpdateDataTypesOutputBody", - '400': "APIError", + '200': "DataTypeEntry", '403': "APIError", '404': "APIError", '422': "APIError", @@ -272,10 +888,10 @@ def batch_update_function_data_types_without_preload_content( return response_data.response - def _batch_update_function_data_types_serialize( + def _v3_get_analysis_data_type_serialize( self, analysis_id, - batch_update_data_types_input_body, + data_type_id, _request_auth, _content_type, _headers, @@ -299,12 +915,12 @@ def _batch_update_function_data_types_serialize( # process the path parameters if analysis_id is not None: _path_params['analysis_id'] = analysis_id + if data_type_id is not None: + _path_params['data_type_id'] = data_type_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if batch_update_data_types_input_body is not None: - _body_params = batch_update_data_types_input_body # set the HTTP header `Accept` @@ -315,19 +931,6 @@ def _batch_update_function_data_types_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -336,8 +939,8 @@ def _batch_update_function_data_types_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/v3/analyses/{analysis_id}/functions/data-types', + method='GET', + resource_path='/v3/analyses/{analysis_id}/data-types/{data_type_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -354,10 +957,10 @@ def _batch_update_function_data_types_serialize( @validate_call - def generate_function_data_types_for_analysis( + def v3_get_analysis_data_type_history( self, - analysis_id: StrictInt, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -370,15 +973,15 @@ def generate_function_data_types_for_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseGenerateFunctionDataTypes: - """Generate Function Data Types + ) -> GetDataTypeHistoryBody: + """Get a data type's edit history - Submits a request to generate the function data types + The versions a data type has held, newest first, each attributed to the edit that wrote it. The first value is the current value. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_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 @@ -401,9 +1004,9 @@ def generate_function_data_types_for_analysis( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_analysis_serialize( + _param = self._v3_get_analysis_data_type_history_serialize( analysis_id=analysis_id, - function_data_types_params=function_data_types_params, + data_type_id=data_type_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -411,8 +1014,11 @@ def generate_function_data_types_for_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerateFunctionDataTypes", - '422': "BaseResponse", + '200': "GetDataTypeHistoryBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -426,10 +1032,10 @@ def generate_function_data_types_for_analysis( @validate_call - def generate_function_data_types_for_analysis_with_http_info( + def v3_get_analysis_data_type_history_with_http_info( self, - analysis_id: StrictInt, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -442,15 +1048,15 @@ def generate_function_data_types_for_analysis_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseGenerateFunctionDataTypes]: - """Generate Function Data Types + ) -> ApiResponse[GetDataTypeHistoryBody]: + """Get a data type's edit history - Submits a request to generate the function data types + The versions a data type has held, newest first, each attributed to the edit that wrote it. The first value is the current value. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_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 @@ -473,9 +1079,9 @@ def generate_function_data_types_for_analysis_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_analysis_serialize( + _param = self._v3_get_analysis_data_type_history_serialize( analysis_id=analysis_id, - function_data_types_params=function_data_types_params, + data_type_id=data_type_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -483,8 +1089,11 @@ def generate_function_data_types_for_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerateFunctionDataTypes", - '422': "BaseResponse", + '200': "GetDataTypeHistoryBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -498,10 +1107,10 @@ def generate_function_data_types_for_analysis_with_http_info( @validate_call - def generate_function_data_types_for_analysis_without_preload_content( + def v3_get_analysis_data_type_history_without_preload_content( self, - analysis_id: StrictInt, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -515,14 +1124,14 @@ def generate_function_data_types_for_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Generate Function Data Types + """Get a data type's edit history - Submits a request to generate the function data types + The versions a data type has held, newest first, each attributed to the edit that wrote it. The first value is the current value. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_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 @@ -545,9 +1154,9 @@ def generate_function_data_types_for_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_analysis_serialize( + _param = self._v3_get_analysis_data_type_history_serialize( analysis_id=analysis_id, - function_data_types_params=function_data_types_params, + data_type_id=data_type_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -555,8 +1164,11 @@ def generate_function_data_types_for_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerateFunctionDataTypes", - '422': "BaseResponse", + '200': "GetDataTypeHistoryBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -565,10 +1177,10 @@ def generate_function_data_types_for_analysis_without_preload_content( return response_data.response - def _generate_function_data_types_for_analysis_serialize( + def _v3_get_analysis_data_type_history_serialize( self, analysis_id, - function_data_types_params, + data_type_id, _request_auth, _content_type, _headers, @@ -592,12 +1204,12 @@ def _generate_function_data_types_for_analysis_serialize( # process the path parameters if analysis_id is not None: _path_params['analysis_id'] = analysis_id + if data_type_id is not None: + _path_params['data_type_id'] = data_type_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if function_data_types_params is not None: - _body_params = function_data_types_params # set the HTTP header `Accept` @@ -608,19 +1220,6 @@ def _generate_function_data_types_for_analysis_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -629,8 +1228,8 @@ def _generate_function_data_types_for_analysis_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/analyses/{analysis_id}/functions/data_types', + method='GET', + resource_path='/v3/analyses/{analysis_id}/data-types/{data_type_id}/history', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -647,9 +1246,11 @@ def _generate_function_data_types_for_analysis_serialize( @validate_call - def generate_function_data_types_for_functions( + def v3_get_function_signature( self, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + include_data_types: Annotated[Optional[StrictBool], Field(description="Include the data types the signature names in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -662,13 +1263,17 @@ def generate_function_data_types_for_functions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseGenerationStatusList: - """Generate Function Data Types for an arbitrary list of functions + ) -> FunctionSignatureBody: + """Get a function's signature - Submits a request to generate the function data types + Returns the extracted signature for one function: its parameters, return type and calling convention. Pass `include_data_types=true` to also get the data types it names. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param function_id: Function ID (required) + :type function_id: int + :param include_data_types: Include the data types the signature names in the response. + :type include_data_types: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -691,8 +1296,10 @@ def generate_function_data_types_for_functions( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_functions_serialize( - function_data_types_params=function_data_types_params, + _param = self._v3_get_function_signature_serialize( + analysis_id=analysis_id, + function_id=function_id, + include_data_types=include_data_types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -700,8 +1307,11 @@ def generate_function_data_types_for_functions( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerationStatusList", - '422': "BaseResponse", + '200': "FunctionSignatureBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -715,9 +1325,11 @@ def generate_function_data_types_for_functions( @validate_call - def generate_function_data_types_for_functions_with_http_info( + def v3_get_function_signature_with_http_info( self, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + include_data_types: Annotated[Optional[StrictBool], Field(description="Include the data types the signature names in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -730,13 +1342,17 @@ def generate_function_data_types_for_functions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseGenerationStatusList]: - """Generate Function Data Types for an arbitrary list of functions + ) -> ApiResponse[FunctionSignatureBody]: + """Get a function's signature - Submits a request to generate the function data types + Returns the extracted signature for one function: its parameters, return type and calling convention. Pass `include_data_types=true` to also get the data types it names. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param function_id: Function ID (required) + :type function_id: int + :param include_data_types: Include the data types the signature names in the response. + :type include_data_types: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -759,8 +1375,10 @@ def generate_function_data_types_for_functions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_functions_serialize( - function_data_types_params=function_data_types_params, + _param = self._v3_get_function_signature_serialize( + analysis_id=analysis_id, + function_id=function_id, + include_data_types=include_data_types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -768,8 +1386,11 @@ def generate_function_data_types_for_functions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerationStatusList", - '422': "BaseResponse", + '200': "FunctionSignatureBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -783,9 +1404,11 @@ def generate_function_data_types_for_functions_with_http_info( @validate_call - def generate_function_data_types_for_functions_without_preload_content( + def v3_get_function_signature_without_preload_content( self, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + include_data_types: Annotated[Optional[StrictBool], Field(description="Include the data types the signature names in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -799,12 +1422,16 @@ def generate_function_data_types_for_functions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Generate Function Data Types for an arbitrary list of functions + """Get a function's signature - Submits a request to generate the function data types + Returns the extracted signature for one function: its parameters, return type and calling convention. Pass `include_data_types=true` to also get the data types it names. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param function_id: Function ID (required) + :type function_id: int + :param include_data_types: Include the data types the signature names in the response. + :type include_data_types: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -827,8 +1454,10 @@ def generate_function_data_types_for_functions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_functions_serialize( - function_data_types_params=function_data_types_params, + _param = self._v3_get_function_signature_serialize( + analysis_id=analysis_id, + function_id=function_id, + include_data_types=include_data_types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -836,8 +1465,11 @@ def generate_function_data_types_for_functions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerationStatusList", - '422': "BaseResponse", + '200': "FunctionSignatureBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -846,9 +1478,11 @@ def generate_function_data_types_for_functions_without_preload_content( return response_data.response - def _generate_function_data_types_for_functions_serialize( + def _v3_get_function_signature_serialize( self, - function_data_types_params, + analysis_id, + function_id, + include_data_types, _request_auth, _content_type, _headers, @@ -870,12 +1504,18 @@ def _generate_function_data_types_for_functions_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters + if include_data_types is not None: + + _query_params.append(('include_data_types', include_data_types)) + # process the header parameters # process the form parameters # process the body parameter - if function_data_types_params is not None: - _body_params = function_data_types_params # set the HTTP header `Accept` @@ -886,19 +1526,6 @@ def _generate_function_data_types_for_functions_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -907,8 +1534,8 @@ def _generate_function_data_types_for_functions_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/functions/data_types', + method='GET', + resource_path='/v3/analyses/{analysis_id}/functions/{function_id}/signature', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -925,7 +1552,7 @@ def _generate_function_data_types_for_functions_serialize( @validate_call - def get_function_data_types( + def v3_get_function_signature_history( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], @@ -941,10 +1568,10 @@ def get_function_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DataTypesEntry: - """Get data types for a single function + ) -> GetFunctionSignatureHistoryBody: + """Get a function signature's edit history - Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + The versions a function's signature has held, newest first, each attributed to the edit that wrote it. The first value is the current value. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -972,7 +1599,7 @@ def get_function_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_data_types_serialize( + _param = self._v3_get_function_signature_history_serialize( analysis_id=analysis_id, function_id=function_id, _request_auth=_request_auth, @@ -982,7 +1609,7 @@ def get_function_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DataTypesEntry", + '200': "GetFunctionSignatureHistoryBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -1000,7 +1627,7 @@ def get_function_data_types( @validate_call - def get_function_data_types_with_http_info( + def v3_get_function_signature_history_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], @@ -1016,10 +1643,10 @@ def get_function_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DataTypesEntry]: - """Get data types for a single function + ) -> ApiResponse[GetFunctionSignatureHistoryBody]: + """Get a function signature's edit history - Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + The versions a function's signature has held, newest first, each attributed to the edit that wrote it. The first value is the current value. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -1047,7 +1674,7 @@ def get_function_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_data_types_serialize( + _param = self._v3_get_function_signature_history_serialize( analysis_id=analysis_id, function_id=function_id, _request_auth=_request_auth, @@ -1057,7 +1684,7 @@ def get_function_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DataTypesEntry", + '200': "GetFunctionSignatureHistoryBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -1075,7 +1702,7 @@ def get_function_data_types_with_http_info( @validate_call - def get_function_data_types_without_preload_content( + def v3_get_function_signature_history_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], @@ -1092,9 +1719,9 @@ def get_function_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get data types for a single function + """Get a function signature's edit history - Returns the stored data-types blob for one function. The function must belong to the supplied analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + The versions a function's signature has held, newest first, each attributed to the edit that wrote it. The first value is the current value. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -1122,7 +1749,7 @@ def get_function_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_data_types_serialize( + _param = self._v3_get_function_signature_history_serialize( analysis_id=analysis_id, function_id=function_id, _request_auth=_request_auth, @@ -1132,7 +1759,7 @@ def get_function_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DataTypesEntry", + '200': "GetFunctionSignatureHistoryBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -1145,7 +1772,7 @@ def get_function_data_types_without_preload_content( return response_data.response - def _get_function_data_types_serialize( + def _v3_get_function_signature_history_serialize( self, analysis_id, function_id, @@ -1197,7 +1824,7 @@ def _get_function_data_types_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/functions/{function_id}/data-types', + resource_path='/v3/analyses/{analysis_id}/functions/{function_id}/signature/history', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1214,11 +1841,17 @@ def _get_function_data_types_serialize( @validate_call - def list_analysis_functions_data_types( + def v3_list_analysis_data_types( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size.")] = None, + kind: Annotated[Optional[List[StrictStr]], Field(description="Only return types of these kinds. Repeat for more than one; empty means no filter.")] = None, + namespace: Annotated[Optional[Annotated[List[Optional[StrictStr]], Field(max_length=100)]], Field(description="Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Only return types whose name contains this term. Wildcards in the term are matched literally.")] = None, + source_type: Annotated[Optional[List[StrictStr]], Field(description="Only return types from these sources. Empty means no filter.")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1231,17 +1864,29 @@ def list_analysis_functions_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListAnalysisFunctionsDataTypesOutputBody: - """List data types for all functions in an analysis + ) -> ListAnalysisDataTypesOutputBody: + """List an analysis's data types - Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Paginated, filterable list of the data types extracted from the binary — structs, unions, enums, typedefs and the rest. Every entry carries its full definition, so paging this list once resolves every `data_type_id` a definition or signature refers to; no follow-up request per id is needed. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int - :param offset: Pagination offset. Defaults to 0. + :param offset: Pagination offset. :type offset: int - :param limit: Page size. Defaults to 100. + :param limit: Page size. :type limit: int + :param kind: Only return types of these kinds. Repeat for more than one; empty means no filter. + :type kind: List[str] + :param namespace: Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace. + :type namespace: List[Optional[str]] + :param search: Only return types whose name contains this term. Wildcards in the term are matched literally. + :type search: str + :param source_type: Only return types from these sources. Empty means no filter. + :type source_type: List[str] + :param order_by: Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind. + :type order_by: str + :param order: Sort direction. + :type order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1264,10 +1909,16 @@ def list_analysis_functions_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analysis_functions_data_types_serialize( + _param = self._v3_list_analysis_data_types_serialize( analysis_id=analysis_id, offset=offset, limit=limit, + kind=kind, + namespace=namespace, + search=search, + source_type=source_type, + order_by=order_by, + order=order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1275,7 +1926,7 @@ def list_analysis_functions_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisFunctionsDataTypesOutputBody", + '200': "ListAnalysisDataTypesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -1293,11 +1944,17 @@ def list_analysis_functions_data_types( @validate_call - def list_analysis_functions_data_types_with_http_info( + def v3_list_analysis_data_types_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size.")] = None, + kind: Annotated[Optional[List[StrictStr]], Field(description="Only return types of these kinds. Repeat for more than one; empty means no filter.")] = None, + namespace: Annotated[Optional[Annotated[List[Optional[StrictStr]], Field(max_length=100)]], Field(description="Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Only return types whose name contains this term. Wildcards in the term are matched literally.")] = None, + source_type: Annotated[Optional[List[StrictStr]], Field(description="Only return types from these sources. Empty means no filter.")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1310,17 +1967,29 @@ def list_analysis_functions_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListAnalysisFunctionsDataTypesOutputBody]: - """List data types for all functions in an analysis + ) -> ApiResponse[ListAnalysisDataTypesOutputBody]: + """List an analysis's data types - Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Paginated, filterable list of the data types extracted from the binary — structs, unions, enums, typedefs and the rest. Every entry carries its full definition, so paging this list once resolves every `data_type_id` a definition or signature refers to; no follow-up request per id is needed. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int - :param offset: Pagination offset. Defaults to 0. + :param offset: Pagination offset. :type offset: int - :param limit: Page size. Defaults to 100. + :param limit: Page size. :type limit: int + :param kind: Only return types of these kinds. Repeat for more than one; empty means no filter. + :type kind: List[str] + :param namespace: Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace. + :type namespace: List[Optional[str]] + :param search: Only return types whose name contains this term. Wildcards in the term are matched literally. + :type search: str + :param source_type: Only return types from these sources. Empty means no filter. + :type source_type: List[str] + :param order_by: Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind. + :type order_by: str + :param order: Sort direction. + :type order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1343,10 +2012,16 @@ def list_analysis_functions_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analysis_functions_data_types_serialize( + _param = self._v3_list_analysis_data_types_serialize( analysis_id=analysis_id, offset=offset, limit=limit, + kind=kind, + namespace=namespace, + search=search, + source_type=source_type, + order_by=order_by, + order=order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1354,7 +2029,7 @@ def list_analysis_functions_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisFunctionsDataTypesOutputBody", + '200': "ListAnalysisDataTypesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -1372,11 +2047,17 @@ def list_analysis_functions_data_types_with_http_info( @validate_call - def list_analysis_functions_data_types_without_preload_content( + def v3_list_analysis_data_types_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset. Defaults to 0.")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size. Defaults to 100.")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Pagination offset.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Page size.")] = None, + kind: Annotated[Optional[List[StrictStr]], Field(description="Only return types of these kinds. Repeat for more than one; empty means no filter.")] = None, + namespace: Annotated[Optional[Annotated[List[Optional[StrictStr]], Field(max_length=100)]], Field(description="Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Only return types whose name contains this term. Wildcards in the term are matched literally.")] = None, + source_type: Annotated[Optional[List[StrictStr]], Field(description="Only return types from these sources. Empty means no filter.")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1390,16 +2071,28 @@ def list_analysis_functions_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List data types for all functions in an analysis + """List an analysis's data types - Paginated read of the stored data-types blob for each function in the analysis. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Paginated, filterable list of the data types extracted from the binary — structs, unions, enums, typedefs and the rest. Every entry carries its full definition, so paging this list once resolves every `data_type_id` a definition or signature refers to; no follow-up request per id is needed. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int - :param offset: Pagination offset. Defaults to 0. + :param offset: Pagination offset. :type offset: int - :param limit: Page size. Defaults to 100. + :param limit: Page size. :type limit: int + :param kind: Only return types of these kinds. Repeat for more than one; empty means no filter. + :type kind: List[str] + :param namespace: Only return types in these namespaces, matched exactly. Omit for no filter; pass an empty value (namespace=) for the binary's own types, which have no namespace. + :type namespace: List[Optional[str]] + :param search: Only return types whose name contains this term. Wildcards in the term are matched literally. + :type search: str + :param source_type: Only return types from these sources. Empty means no filter. + :type source_type: List[str] + :param order_by: Field to order by. name orders by namespace, then name, then kind; size orders by size with types of unknown size last, then by namespace, name and kind. + :type order_by: str + :param order: Sort direction. + :type order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1422,10 +2115,16 @@ def list_analysis_functions_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analysis_functions_data_types_serialize( + _param = self._v3_list_analysis_data_types_serialize( analysis_id=analysis_id, offset=offset, limit=limit, + kind=kind, + namespace=namespace, + search=search, + source_type=source_type, + order_by=order_by, + order=order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1433,7 +2132,7 @@ def list_analysis_functions_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisFunctionsDataTypesOutputBody", + '200': "ListAnalysisDataTypesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -1446,11 +2145,17 @@ def list_analysis_functions_data_types_without_preload_content( return response_data.response - def _list_analysis_functions_data_types_serialize( + def _v3_list_analysis_data_types_serialize( self, analysis_id, offset, limit, + kind, + namespace, + search, + source_type, + order_by, + order, _request_auth, _content_type, _headers, @@ -1460,6 +2165,9 @@ def _list_analysis_functions_data_types_serialize( _host = None _collection_formats: Dict[str, str] = { + 'kind': 'multi', + 'namespace': 'multi', + 'source_type': 'multi', } _path_params: Dict[str, str] = {} @@ -1483,6 +2191,30 @@ def _list_analysis_functions_data_types_serialize( _query_params.append(('limit', limit)) + if kind is not None: + + _query_params.append(('kind', kind)) + + if namespace is not None: + + _query_params.append(('namespace', namespace)) + + if search is not None: + + _query_params.append(('search', search)) + + if source_type is not None: + + _query_params.append(('source_type', source_type)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if order is not None: + + _query_params.append(('order', order)) + # process the header parameters # process the form parameters # process the body parameter @@ -1505,7 +2237,7 @@ def _list_analysis_functions_data_types_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/functions/data-types', + resource_path='/v3/analyses/{analysis_id}/data-types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1522,10 +2254,12 @@ def _list_analysis_functions_data_types_serialize( @validate_call - def list_function_data_types_for_analysis( + def v3_list_data_type_functions( self, - analysis_id: StrictInt, - function_ids: Optional[List[Optional[StrictInt]]] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size.")] = None, + after_function_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1538,15 +2272,19 @@ def list_function_data_types_for_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionDataTypesList: - """(Deprecated) List Function Data Types + ) -> ListDataTypeFunctionsBody: + """List the functions using a data type - Returns data types for multiple functions with optional function ID filtering + Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_ids: - :type function_ids: List[Optional[int]] + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_id: int + :param page_size: Page size. + :type page_size: int + :param after_function_id: Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function. + :type after_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 @@ -1568,11 +2306,12 @@ def list_function_data_types_for_analysis( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/analyses/{analysis_id}/functions/data_types is deprecated.", DeprecationWarning) - _param = self._list_function_data_types_for_analysis_serialize( + _param = self._v3_list_data_type_functions_serialize( analysis_id=analysis_id, - function_ids=function_ids, + data_type_id=data_type_id, + page_size=page_size, + after_function_id=after_function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1580,8 +2319,11 @@ def list_function_data_types_for_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", - '422': "BaseResponse", + '200': "ListDataTypeFunctionsBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1595,10 +2337,12 @@ def list_function_data_types_for_analysis( @validate_call - def list_function_data_types_for_analysis_with_http_info( + def v3_list_data_type_functions_with_http_info( self, - analysis_id: StrictInt, - function_ids: Optional[List[Optional[StrictInt]]] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size.")] = None, + after_function_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1611,15 +2355,19 @@ def list_function_data_types_for_analysis_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionDataTypesList]: - """(Deprecated) List Function Data Types + ) -> ApiResponse[ListDataTypeFunctionsBody]: + """List the functions using a data type - Returns data types for multiple functions with optional function ID filtering + Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_ids: - :type function_ids: List[Optional[int]] + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_id: int + :param page_size: Page size. + :type page_size: int + :param after_function_id: Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function. + :type after_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 @@ -1641,11 +2389,12 @@ def list_function_data_types_for_analysis_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/analyses/{analysis_id}/functions/data_types is deprecated.", DeprecationWarning) - _param = self._list_function_data_types_for_analysis_serialize( + _param = self._v3_list_data_type_functions_serialize( analysis_id=analysis_id, - function_ids=function_ids, + data_type_id=data_type_id, + page_size=page_size, + after_function_id=after_function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1653,8 +2402,11 @@ def list_function_data_types_for_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", - '422': "BaseResponse", + '200': "ListDataTypeFunctionsBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1668,10 +2420,12 @@ def list_function_data_types_for_analysis_with_http_info( @validate_call - def list_function_data_types_for_analysis_without_preload_content( + def v3_list_data_type_functions_without_preload_content( self, - analysis_id: StrictInt, - function_ids: Optional[List[Optional[StrictInt]]] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + data_type_id: Annotated[int, Field(strict=True, ge=0, description="Data type ID, as returned by the data types list for this analysis. 0 is a valid id.")], + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size.")] = None, + after_function_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1685,14 +2439,18 @@ def list_function_data_types_for_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """(Deprecated) List Function Data Types + """List the functions using a data type - Returns data types for multiple functions with optional function ID filtering + Functions that use this data type as their return type or as a parameter. Matches the `data_type_id` exactly as it appears in the signature, so a function taking `sockaddr_in *` matches the pointer type rather than `sockaddr_in`. Ordered by function ID. There is no total count; page with `after_function_id`. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_ids: - :type function_ids: List[Optional[int]] + :param data_type_id: Data type ID, as returned by the data types list for this analysis. 0 is a valid id. (required) + :type data_type_id: int + :param page_size: Page size. + :type page_size: int + :param after_function_id: Return functions with an ID greater than this. Pass the previous page's next_after_function_id; 0 starts at the first function. + :type after_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 @@ -1714,11 +2472,12 @@ def list_function_data_types_for_analysis_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/analyses/{analysis_id}/functions/data_types is deprecated.", DeprecationWarning) - _param = self._list_function_data_types_for_analysis_serialize( + _param = self._v3_list_data_type_functions_serialize( analysis_id=analysis_id, - function_ids=function_ids, + data_type_id=data_type_id, + page_size=page_size, + after_function_id=after_function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1726,8 +2485,11 @@ def list_function_data_types_for_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", - '422': "BaseResponse", + '200': "ListDataTypeFunctionsBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1736,10 +2498,12 @@ def list_function_data_types_for_analysis_without_preload_content( return response_data.response - def _list_function_data_types_for_analysis_serialize( + def _v3_list_data_type_functions_serialize( self, analysis_id, - function_ids, + data_type_id, + page_size, + after_function_id, _request_auth, _content_type, _headers, @@ -1749,7 +2513,6 @@ def _list_function_data_types_for_analysis_serialize( _host = None _collection_formats: Dict[str, str] = { - 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -1764,10 +2527,16 @@ def _list_function_data_types_for_analysis_serialize( # process the path parameters if analysis_id is not None: _path_params['analysis_id'] = analysis_id + if data_type_id is not None: + _path_params['data_type_id'] = data_type_id # process the query parameters - if function_ids is not None: + if page_size is not None: - _query_params.append(('function_ids', function_ids)) + _query_params.append(('page_size', page_size)) + + if after_function_id is not None: + + _query_params.append(('after_function_id', after_function_id)) # process the header parameters # process the form parameters @@ -1791,7 +2560,7 @@ def _list_function_data_types_for_analysis_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/functions/data_types', + resource_path='/v3/analyses/{analysis_id}/data-types/{data_type_id}/functions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1808,9 +2577,10 @@ def _list_function_data_types_for_analysis_serialize( @validate_call - def list_function_data_types_for_functions( + def v3_list_function_signatures( self, - function_ids: Optional[List[Optional[StrictInt]]] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=50)]], Field(description="Function IDs to fetch signatures for.")], + include_data_types: Annotated[Optional[StrictBool], Field(description="Include the data types the signatures name in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1823,13 +2593,15 @@ def list_function_data_types_for_functions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionDataTypesList: - """(Deprecated) List Function Data Types + ) -> ListFunctionSignaturesOutputBody: + """Get signatures for many functions - Returns data types for multiple function IDs + Returns the extracted signature for each supplied function ID, in request order. The functions need not share an analysis; each entry names the analysis its `data_type_id`s resolve against. Pass `include_data_types=true` to also get those data types, grouped by analysis. The caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param function_ids: - :type function_ids: List[Optional[int]] + :param function_ids: Function IDs to fetch signatures for. (required) + :type function_ids: List[int] + :param include_data_types: Include the data types the signatures name in the response. + :type include_data_types: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1851,10 +2623,10 @@ def list_function_data_types_for_functions( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/functions/data_types is deprecated.", DeprecationWarning) - _param = self._list_function_data_types_for_functions_serialize( + _param = self._v3_list_function_signatures_serialize( function_ids=function_ids, + include_data_types=include_data_types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1862,8 +2634,11 @@ def list_function_data_types_for_functions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", - '422': "BaseResponse", + '200': "ListFunctionSignaturesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1877,9 +2652,10 @@ def list_function_data_types_for_functions( @validate_call - def list_function_data_types_for_functions_with_http_info( + def v3_list_function_signatures_with_http_info( self, - function_ids: Optional[List[Optional[StrictInt]]] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=50)]], Field(description="Function IDs to fetch signatures for.")], + include_data_types: Annotated[Optional[StrictBool], Field(description="Include the data types the signatures name in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1892,13 +2668,15 @@ def list_function_data_types_for_functions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionDataTypesList]: - """(Deprecated) List Function Data Types + ) -> ApiResponse[ListFunctionSignaturesOutputBody]: + """Get signatures for many functions - Returns data types for multiple function IDs + Returns the extracted signature for each supplied function ID, in request order. The functions need not share an analysis; each entry names the analysis its `data_type_id`s resolve against. Pass `include_data_types=true` to also get those data types, grouped by analysis. The caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param function_ids: - :type function_ids: List[Optional[int]] + :param function_ids: Function IDs to fetch signatures for. (required) + :type function_ids: List[int] + :param include_data_types: Include the data types the signatures name in the response. + :type include_data_types: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1920,10 +2698,10 @@ def list_function_data_types_for_functions_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/functions/data_types is deprecated.", DeprecationWarning) - _param = self._list_function_data_types_for_functions_serialize( + _param = self._v3_list_function_signatures_serialize( function_ids=function_ids, + include_data_types=include_data_types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1931,8 +2709,11 @@ def list_function_data_types_for_functions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", - '422': "BaseResponse", + '200': "ListFunctionSignaturesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -1946,9 +2727,10 @@ def list_function_data_types_for_functions_with_http_info( @validate_call - def list_function_data_types_for_functions_without_preload_content( + def v3_list_function_signatures_without_preload_content( self, - function_ids: Optional[List[Optional[StrictInt]]] = None, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=50)]], Field(description="Function IDs to fetch signatures for.")], + include_data_types: Annotated[Optional[StrictBool], Field(description="Include the data types the signatures name in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1962,12 +2744,14 @@ def list_function_data_types_for_functions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """(Deprecated) List Function Data Types + """Get signatures for many functions - Returns data types for multiple function IDs + Returns the extracted signature for each supplied function ID, in request order. The functions need not share an analysis; each entry names the analysis its `data_type_id`s resolve against. Pass `include_data_types=true` to also get those data types, grouped by analysis. The caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param function_ids: - :type function_ids: List[Optional[int]] + :param function_ids: Function IDs to fetch signatures for. (required) + :type function_ids: List[int] + :param include_data_types: Include the data types the signatures name in the response. + :type include_data_types: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1989,10 +2773,10 @@ def list_function_data_types_for_functions_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/functions/data_types is deprecated.", DeprecationWarning) - _param = self._list_function_data_types_for_functions_serialize( + _param = self._v3_list_function_signatures_serialize( function_ids=function_ids, + include_data_types=include_data_types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2000,8 +2784,11 @@ def list_function_data_types_for_functions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", - '422': "BaseResponse", + '200': "ListFunctionSignaturesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2010,9 +2797,10 @@ def list_function_data_types_for_functions_without_preload_content( return response_data.response - def _list_function_data_types_for_functions_serialize( + def _v3_list_function_signatures_serialize( self, function_ids, + include_data_types, _request_auth, _content_type, _headers, @@ -2022,7 +2810,7 @@ def _list_function_data_types_for_functions_serialize( _host = None _collection_formats: Dict[str, str] = { - 'function_ids': 'multi', + 'function_ids': 'csv', } _path_params: Dict[str, str] = {} @@ -2040,6 +2828,10 @@ def _list_function_data_types_for_functions_serialize( _query_params.append(('function_ids', function_ids)) + if include_data_types is not None: + + _query_params.append(('include_data_types', include_data_types)) + # process the header parameters # process the form parameters # process the body parameter @@ -2062,7 +2854,7 @@ def _list_function_data_types_for_functions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/data_types', + resource_path='/v3/functions/signatures', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2079,9 +2871,10 @@ def _list_function_data_types_for_functions_serialize( @validate_call - def list_functions_data_types( + def v3_update_analysis_data_types( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=500)]], Field(description="Function IDs to fetch data-types for.")], + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + update_analysis_data_types_input_body: UpdateAnalysisDataTypesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2094,13 +2887,15 @@ def list_functions_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListFunctionsDataTypesOutputBody: - """Get data types for many functions + ) -> AnalysisDataTypesOutputBody: + """Update an analysis's data types - Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Replaces stored types in full: a field left out of the request is cleared. Many types can be updated in one request; the whole request is rejected if any of them is invalid. `kind` may be changed, and the definition must then match the new kind. Updated types get a `source_type` of `USER`, and their previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param function_ids: Function IDs to fetch data-types for. (required) - :type function_ids: List[int] + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param update_analysis_data_types_input_body: (required) + :type update_analysis_data_types_input_body: UpdateAnalysisDataTypesInputBody :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 @@ -2123,8 +2918,9 @@ def list_functions_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._list_functions_data_types_serialize( - function_ids=function_ids, + _param = self._v3_update_analysis_data_types_serialize( + analysis_id=analysis_id, + update_analysis_data_types_input_body=update_analysis_data_types_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2132,10 +2928,11 @@ def list_functions_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListFunctionsDataTypesOutputBody", + '200': "AnalysisDataTypesOutputBody", '400': "APIError", '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2151,9 +2948,10 @@ def list_functions_data_types( @validate_call - def list_functions_data_types_with_http_info( + def v3_update_analysis_data_types_with_http_info( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=500)]], Field(description="Function IDs to fetch data-types for.")], + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + update_analysis_data_types_input_body: UpdateAnalysisDataTypesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2166,13 +2964,15 @@ def list_functions_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListFunctionsDataTypesOutputBody]: - """Get data types for many functions + ) -> ApiResponse[AnalysisDataTypesOutputBody]: + """Update an analysis's data types - Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Replaces stored types in full: a field left out of the request is cleared. Many types can be updated in one request; the whole request is rejected if any of them is invalid. `kind` may be changed, and the definition must then match the new kind. Updated types get a `source_type` of `USER`, and their previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param function_ids: Function IDs to fetch data-types for. (required) - :type function_ids: List[int] + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param update_analysis_data_types_input_body: (required) + :type update_analysis_data_types_input_body: UpdateAnalysisDataTypesInputBody :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 @@ -2195,8 +2995,9 @@ def list_functions_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_functions_data_types_serialize( - function_ids=function_ids, + _param = self._v3_update_analysis_data_types_serialize( + analysis_id=analysis_id, + update_analysis_data_types_input_body=update_analysis_data_types_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2204,10 +3005,11 @@ def list_functions_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListFunctionsDataTypesOutputBody", + '200': "AnalysisDataTypesOutputBody", '400': "APIError", '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2223,9 +3025,10 @@ def list_functions_data_types_with_http_info( @validate_call - def list_functions_data_types_without_preload_content( + def v3_update_analysis_data_types_without_preload_content( self, - function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=500)]], Field(description="Function IDs to fetch data-types for.")], + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + update_analysis_data_types_input_body: UpdateAnalysisDataTypesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2239,12 +3042,14 @@ def list_functions_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get data types for many functions + """Update an analysis's data types - Returns the stored data-types blob for each supplied function ID. Caller must have read access to every function or the request is rejected. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Replaces stored types in full: a field left out of the request is cleared. Many types can be updated in one request; the whole request is rejected if any of them is invalid. `kind` may be changed, and the definition must then match the new kind. Updated types get a `source_type` of `USER`, and their previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param function_ids: Function IDs to fetch data-types for. (required) - :type function_ids: List[int] + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param update_analysis_data_types_input_body: (required) + :type update_analysis_data_types_input_body: UpdateAnalysisDataTypesInputBody :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 @@ -2267,8 +3072,9 @@ def list_functions_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_functions_data_types_serialize( - function_ids=function_ids, + _param = self._v3_update_analysis_data_types_serialize( + analysis_id=analysis_id, + update_analysis_data_types_input_body=update_analysis_data_types_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2276,10 +3082,11 @@ def list_functions_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListFunctionsDataTypesOutputBody", + '200': "AnalysisDataTypesOutputBody", '400': "APIError", '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2290,9 +3097,10 @@ def list_functions_data_types_without_preload_content( return response_data.response - def _list_functions_data_types_serialize( + def _v3_update_analysis_data_types_serialize( self, - function_ids, + analysis_id, + update_analysis_data_types_input_body, _request_auth, _content_type, _headers, @@ -2302,7 +3110,6 @@ def _list_functions_data_types_serialize( _host = None _collection_formats: Dict[str, str] = { - 'function_ids': 'csv', } _path_params: Dict[str, str] = {} @@ -2315,14 +3122,14 @@ def _list_functions_data_types_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id # process the query parameters - if function_ids is not None: - - _query_params.append(('function_ids', function_ids)) - # process the header parameters # process the form parameters # process the body parameter + if update_analysis_data_types_input_body is not None: + _body_params = update_analysis_data_types_input_body # set the HTTP header `Accept` @@ -2333,6 +3140,19 @@ def _list_functions_data_types_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2341,8 +3161,8 @@ def _list_functions_data_types_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v3/functions/data-types', + method='PUT', + resource_path='/v3/analyses/{analysis_id}/data-types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2359,11 +3179,11 @@ def _list_functions_data_types_serialize( @validate_call - def update_function_data_types( + def v3_update_function_signature( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - update_data_types_input_body: UpdateDataTypesInputBody, + update_function_signature_input_body: UpdateFunctionSignatureInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2376,17 +3196,17 @@ def update_function_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UpdateDataTypesOutputBody: - """Update function data types + ) -> FunctionSignatureEntry: + """Update a function's signature - Stores user-specific overrides for a function's data types. Uses optimistic concurrency: if the stored version doesn't match `data_types_version`, the update is rejected with 409. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Replaces a function's parameters, return type and calling convention in full — anything left out of the request is cleared. Parameter and return types are `data_type_id`s belonging to this analysis. Edits an extracted signature only: a function with `has_signature` false is rejected with 404. The stored signature gets a `source_type` of `USER`, and its previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int :param function_id: Function ID (required) :type function_id: int - :param update_data_types_input_body: (required) - :type update_data_types_input_body: UpdateDataTypesInputBody + :param update_function_signature_input_body: (required) + :type update_function_signature_input_body: UpdateFunctionSignatureInputBody :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 @@ -2409,10 +3229,10 @@ def update_function_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._update_function_data_types_serialize( + _param = self._v3_update_function_signature_serialize( analysis_id=analysis_id, function_id=function_id, - update_data_types_input_body=update_data_types_input_body, + update_function_signature_input_body=update_function_signature_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2420,11 +3240,10 @@ def update_function_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UpdateDataTypesOutputBody", + '200': "FunctionSignatureEntry", '400': "APIError", '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2440,11 +3259,11 @@ def update_function_data_types( @validate_call - def update_function_data_types_with_http_info( + def v3_update_function_signature_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - update_data_types_input_body: UpdateDataTypesInputBody, + update_function_signature_input_body: UpdateFunctionSignatureInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2457,17 +3276,17 @@ def update_function_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UpdateDataTypesOutputBody]: - """Update function data types + ) -> ApiResponse[FunctionSignatureEntry]: + """Update a function's signature - Stores user-specific overrides for a function's data types. Uses optimistic concurrency: if the stored version doesn't match `data_types_version`, the update is rejected with 409. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Replaces a function's parameters, return type and calling convention in full — anything left out of the request is cleared. Parameter and return types are `data_type_id`s belonging to this analysis. Edits an extracted signature only: a function with `has_signature` false is rejected with 404. The stored signature gets a `source_type` of `USER`, and its previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int :param function_id: Function ID (required) :type function_id: int - :param update_data_types_input_body: (required) - :type update_data_types_input_body: UpdateDataTypesInputBody + :param update_function_signature_input_body: (required) + :type update_function_signature_input_body: UpdateFunctionSignatureInputBody :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 @@ -2490,10 +3309,10 @@ def update_function_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_function_data_types_serialize( + _param = self._v3_update_function_signature_serialize( analysis_id=analysis_id, function_id=function_id, - update_data_types_input_body=update_data_types_input_body, + update_function_signature_input_body=update_function_signature_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2501,11 +3320,10 @@ def update_function_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UpdateDataTypesOutputBody", + '200': "FunctionSignatureEntry", '400': "APIError", '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2521,11 +3339,11 @@ def update_function_data_types_with_http_info( @validate_call - def update_function_data_types_without_preload_content( + def v3_update_function_signature_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - update_data_types_input_body: UpdateDataTypesInputBody, + update_function_signature_input_body: UpdateFunctionSignatureInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2539,16 +3357,16 @@ def update_function_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update function data types + """Update a function's signature - Stores user-specific overrides for a function's data types. Uses optimistic concurrency: if the stored version doesn't match `data_types_version`, the update is rejected with 409. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Replaces a function's parameters, return type and calling convention in full — anything left out of the request is cleared. Parameter and return types are `data_type_id`s belonging to this analysis. Edits an extracted signature only: a function with `has_signature` false is rejected with 404. The stored signature gets a `source_type` of `USER`, and its previous value is retained. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param analysis_id: Analysis ID (required) :type analysis_id: int :param function_id: Function ID (required) :type function_id: int - :param update_data_types_input_body: (required) - :type update_data_types_input_body: UpdateDataTypesInputBody + :param update_function_signature_input_body: (required) + :type update_function_signature_input_body: UpdateFunctionSignatureInputBody :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 @@ -2571,10 +3389,10 @@ def update_function_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_function_data_types_serialize( + _param = self._v3_update_function_signature_serialize( analysis_id=analysis_id, function_id=function_id, - update_data_types_input_body=update_data_types_input_body, + update_function_signature_input_body=update_function_signature_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2582,11 +3400,10 @@ def update_function_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UpdateDataTypesOutputBody", + '200': "FunctionSignatureEntry", '400': "APIError", '403': "APIError", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2597,11 +3414,11 @@ def update_function_data_types_without_preload_content( return response_data.response - def _update_function_data_types_serialize( + def _v3_update_function_signature_serialize( self, analysis_id, function_id, - update_data_types_input_body, + update_function_signature_input_body, _request_auth, _content_type, _headers, @@ -2631,8 +3448,8 @@ def _update_function_data_types_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_data_types_input_body is not None: - _body_params = update_data_types_input_body + if update_function_signature_input_body is not None: + _body_params = update_function_signature_input_body # set the HTTP header `Accept` @@ -2665,7 +3482,7 @@ def _update_function_data_types_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/v2/analyses/{analysis_id}/functions/{function_id}/data_types', + resource_path='/v3/analyses/{analysis_id}/functions/{function_id}/signature', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/functions_ai_decompilation_api.py b/revengai/api/functions_ai_decompilation_api.py index fa6e6c16..baa27a13 100644 --- a/revengai/api/functions_ai_decompilation_api.py +++ b/revengai/api/functions_ai_decompilation_api.py @@ -15,7 +15,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt +from pydantic import Field, StrictInt from typing import List, Optional, Union from typing_extensions import Annotated from revengai.models.base_response import BaseResponse @@ -23,11 +23,12 @@ from revengai.models.comments_data import CommentsData from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody from revengai.models.decompilation_data import DecompilationData +from revengai.models.get_tokens_response import GetTokensResponse +from revengai.models.line_attributions_data import LineAttributionsData from revengai.models.patch_comment_body import PatchCommentBody from revengai.models.regenerate_output_body import RegenerateOutputBody 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 from revengai.models.upsert_overrides_data import UpsertOverridesData from revengai.models.upsert_overrides_input_body import UpsertOverridesInputBody @@ -55,7 +56,6 @@ def __init__(self, api_client=None) -> None: def create_ai_decompilation( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - context_aware: Annotated[Optional[StrictBool], Field(description="Use context-aware decompilation")] = None, temperature: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=-1)], Annotated[int, Field(le=1, strict=True, ge=-1)]]], Field(description="LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default.")] = None, _request_timeout: Union[ None, @@ -76,8 +76,6 @@ def create_ai_decompilation( :param function_id: Function ID (required) :type function_id: int - :param context_aware: Use context-aware decompilation - :type context_aware: bool :param temperature: LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. :type temperature: float :param _request_timeout: timeout setting for this request. If one @@ -104,7 +102,6 @@ def create_ai_decompilation( _param = self._create_ai_decompilation_serialize( function_id=function_id, - context_aware=context_aware, temperature=temperature, _request_auth=_request_auth, _content_type=_content_type, @@ -136,7 +133,6 @@ def create_ai_decompilation( def create_ai_decompilation_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - context_aware: Annotated[Optional[StrictBool], Field(description="Use context-aware decompilation")] = None, temperature: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=-1)], Annotated[int, Field(le=1, strict=True, ge=-1)]]], Field(description="LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default.")] = None, _request_timeout: Union[ None, @@ -157,8 +153,6 @@ def create_ai_decompilation_with_http_info( :param function_id: Function ID (required) :type function_id: int - :param context_aware: Use context-aware decompilation - :type context_aware: bool :param temperature: LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. :type temperature: float :param _request_timeout: timeout setting for this request. If one @@ -185,7 +179,6 @@ def create_ai_decompilation_with_http_info( _param = self._create_ai_decompilation_serialize( function_id=function_id, - context_aware=context_aware, temperature=temperature, _request_auth=_request_auth, _content_type=_content_type, @@ -217,7 +210,6 @@ def create_ai_decompilation_with_http_info( def create_ai_decompilation_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - context_aware: Annotated[Optional[StrictBool], Field(description="Use context-aware decompilation")] = None, temperature: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=-1)], Annotated[int, Field(le=1, strict=True, ge=-1)]]], Field(description="LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default.")] = None, _request_timeout: Union[ None, @@ -238,8 +230,6 @@ def create_ai_decompilation_without_preload_content( :param function_id: Function ID (required) :type function_id: int - :param context_aware: Use context-aware decompilation - :type context_aware: bool :param temperature: LLM temperature (0.0-1.0). Overrides the server default when set. Omit or set to -1 to use the server default. :type temperature: float :param _request_timeout: timeout setting for this request. If one @@ -266,7 +256,6 @@ def create_ai_decompilation_without_preload_content( _param = self._create_ai_decompilation_serialize( function_id=function_id, - context_aware=context_aware, temperature=temperature, _request_auth=_request_auth, _content_type=_content_type, @@ -293,7 +282,6 @@ def create_ai_decompilation_without_preload_content( def _create_ai_decompilation_serialize( self, function_id, - context_aware, temperature, _request_auth, _content_type, @@ -319,10 +307,6 @@ def _create_ai_decompilation_serialize( if function_id is not None: _path_params['function_id'] = function_id # process the query parameters - if context_aware is not None: - - _query_params.append(('context_aware', context_aware)) - if temperature is not None: _query_params.append(('temperature', temperature)) @@ -2561,9 +2545,10 @@ def _get_ai_decompilation_summary_status_serialize( @validate_call - def get_ai_decompilation_tokenised( + def patch_ai_decompilation_inline_comment( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + patch_comment_body: PatchCommentBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2576,13 +2561,15 @@ def get_ai_decompilation_tokenised( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TokenisedData: - """Get tokenised AI decompilation with function mapping + ) -> CommentsData: + """Update a single inline comment - Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int + :param patch_comment_body: (required) + :type patch_comment_body: PatchCommentBody :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 @@ -2605,8 +2592,9 @@ def get_ai_decompilation_tokenised( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_tokenised_serialize( + _param = self._patch_ai_decompilation_inline_comment_serialize( function_id=function_id, + patch_comment_body=patch_comment_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2614,7 +2602,7 @@ def get_ai_decompilation_tokenised( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TokenisedData", + '200': "CommentsData", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2632,9 +2620,10 @@ def get_ai_decompilation_tokenised( @validate_call - def get_ai_decompilation_tokenised_with_http_info( + def patch_ai_decompilation_inline_comment_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + patch_comment_body: PatchCommentBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2647,13 +2636,15 @@ def get_ai_decompilation_tokenised_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TokenisedData]: - """Get tokenised AI decompilation with function mapping + ) -> ApiResponse[CommentsData]: + """Update a single inline comment - Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int + :param patch_comment_body: (required) + :type patch_comment_body: PatchCommentBody :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 @@ -2676,8 +2667,9 @@ def get_ai_decompilation_tokenised_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_tokenised_serialize( + _param = self._patch_ai_decompilation_inline_comment_serialize( function_id=function_id, + patch_comment_body=patch_comment_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2685,7 +2677,7 @@ def get_ai_decompilation_tokenised_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TokenisedData", + '200': "CommentsData", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2703,9 +2695,10 @@ def get_ai_decompilation_tokenised_with_http_info( @validate_call - def get_ai_decompilation_tokenised_without_preload_content( + def patch_ai_decompilation_inline_comment_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + patch_comment_body: PatchCommentBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2719,12 +2712,14 @@ def get_ai_decompilation_tokenised_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get tokenised AI decompilation with function mapping + """Update a single inline comment - Returns the decompilation with placeholder tokens, the function mapping for token resolution, and the predicted function name. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int + :param patch_comment_body: (required) + :type patch_comment_body: PatchCommentBody :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 @@ -2747,8 +2742,9 @@ def get_ai_decompilation_tokenised_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_ai_decompilation_tokenised_serialize( + _param = self._patch_ai_decompilation_inline_comment_serialize( function_id=function_id, + patch_comment_body=patch_comment_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2756,7 +2752,7 @@ def get_ai_decompilation_tokenised_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TokenisedData", + '200': "CommentsData", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2769,9 +2765,10 @@ def get_ai_decompilation_tokenised_without_preload_content( return response_data.response - def _get_ai_decompilation_tokenised_serialize( + def _patch_ai_decompilation_inline_comment_serialize( self, function_id, + patch_comment_body, _request_auth, _content_type, _headers, @@ -2799,6 +2796,8 @@ def _get_ai_decompilation_tokenised_serialize( # process the header parameters # process the form parameters # process the body parameter + if patch_comment_body is not None: + _body_params = patch_comment_body # set the HTTP header `Accept` @@ -2809,6 +2808,19 @@ def _get_ai_decompilation_tokenised_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2817,8 +2829,8 @@ def _get_ai_decompilation_tokenised_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v3/functions/{function_id}/ai-decompilation/tokenised', + method='PATCH', + resource_path='/v3/functions/{function_id}/ai-decompilation/inline-comments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2835,10 +2847,9 @@ def _get_ai_decompilation_tokenised_serialize( @validate_call - def patch_ai_decompilation_inline_comment( + def regenerate_ai_decompilation_inline_comments( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - patch_comment_body: PatchCommentBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2851,15 +2862,13 @@ def patch_ai_decompilation_inline_comment( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CommentsData: - """Update a single inline comment + ) -> RegenerateOutputBody: + """Regenerate AI decompilation inline comments - Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int - :param patch_comment_body: (required) - :type patch_comment_body: PatchCommentBody :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 @@ -2882,9 +2891,8 @@ def patch_ai_decompilation_inline_comment( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_ai_decompilation_inline_comment_serialize( + _param = self._regenerate_ai_decompilation_inline_comments_serialize( function_id=function_id, - patch_comment_body=patch_comment_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2892,7 +2900,7 @@ def patch_ai_decompilation_inline_comment( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CommentsData", + '202': "RegenerateOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2910,10 +2918,9 @@ def patch_ai_decompilation_inline_comment( @validate_call - def patch_ai_decompilation_inline_comment_with_http_info( + def regenerate_ai_decompilation_inline_comments_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - patch_comment_body: PatchCommentBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2926,15 +2933,13 @@ def patch_ai_decompilation_inline_comment_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CommentsData]: - """Update a single inline comment + ) -> ApiResponse[RegenerateOutputBody]: + """Regenerate AI decompilation inline comments - Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int - :param patch_comment_body: (required) - :type patch_comment_body: PatchCommentBody :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 @@ -2957,9 +2962,8 @@ def patch_ai_decompilation_inline_comment_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_ai_decompilation_inline_comment_serialize( + _param = self._regenerate_ai_decompilation_inline_comments_serialize( function_id=function_id, - patch_comment_body=patch_comment_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2967,7 +2971,7 @@ def patch_ai_decompilation_inline_comment_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CommentsData", + '202': "RegenerateOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2985,10 +2989,9 @@ def patch_ai_decompilation_inline_comment_with_http_info( @validate_call - def patch_ai_decompilation_inline_comment_without_preload_content( + def regenerate_ai_decompilation_inline_comments_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - patch_comment_body: PatchCommentBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3002,14 +3005,12 @@ def patch_ai_decompilation_inline_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a single inline comment + """Regenerate AI decompilation inline comments - Merges a single line comment into the existing AI-generated inline comments. Requires comments to have been generated first. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int - :param patch_comment_body: (required) - :type patch_comment_body: PatchCommentBody :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 @@ -3032,9 +3033,8 @@ def patch_ai_decompilation_inline_comment_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_ai_decompilation_inline_comment_serialize( + _param = self._regenerate_ai_decompilation_inline_comments_serialize( function_id=function_id, - patch_comment_body=patch_comment_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3042,7 +3042,7 @@ def patch_ai_decompilation_inline_comment_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CommentsData", + '202': "RegenerateOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -3055,10 +3055,9 @@ def patch_ai_decompilation_inline_comment_without_preload_content( return response_data.response - def _patch_ai_decompilation_inline_comment_serialize( + def _regenerate_ai_decompilation_inline_comments_serialize( self, function_id, - patch_comment_body, _request_auth, _content_type, _headers, @@ -3086,8 +3085,6 @@ def _patch_ai_decompilation_inline_comment_serialize( # process the header parameters # process the form parameters # process the body parameter - if patch_comment_body is not None: - _body_params = patch_comment_body # set the HTTP header `Accept` @@ -3098,19 +3095,6 @@ def _patch_ai_decompilation_inline_comment_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -3119,7 +3103,7 @@ def _patch_ai_decompilation_inline_comment_serialize( ] return self.api_client.param_serialize( - method='PATCH', + method='POST', resource_path='/v3/functions/{function_id}/ai-decompilation/inline-comments', path_params=_path_params, query_params=_query_params, @@ -3137,7 +3121,7 @@ def _patch_ai_decompilation_inline_comment_serialize( @validate_call - def regenerate_ai_decompilation_inline_comments( + def regenerate_ai_decompilation_summary( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ @@ -3153,9 +3137,9 @@ def regenerate_ai_decompilation_inline_comments( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RegenerateOutputBody: - """Regenerate AI decompilation inline comments + """Regenerate AI decompilation summary - Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int @@ -3181,7 +3165,7 @@ def regenerate_ai_decompilation_inline_comments( :return: Returns the result object. """ # noqa: E501 - _param = self._regenerate_ai_decompilation_inline_comments_serialize( + _param = self._regenerate_ai_decompilation_summary_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3208,7 +3192,7 @@ def regenerate_ai_decompilation_inline_comments( @validate_call - def regenerate_ai_decompilation_inline_comments_with_http_info( + def regenerate_ai_decompilation_summary_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ @@ -3224,9 +3208,9 @@ def regenerate_ai_decompilation_inline_comments_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[RegenerateOutputBody]: - """Regenerate AI decompilation inline comments + """Regenerate AI decompilation summary - Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int @@ -3252,7 +3236,7 @@ def regenerate_ai_decompilation_inline_comments_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._regenerate_ai_decompilation_inline_comments_serialize( + _param = self._regenerate_ai_decompilation_summary_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3279,7 +3263,7 @@ def regenerate_ai_decompilation_inline_comments_with_http_info( @validate_call - def regenerate_ai_decompilation_inline_comments_without_preload_content( + def regenerate_ai_decompilation_summary_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ @@ -3295,9 +3279,9 @@ def regenerate_ai_decompilation_inline_comments_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Regenerate AI decompilation inline comments + """Regenerate AI decompilation summary - Starts a new inline comments generation workflow for the function. Requires an existing decompilation with a summary. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found :param function_id: Function ID (required) :type function_id: int @@ -3323,7 +3307,7 @@ def regenerate_ai_decompilation_inline_comments_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._regenerate_ai_decompilation_inline_comments_serialize( + _param = self._regenerate_ai_decompilation_summary_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3345,7 +3329,7 @@ def regenerate_ai_decompilation_inline_comments_without_preload_content( return response_data.response - def _regenerate_ai_decompilation_inline_comments_serialize( + def _regenerate_ai_decompilation_summary_serialize( self, function_id, _request_auth, @@ -3394,7 +3378,7 @@ def _regenerate_ai_decompilation_inline_comments_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v3/functions/{function_id}/ai-decompilation/inline-comments', + resource_path='/v3/functions/{function_id}/ai-decompilation/summary', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3411,7 +3395,7 @@ def _regenerate_ai_decompilation_inline_comments_serialize( @validate_call - def regenerate_ai_decompilation_summary( + def stream_ai_decompilation( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ @@ -3426,10 +3410,10 @@ def regenerate_ai_decompilation_summary( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RegenerateOutputBody: - """Regenerate AI decompilation summary + ) -> List[StreamAiDecompilation200ResponseInner]: + """Stream live AI decompilation output (SSE) - Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + 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 @@ -3455,7 +3439,7 @@ def regenerate_ai_decompilation_summary( :return: Returns the result object. """ # noqa: E501 - _param = self._regenerate_ai_decompilation_summary_serialize( + _param = self._stream_ai_decompilation_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3464,11 +3448,7 @@ def regenerate_ai_decompilation_summary( ) _response_types_map: Dict[str, Optional[str]] = { - '202': "RegenerateOutputBody", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", + '200': "List[StreamAiDecompilation200ResponseInner]", } response_data = self.api_client.call_api( *_param, @@ -3482,7 +3462,7 @@ def regenerate_ai_decompilation_summary( @validate_call - def regenerate_ai_decompilation_summary_with_http_info( + def stream_ai_decompilation_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ @@ -3497,10 +3477,10 @@ def regenerate_ai_decompilation_summary_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RegenerateOutputBody]: - """Regenerate AI decompilation summary + ) -> ApiResponse[List[StreamAiDecompilation200ResponseInner]]: + """Stream live AI decompilation output (SSE) - Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + 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 @@ -3526,7 +3506,7 @@ def regenerate_ai_decompilation_summary_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._regenerate_ai_decompilation_summary_serialize( + _param = self._stream_ai_decompilation_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3535,11 +3515,7 @@ def regenerate_ai_decompilation_summary_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '202': "RegenerateOutputBody", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", + '200': "List[StreamAiDecompilation200ResponseInner]", } response_data = self.api_client.call_api( *_param, @@ -3553,7 +3529,7 @@ def regenerate_ai_decompilation_summary_with_http_info( @validate_call - def regenerate_ai_decompilation_summary_without_preload_content( + def stream_ai_decompilation_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ @@ -3569,9 +3545,9 @@ def regenerate_ai_decompilation_summary_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Regenerate AI decompilation summary + """Stream live AI decompilation output (SSE) - Starts a new summary generation workflow for the function. Requires an existing decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + 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 @@ -3597,7 +3573,7 @@ def regenerate_ai_decompilation_summary_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._regenerate_ai_decompilation_summary_serialize( + _param = self._stream_ai_decompilation_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3606,11 +3582,7 @@ def regenerate_ai_decompilation_summary_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '202': "RegenerateOutputBody", - '403': "APIError", - '404': "APIError", - '422': "APIError", - '500': "APIError", + '200': "List[StreamAiDecompilation200ResponseInner]", } response_data = self.api_client.call_api( *_param, @@ -3619,7 +3591,7 @@ def regenerate_ai_decompilation_summary_without_preload_content( return response_data.response - def _regenerate_ai_decompilation_summary_serialize( + def _stream_ai_decompilation_serialize( self, function_id, _request_auth, @@ -3655,6 +3627,7 @@ def _regenerate_ai_decompilation_summary_serialize( if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ + 'text/event-stream', 'application/json' ] ) @@ -3667,8 +3640,8 @@ def _regenerate_ai_decompilation_summary_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v3/functions/{function_id}/ai-decompilation/summary', + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3685,9 +3658,10 @@ def _regenerate_ai_decompilation_summary_serialize( @validate_call - def stream_ai_decompilation( + def upsert_ai_decompilation_rating( self, - function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + function_id: Annotated[StrictInt, Field(description="The ID of the function being rated")], + upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3700,13 +3674,14 @@ def stream_ai_decompilation( _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) + ) -> BaseResponse: + """Upsert rating for AI decompilation - 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) + :param function_id: The ID of the function being rated (required) :type function_id: int + :param upsert_ai_decomplation_rating_request: (required) + :type upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest :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 @@ -3729,8 +3704,9 @@ def stream_ai_decompilation( :return: Returns the result object. """ # noqa: E501 - _param = self._stream_ai_decompilation_serialize( + _param = self._upsert_ai_decompilation_rating_serialize( function_id=function_id, + upsert_ai_decomplation_rating_request=upsert_ai_decomplation_rating_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3738,7 +3714,8 @@ def stream_ai_decompilation( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[StreamAiDecompilation200ResponseInner]", + '201': "BaseResponse", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3752,9 +3729,10 @@ def stream_ai_decompilation( @validate_call - def stream_ai_decompilation_with_http_info( + def upsert_ai_decompilation_rating_with_http_info( self, - function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + function_id: Annotated[StrictInt, Field(description="The ID of the function being rated")], + upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3767,13 +3745,14 @@ def stream_ai_decompilation_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[StreamAiDecompilation200ResponseInner]]: - """Stream live AI decompilation output (SSE) + ) -> ApiResponse[BaseResponse]: + """Upsert rating for AI decompilation - 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) + :param function_id: The ID of the function being rated (required) :type function_id: int + :param upsert_ai_decomplation_rating_request: (required) + :type upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest :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 @@ -3796,8 +3775,9 @@ def stream_ai_decompilation_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._stream_ai_decompilation_serialize( + _param = self._upsert_ai_decompilation_rating_serialize( function_id=function_id, + upsert_ai_decomplation_rating_request=upsert_ai_decomplation_rating_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3805,7 +3785,8 @@ def stream_ai_decompilation_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[StreamAiDecompilation200ResponseInner]", + '201': "BaseResponse", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3819,9 +3800,10 @@ def stream_ai_decompilation_with_http_info( @validate_call - def stream_ai_decompilation_without_preload_content( + def upsert_ai_decompilation_rating_without_preload_content( self, - function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + function_id: Annotated[StrictInt, Field(description="The ID of the function being rated")], + upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3835,12 +3817,13 @@ def stream_ai_decompilation_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Stream live AI decompilation output (SSE) + """Upsert rating for AI decompilation - 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) + :param function_id: The ID of the function being rated (required) :type function_id: int + :param upsert_ai_decomplation_rating_request: (required) + :type upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest :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 @@ -3863,8 +3846,9 @@ def stream_ai_decompilation_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._stream_ai_decompilation_serialize( + _param = self._upsert_ai_decompilation_rating_serialize( function_id=function_id, + upsert_ai_decomplation_rating_request=upsert_ai_decomplation_rating_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3872,7 +3856,8 @@ def stream_ai_decompilation_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[StreamAiDecompilation200ResponseInner]", + '201': "BaseResponse", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3881,9 +3866,10 @@ def stream_ai_decompilation_without_preload_content( return response_data.response - def _stream_ai_decompilation_serialize( + def _upsert_ai_decompilation_rating_serialize( self, function_id, + upsert_ai_decomplation_rating_request, _request_auth, _content_type, _headers, @@ -3911,17 +3897,31 @@ def _stream_ai_decompilation_serialize( # process the header parameters # process the form parameters # process the body parameter + if upsert_ai_decomplation_rating_request is not None: + _body_params = upsert_ai_decomplation_rating_request # 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' ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -3930,8 +3930,8 @@ def _stream_ai_decompilation_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v3/functions/{function_id}/ai-decompilation/events', + method='PATCH', + resource_path='/v2/functions/{function_id}/ai-decompilation/rating', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3948,10 +3948,9 @@ def _stream_ai_decompilation_serialize( @validate_call - def upsert_ai_decompilation_overrides( + def v3_get_ai_decompilation_line_attributions( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - upsert_overrides_input_body: UpsertOverridesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3964,15 +3963,13 @@ def upsert_ai_decompilation_overrides( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UpsertOverridesData: - """Upsert variable/function name overrides + ) -> LineAttributionsData: + """Get AI decompilation line attributions - Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Returns the correspondence between the function's disassembly line numbers and its AI-decompilation line numbers, grouped by disassembly line. Both sides are 0-indexed and the correspondence has a many-to-many relationship. The mapping is empty until a completed run has produced one, and is empty for a run that produced none. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error :param function_id: Function ID (required) :type function_id: int - :param upsert_overrides_input_body: (required) - :type upsert_overrides_input_body: UpsertOverridesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3995,9 +3992,8 @@ def upsert_ai_decompilation_overrides( :return: Returns the result object. """ # noqa: E501 - _param = self._upsert_ai_decompilation_overrides_serialize( + _param = self._v3_get_ai_decompilation_line_attributions_serialize( function_id=function_id, - upsert_overrides_input_body=upsert_overrides_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4005,8 +4001,7 @@ def upsert_ai_decompilation_overrides( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UpsertOverridesData", - '400': "APIError", + '200': "LineAttributionsData", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4024,10 +4019,9 @@ def upsert_ai_decompilation_overrides( @validate_call - def upsert_ai_decompilation_overrides_with_http_info( + def v3_get_ai_decompilation_line_attributions_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - upsert_overrides_input_body: UpsertOverridesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4040,15 +4034,13 @@ def upsert_ai_decompilation_overrides_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UpsertOverridesData]: - """Upsert variable/function name overrides + ) -> ApiResponse[LineAttributionsData]: + """Get AI decompilation line attributions - Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Returns the correspondence between the function's disassembly line numbers and its AI-decompilation line numbers, grouped by disassembly line. Both sides are 0-indexed and the correspondence has a many-to-many relationship. The mapping is empty until a completed run has produced one, and is empty for a run that produced none. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error :param function_id: Function ID (required) :type function_id: int - :param upsert_overrides_input_body: (required) - :type upsert_overrides_input_body: UpsertOverridesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4071,9 +4063,8 @@ def upsert_ai_decompilation_overrides_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._upsert_ai_decompilation_overrides_serialize( + _param = self._v3_get_ai_decompilation_line_attributions_serialize( function_id=function_id, - upsert_overrides_input_body=upsert_overrides_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4081,8 +4072,7 @@ def upsert_ai_decompilation_overrides_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UpsertOverridesData", - '400': "APIError", + '200': "LineAttributionsData", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4100,10 +4090,9 @@ def upsert_ai_decompilation_overrides_with_http_info( @validate_call - def upsert_ai_decompilation_overrides_without_preload_content( + def v3_get_ai_decompilation_line_attributions_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - upsert_overrides_input_body: UpsertOverridesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4117,14 +4106,12 @@ def upsert_ai_decompilation_overrides_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Upsert variable/function name overrides + """Get AI decompilation line attributions - Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Returns the correspondence between the function's disassembly line numbers and its AI-decompilation line numbers, grouped by disassembly line. Both sides are 0-indexed and the correspondence has a many-to-many relationship. The mapping is empty until a completed run has produced one, and is empty for a run that produced none. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error :param function_id: Function ID (required) :type function_id: int - :param upsert_overrides_input_body: (required) - :type upsert_overrides_input_body: UpsertOverridesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4147,9 +4134,8 @@ def upsert_ai_decompilation_overrides_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._upsert_ai_decompilation_overrides_serialize( + _param = self._v3_get_ai_decompilation_line_attributions_serialize( function_id=function_id, - upsert_overrides_input_body=upsert_overrides_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4157,8 +4143,7 @@ def upsert_ai_decompilation_overrides_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UpsertOverridesData", - '400': "APIError", + '200': "LineAttributionsData", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4171,10 +4156,9 @@ def upsert_ai_decompilation_overrides_without_preload_content( return response_data.response - def _upsert_ai_decompilation_overrides_serialize( + def _v3_get_ai_decompilation_line_attributions_serialize( self, function_id, - upsert_overrides_input_body, _request_auth, _content_type, _headers, @@ -4202,8 +4186,6 @@ def _upsert_ai_decompilation_overrides_serialize( # process the header parameters # process the form parameters # process the body parameter - if upsert_overrides_input_body is not None: - _body_params = upsert_overrides_input_body # set the HTTP header `Accept` @@ -4214,19 +4196,280 @@ def _upsert_ai_decompilation_overrides_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/line-attributions', + 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 v3_get_ai_decompilation_tokens( + 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, + ) -> GetTokensResponse: + """Get AI decompilation tokens and user overrides + + Returns the tokenised AI-decompilation source, the value each token resolves to, and the user's overrides as a separate unmerged map. The source is empty and the overrides are null until a run has succeeded. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_ai_decompilation_tokens_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': "GetTokensResponse", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_ai_decompilation_tokens_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[GetTokensResponse]: + """Get AI decompilation tokens and user overrides + + Returns the tokenised AI-decompilation source, the value each token resolves to, and the user's overrides as a separate unmerged map. The source is empty and the overrides are null until a run has succeeded. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_ai_decompilation_tokens_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': "GetTokensResponse", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_ai_decompilation_tokens_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get AI decompilation tokens and user overrides + + Returns the tokenised AI-decompilation source, the value each token resolves to, and the user's overrides as a separate unmerged map. The source is empty and the overrides are null until a run has succeeded. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_ai_decompilation_tokens_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': "GetTokensResponse", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_ai_decompilation_tokens_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + # authentication setting _auth_settings: List[str] = [ @@ -4235,8 +4478,8 @@ def _upsert_ai_decompilation_overrides_serialize( ] return self.api_client.param_serialize( - method='PATCH', - resource_path='/v3/functions/{function_id}/ai-decompilation/overrides', + method='GET', + resource_path='/v3/functions/{function_id}/ai-decompilation/tokens', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4253,10 +4496,10 @@ def _upsert_ai_decompilation_overrides_serialize( @validate_call - def upsert_ai_decompilation_rating( + def v3_upsert_ai_decompilation_overrides( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being rated")], - upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + upsert_overrides_input_body: UpsertOverridesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4269,14 +4512,15 @@ def upsert_ai_decompilation_rating( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponse: - """Upsert rating for AI decompilation + ) -> UpsertOverridesData: + """Upsert variable/function name overrides + Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error - :param function_id: The ID of the function being rated (required) + :param function_id: Function ID (required) :type function_id: int - :param upsert_ai_decomplation_rating_request: (required) - :type upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest + :param upsert_overrides_input_body: (required) + :type upsert_overrides_input_body: UpsertOverridesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4299,9 +4543,9 @@ def upsert_ai_decompilation_rating( :return: Returns the result object. """ # noqa: E501 - _param = self._upsert_ai_decompilation_rating_serialize( + _param = self._v3_upsert_ai_decompilation_overrides_serialize( function_id=function_id, - upsert_ai_decomplation_rating_request=upsert_ai_decomplation_rating_request, + upsert_overrides_input_body=upsert_overrides_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4309,8 +4553,12 @@ def upsert_ai_decompilation_rating( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", - '422': "BaseResponse", + '200': "UpsertOverridesData", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -4324,10 +4572,10 @@ def upsert_ai_decompilation_rating( @validate_call - def upsert_ai_decompilation_rating_with_http_info( + def v3_upsert_ai_decompilation_overrides_with_http_info( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being rated")], - upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + upsert_overrides_input_body: UpsertOverridesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4340,14 +4588,15 @@ def upsert_ai_decompilation_rating_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponse]: - """Upsert rating for AI decompilation + ) -> ApiResponse[UpsertOverridesData]: + """Upsert variable/function name overrides + Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error - :param function_id: The ID of the function being rated (required) + :param function_id: Function ID (required) :type function_id: int - :param upsert_ai_decomplation_rating_request: (required) - :type upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest + :param upsert_overrides_input_body: (required) + :type upsert_overrides_input_body: UpsertOverridesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4370,9 +4619,9 @@ def upsert_ai_decompilation_rating_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._upsert_ai_decompilation_rating_serialize( + _param = self._v3_upsert_ai_decompilation_overrides_serialize( function_id=function_id, - upsert_ai_decomplation_rating_request=upsert_ai_decomplation_rating_request, + upsert_overrides_input_body=upsert_overrides_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4380,8 +4629,12 @@ def upsert_ai_decompilation_rating_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", - '422': "BaseResponse", + '200': "UpsertOverridesData", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -4395,10 +4648,10 @@ def upsert_ai_decompilation_rating_with_http_info( @validate_call - def upsert_ai_decompilation_rating_without_preload_content( + def v3_upsert_ai_decompilation_overrides_without_preload_content( self, - function_id: Annotated[StrictInt, Field(description="The ID of the function being rated")], - upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + upsert_overrides_input_body: UpsertOverridesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4412,13 +4665,14 @@ def upsert_ai_decompilation_rating_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Upsert rating for AI decompilation + """Upsert variable/function name overrides + Applies user-provided name overrides to placeholder tokens in the decompilation. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error - :param function_id: The ID of the function being rated (required) + :param function_id: Function ID (required) :type function_id: int - :param upsert_ai_decomplation_rating_request: (required) - :type upsert_ai_decomplation_rating_request: UpsertAiDecomplationRatingRequest + :param upsert_overrides_input_body: (required) + :type upsert_overrides_input_body: UpsertOverridesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4441,9 +4695,9 @@ def upsert_ai_decompilation_rating_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._upsert_ai_decompilation_rating_serialize( + _param = self._v3_upsert_ai_decompilation_overrides_serialize( function_id=function_id, - upsert_ai_decomplation_rating_request=upsert_ai_decomplation_rating_request, + upsert_overrides_input_body=upsert_overrides_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4451,8 +4705,12 @@ def upsert_ai_decompilation_rating_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", - '422': "BaseResponse", + '200': "UpsertOverridesData", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -4461,10 +4719,10 @@ def upsert_ai_decompilation_rating_without_preload_content( return response_data.response - def _upsert_ai_decompilation_rating_serialize( + def _v3_upsert_ai_decompilation_overrides_serialize( self, function_id, - upsert_ai_decomplation_rating_request, + upsert_overrides_input_body, _request_auth, _content_type, _headers, @@ -4492,8 +4750,8 @@ def _upsert_ai_decompilation_rating_serialize( # process the header parameters # process the form parameters # process the body parameter - if upsert_ai_decomplation_rating_request is not None: - _body_params = upsert_ai_decomplation_rating_request + if upsert_overrides_input_body is not None: + _body_params = upsert_overrides_input_body # set the HTTP header `Accept` @@ -4526,7 +4784,7 @@ def _upsert_ai_decompilation_rating_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/v2/functions/{function_id}/ai-decompilation/rating', + resource_path='/v3/functions/{function_id}/ai-decompilation/overrides', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index 1301b8aa..ef75b8b6 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -1597,7 +1597,7 @@ def get_function_blocks_0( ) -> DisassemblyOutputBody: """Get function disassembly - Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. A function that carries no disassembly (externals, thunks) returns 200 with the block fields omitted; disassembly that exists but cannot be read yet returns 409 ANALYSIS_NOT_READY. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready :param function_id: Function ID (required) :type function_id: int @@ -1635,6 +1635,7 @@ def get_function_blocks_0( '200': "DisassemblyOutputBody", '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -1668,7 +1669,7 @@ def get_function_blocks_0_with_http_info( ) -> ApiResponse[DisassemblyOutputBody]: """Get function disassembly - Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. A function that carries no disassembly (externals, thunks) returns 200 with the block fields omitted; disassembly that exists but cannot be read yet returns 409 ANALYSIS_NOT_READY. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready :param function_id: Function ID (required) :type function_id: int @@ -1706,6 +1707,7 @@ def get_function_blocks_0_with_http_info( '200': "DisassemblyOutputBody", '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -1739,7 +1741,7 @@ def get_function_blocks_0_without_preload_content( ) -> RESTResponseType: """Get function disassembly - Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Returns the function's disassembly metadata (JSON blob containing basic blocks + local variables) along with parameter and return-type info. A function that carries no disassembly (externals, thunks) returns 200 with the block fields omitted; disassembly that exists but cannot be read yet returns 409 ANALYSIS_NOT_READY. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `409` [`ANALYSIS_NOT_READY`](/errors/ANALYSIS_NOT_READY) — Analysis Not Ready :param function_id: Function ID (required) :type function_id: int @@ -1777,6 +1779,7 @@ def get_function_blocks_0_without_preload_content( '200': "DisassemblyOutputBody", '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } diff --git a/revengai/api/functions_renaming_history_api.py b/revengai/api/functions_renaming_history_api.py index 4509c148..f80a471c 100644 --- a/revengai/api/functions_renaming_history_api.py +++ b/revengai/api/functions_renaming_history_api.py @@ -346,7 +346,7 @@ def batch_rename_functions( ) -> BatchRenameOutputBody: """Batch rename functions - Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param batch_rename_input_body: (required) :type batch_rename_input_body: BatchRenameInputBody @@ -417,7 +417,7 @@ def batch_rename_functions_with_http_info( ) -> ApiResponse[BatchRenameOutputBody]: """Batch rename functions - Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param batch_rename_input_body: (required) :type batch_rename_input_body: BatchRenameInputBody @@ -488,7 +488,7 @@ def batch_rename_functions_without_preload_content( ) -> RESTResponseType: """Batch rename functions - Renames multiple functions in a single request. Records name changes in history and copies data types from source functions. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Renames multiple functions in a single request. Records name changes in history. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request :param batch_rename_input_body: (required) :type batch_rename_input_body: BatchRenameInputBody diff --git a/revengai/api_client.py b/revengai/api_client.py index 4830d669..8475356a 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.131.2/python' + self.user_agent = 'OpenAPI-Generator/v4.4.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 3d9e6ecf..4f5d044a 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -541,8 +541,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.131.2\n"\ - "SDK Package Version: v3.131.2".\ + "Version of the API: v4.4.0\n"\ + "SDK Package Version: v4.4.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index 8a56575e..dc030c38 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -12,9 +12,6 @@ """ # noqa: E501 # import models into model package -from revengai.models.ai_decomp_function_mapping import AIDecompFunctionMapping -from revengai.models.ai_decomp_inverse_function_map_item import AIDecompInverseFunctionMapItem -from revengai.models.ai_decomp_inverse_string_map_item import AIDecompInverseStringMapItem from revengai.models.api_error import APIError from revengai.models.add_callee_input_body import AddCalleeInputBody from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody @@ -34,11 +31,14 @@ from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse +from revengai.models.analysis_data_types_group import AnalysisDataTypesGroup +from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody from revengai.models.analysis_detail_response import AnalysisDetailResponse from revengai.models.analysis_function_entry import AnalysisFunctionEntry from revengai.models.analysis_function_mapping import AnalysisFunctionMapping from revengai.models.analysis_functions import AnalysisFunctions from revengai.models.analysis_functions_list import AnalysisFunctionsList +from revengai.models.analysis_log_entry import AnalysisLogEntry from revengai.models.analysis_log_message import AnalysisLogMessage from revengai.models.analysis_logs import AnalysisLogs from revengai.models.analysis_record import AnalysisRecord @@ -63,12 +63,14 @@ 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.archive_content_entry import ArchiveContentEntry -from revengai.models.argument import Argument +from revengai.models.array_data_type import ArrayDataType +from revengai.models.array_definition import ArrayDefinition from revengai.models.artifact import Artifact 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_status_output_body import AutoUnstripStatusOutputBody +from revengai.models.base_data_type import BaseDataType from revengai.models.base_response import BaseResponse from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse from revengai.models.base_response_analysis_bulk_add_tags_response import BaseResponseAnalysisBulkAddTagsResponse @@ -103,13 +105,9 @@ from revengai.models.base_response_external_response import BaseResponseExternalResponse from revengai.models.base_response_function_blocks_response import BaseResponseFunctionBlocksResponse from revengai.models.base_response_function_capability_response import BaseResponseFunctionCapabilityResponse -from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList from revengai.models.base_response_function_search_response import BaseResponseFunctionSearchResponse from revengai.models.base_response_function_strings_response import BaseResponseFunctionStringsResponse from revengai.models.base_response_functions_detail_response import BaseResponseFunctionsDetailResponse -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_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 @@ -135,14 +133,11 @@ from revengai.models.base_response_xref_response import BaseResponseXrefResponse from revengai.models.basic import Basic from revengai.models.batch_binary_match_result import BatchBinaryMatchResult +from revengai.models.batch_function_signature_entry import BatchFunctionSignatureEntry from revengai.models.batch_matching_output_body import BatchMatchingOutputBody from revengai.models.batch_rename_input_body import BatchRenameInputBody from revengai.models.batch_rename_item import BatchRenameItem from revengai.models.batch_rename_output_body import BatchRenameOutputBody -from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody -from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem -from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody -from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus from revengai.models.binary import Binary @@ -154,6 +149,7 @@ from revengai.models.binary_search_response import BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult from revengai.models.binary_task_status import BinaryTaskStatus +from revengai.models.bitfield_data_type import BitfieldDataType from revengai.models.bulk_create_user_result import BulkCreateUserResult from revengai.models.bulk_create_users_output_body import BulkCreateUsersOutputBody from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest @@ -197,20 +193,40 @@ from revengai.models.conversation import Conversation from revengai.models.conversation_context import ConversationContext from revengai.models.conversation_with_events import ConversationWithEvents +from revengai.models.copy_function_signatures_input_body import CopyFunctionSignaturesInputBody +from revengai.models.copy_function_signatures_output_body import CopyFunctionSignaturesOutputBody +from revengai.models.copy_signature_item import CopySignatureItem from revengai.models.create_ai_decomp_output_body import CreateAIDecompOutputBody +from revengai.models.create_analysis_data_types_input_body import CreateAnalysisDataTypesInputBody +from revengai.models.create_array_data_type import CreateArrayDataType +from revengai.models.create_base_data_type import CreateBaseDataType +from revengai.models.create_bitfield_data_type import CreateBitfieldDataType from revengai.models.create_checkout_session_input_body import CreateCheckoutSessionInputBody from revengai.models.create_collection_input_body import CreateCollectionInputBody from revengai.models.create_collection_output_body import CreateCollectionOutputBody from revengai.models.create_conversation_request import CreateConversationRequest +from revengai.models.create_data_type_entry import CreateDataTypeEntry +from revengai.models.create_enum_data_type import CreateEnumDataType +from revengai.models.create_function_data_type import CreateFunctionDataType from revengai.models.create_group_input_body import CreateGroupInputBody from revengai.models.create_identity_input_body import CreateIdentityInputBody from revengai.models.create_issuer_input_body import CreateIssuerInputBody from revengai.models.create_organisation_input_body import CreateOrganisationInputBody +from revengai.models.create_pointer_data_type import CreatePointerDataType from revengai.models.create_portal_session_input_body import CreatePortalSessionInputBody +from revengai.models.create_struct_data_type import CreateStructDataType from revengai.models.create_team_input_body import CreateTeamInputBody +from revengai.models.create_typedef_data_type import CreateTypedefDataType +from revengai.models.create_union_data_type import CreateUnionDataType +from revengai.models.create_unknown_data_type import CreateUnknownDataType from revengai.models.create_user_input_body import CreateUserInputBody from revengai.models.created import Created -from revengai.models.data_types_entry import DataTypesEntry +from revengai.models.data_type_entry import DataTypeEntry +from revengai.models.data_type_enum_value_entry import DataTypeEnumValueEntry +from revengai.models.data_type_function_entry import DataTypeFunctionEntry +from revengai.models.data_type_function_parameter_entry import DataTypeFunctionParameterEntry +from revengai.models.data_type_member_entry import DataTypeMemberEntry +from revengai.models.data_type_version import DataTypeVersion from revengai.models.decomp_failed_event import DecompFailedEvent from revengai.models.decomp_finished_event import DecompFinishedEvent from revengai.models.decompilation_comment_context import DecompilationCommentContext @@ -230,7 +246,8 @@ from revengai.models.elf_symbol import ELFSymbol from revengai.models.elf_dynamic_entry import ElfDynamicEntry from revengai.models.entrypoint_model import EntrypointModel -from revengai.models.enumeration import Enumeration +from revengai.models.enum_data_type import EnumDataType +from revengai.models.enum_definition import EnumDefinition from revengai.models.error_body import ErrorBody from revengai.models.error_model import ErrorModel from revengai.models.event import Event @@ -270,22 +287,14 @@ from revengai.models.file_metadata import FileMetadata from revengai.models.filters import Filters from revengai.models.form_file import FormFile -from revengai.models.function_argument import FunctionArgument from revengai.models.function_block_destination_response import FunctionBlockDestinationResponse from revengai.models.function_block_response import FunctionBlockResponse from revengai.models.function_blocks_response import FunctionBlocksResponse from revengai.models.function_boundary import FunctionBoundary from revengai.models.function_call_edges import FunctionCallEdges from revengai.models.function_capability_response import FunctionCapabilityResponse -from revengai.models.function_data_types import FunctionDataTypes -from revengai.models.function_data_types_list import FunctionDataTypesList -from revengai.models.function_data_types_list_item import FunctionDataTypesListItem -from revengai.models.function_data_types_params import FunctionDataTypesParams -from revengai.models.function_data_types_status import FunctionDataTypesStatus -from revengai.models.function_dependency import FunctionDependency +from revengai.models.function_data_type import FunctionDataType from revengai.models.function_details_output_body import FunctionDetailsOutputBody -from revengai.models.function_header import FunctionHeader -from revengai.models.function_info import FunctionInfo from revengai.models.function_list_item import FunctionListItem from revengai.models.function_local_variable_response import FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping @@ -296,28 +305,32 @@ from revengai.models.function_rename_map import FunctionRenameMap from revengai.models.function_search_response import FunctionSearchResponse from revengai.models.function_search_result import FunctionSearchResult +from revengai.models.function_signature_body import FunctionSignatureBody +from revengai.models.function_signature_entry import FunctionSignatureEntry +from revengai.models.function_signature_version import FunctionSignatureVersion from revengai.models.function_source_type import FunctionSourceType -from revengai.models.function_stack_variable import FunctionStackVariable from revengai.models.function_string import FunctionString from revengai.models.function_string_item import FunctionStringItem from revengai.models.function_strings_response import FunctionStringsResponse -from revengai.models.function_type import FunctionType +from revengai.models.function_type_definition import FunctionTypeDefinition from revengai.models.functions_detail_response import FunctionsDetailResponse from revengai.models.functions_list_rename import FunctionsListRename -from revengai.models.generate_function_data_types import GenerateFunctionDataTypes from revengai.models.generate_pdf_output_body import GeneratePDFOutputBody -from revengai.models.generation_status_list import GenerationStatusList from revengai.models.get_additional_details_output_body import GetAdditionalDetailsOutputBody from revengai.models.get_additional_details_status_output_body import GetAdditionalDetailsStatusOutputBody from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse +from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody +from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody +from revengai.models.get_function_signature_history_body import GetFunctionSignatureHistoryBody from revengai.models.get_matches_output_body import GetMatchesOutputBody from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody from revengai.models.get_products_output_body import GetProductsOutputBody from revengai.models.get_public_user_response import GetPublicUserResponse from revengai.models.get_subscription_output_body import GetSubscriptionOutputBody -from revengai.models.global_variable import GlobalVariable +from revengai.models.get_tokens_response import GetTokensResponse +from revengai.models.history_actor import HistoryActor from revengai.models.history_entry import HistoryEntry from revengai.models.http_request import HttpRequest from revengai.models.ioc import IOC @@ -333,16 +346,18 @@ from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest from revengai.models.invite_user_input_body import InviteUserInputBody from revengai.models.issuer_allowed_domain import IssuerAllowedDomain +from revengai.models.line_attributions_data import LineAttributionsData from revengai.models.list_analyses_output_body import ListAnalysesOutputBody -from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody +from revengai.models.list_analysis_data_types_output_body import ListAnalysisDataTypesOutputBody from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.models.list_archive_contents_output_body import ListArchiveContentsOutputBody from revengai.models.list_collection_results import ListCollectionResults from revengai.models.list_collections_output_body import ListCollectionsOutputBody +from revengai.models.list_data_type_functions_body import ListDataTypeFunctionsBody from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody +from revengai.models.list_function_signatures_output_body import ListFunctionSignaturesOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody -from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody from revengai.models.list_teams_output_body import ListTeamsOutputBody from revengai.models.list_users_output_body import ListUsersOutputBody @@ -382,6 +397,8 @@ from revengai.models.pcap_body_info import PcapBodyInfo from revengai.models.permissions import Permissions from revengai.models.platform import Platform +from revengai.models.pointer_data_type import PointerDataType +from revengai.models.pointer_definition import PointerDefinition from revengai.models.price_output import PriceOutput from revengai.models.price_summary import PriceSummary from revengai.models.process_activity_entry import ProcessActivityEntry @@ -406,11 +423,13 @@ 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 +from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult +from revengai.models.rendered_token import RenderedToken from revengai.models.report_analysis_response import ReportAnalysisResponse from revengai.models.report_event import ReportEvent from revengai.models.report_info import ReportInfo from revengai.models.report_options import ReportOptions +from revengai.models.resolved_entity import ResolvedEntity from revengai.models.revoke_body import RevokeBody from revengai.models.sso_provider import SSOProvider from revengai.models.sso_providers_output_body import SSOProvidersOutputBody @@ -425,6 +444,10 @@ from revengai.models.send_message_request import SendMessageRequest from revengai.models.service_entry import ServiceEntry from revengai.models.session_output_body import SessionOutputBody +from revengai.models.signature_parameter_entry import SignatureParameterEntry +from revengai.models.signature_parameter_input import SignatureParameterInput +from revengai.models.signature_storage_entry import SignatureStorageEntry +from revengai.models.signature_storage_input import SignatureStorageInput from revengai.models.single_code_certificate_model import SingleCodeCertificateModel from revengai.models.single_code_signature_model import SingleCodeSignatureModel from revengai.models.single_pdb_entry_model import SinglePDBEntryModel @@ -448,12 +471,12 @@ from revengai.models.sse_event_tool_call_result_data import SseEventToolCallResultData from revengai.models.sse_event_tool_call_start_data import SseEventToolCallStartData from revengai.models.sse_event_tool_confirmation_required_data import SseEventToolConfirmationRequiredData -from revengai.models.stack_variable import StackVariable from revengai.models.start_batch_matching_input_body import StartBatchMatchingInputBody from revengai.models.start_matching_for_analysis_input_body import StartMatchingForAnalysisInputBody from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody from revengai.models.start_matching_output_body import StartMatchingOutputBody from revengai.models.startup_info import StartupInfo +from revengai.models.status_body import StatusBody from revengai.models.status_input import StatusInput from revengai.models.status_output import StatusOutput from revengai.models.status_response import StatusResponse @@ -461,8 +484,8 @@ from revengai.models.stream_events200_response_inner import StreamEvents200ResponseInner from revengai.models.string_functions import StringFunctions from revengai.models.string_source import StringSource -from revengai.models.structure import Structure -from revengai.models.structure_member import StructureMember +from revengai.models.struct_data_type import StructDataType +from revengai.models.struct_definition import StructDefinition from revengai.models.submit_user_feedback_request import SubmitUserFeedbackRequest from revengai.models.summary_data import SummaryData from revengai.models.symbols import Symbols @@ -478,21 +501,38 @@ from revengai.models.team import Team from revengai.models.team_member import TeamMember from revengai.models.timestamp_model import TimestampModel +from revengai.models.token import Token from revengai.models.token_input_body import TokenInputBody from revengai.models.token_response import TokenResponse from revengai.models.tokenised_data import TokenisedData from revengai.models.triage_function_response import TriageFunctionResponse from revengai.models.triage_report_response import TriageReportResponse from revengai.models.trigger_dynamic_execution_input_body import TriggerDynamicExecutionInputBody +from revengai.models.trigger_rename_unnamed_functions_input_body import TriggerRenameUnnamedFunctionsInputBody from revengai.models.ttp import Ttp -from revengai.models.type_definition import TypeDefinition -from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody -from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody +from revengai.models.typedef_data_type import TypedefDataType +from revengai.models.typedef_definition import TypedefDefinition +from revengai.models.union_data_type import UnionDataType +from revengai.models.union_definition import UnionDefinition +from revengai.models.unknown_data_type import UnknownDataType +from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody +from revengai.models.update_array_data_type import UpdateArrayDataType +from revengai.models.update_base_data_type import UpdateBaseDataType +from revengai.models.update_bitfield_data_type import UpdateBitfieldDataType +from revengai.models.update_data_type_entry import UpdateDataTypeEntry +from revengai.models.update_enum_data_type import UpdateEnumDataType +from revengai.models.update_function_data_type import UpdateFunctionDataType +from revengai.models.update_function_signature_input_body import UpdateFunctionSignatureInputBody from revengai.models.update_issuer_input_body import UpdateIssuerInputBody from revengai.models.update_organisation_input_body import UpdateOrganisationInputBody from revengai.models.update_password_input_body import UpdatePasswordInputBody +from revengai.models.update_pointer_data_type import UpdatePointerDataType from revengai.models.update_profile_input_body import UpdateProfileInputBody +from revengai.models.update_struct_data_type import UpdateStructDataType from revengai.models.update_team_input_body import UpdateTeamInputBody +from revengai.models.update_typedef_data_type import UpdateTypedefDataType +from revengai.models.update_union_data_type import UpdateUnionDataType +from revengai.models.update_unknown_data_type import UpdateUnknownDataType from revengai.models.update_user_credits_input_body import UpdateUserCreditsInputBody from revengai.models.update_user_input_body import UpdateUserInputBody from revengai.models.update_user_password_input_body import UpdateUserPasswordInputBody @@ -506,10 +546,6 @@ from revengai.models.user_credits import UserCredits from revengai.models.user_identity import UserIdentity from revengai.models.user_profile import UserProfile -from revengai.models.v2_function_header import V2FunctionHeader -from revengai.models.v2_function_info import V2FunctionInfo -from revengai.models.v2_function_info_func_deps_inner import V2FunctionInfoFuncDepsInner -from revengai.models.v2_function_type import V2FunctionType from revengai.models.warning_event import WarningEvent from revengai.models.workflow_progress import WorkflowProgress from revengai.models.workspace import Workspace diff --git a/revengai/models/ai_decomp_function_mapping.py b/revengai/models/ai_decomp_function_mapping.py deleted file mode 100644 index 7cb55f2a..00000000 --- a/revengai/models/ai_decomp_function_mapping.py +++ /dev/null @@ -1,290 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from revengai.models.ai_decomp_inverse_function_map_item import AIDecompInverseFunctionMapItem -from revengai.models.ai_decomp_inverse_string_map_item import AIDecompInverseStringMapItem -from revengai.models.replacement_value import ReplacementValue -from typing import Optional, Set -from typing_extensions import Self - -class AIDecompFunctionMapping(BaseModel): - """ - AIDecompFunctionMapping - """ # noqa: E501 - fields: Dict[str, Dict[str, ReplacementValue]] - inverse_function_map: Dict[str, AIDecompInverseFunctionMapItem] - inverse_string_map: Dict[str, AIDecompInverseStringMapItem] - unmatched_custom_function_pointers: Dict[str, ReplacementValue] - unmatched_custom_types: Dict[str, ReplacementValue] - unmatched_enums: Dict[str, ReplacementValue] - unmatched_external_vars: Dict[str, ReplacementValue] - unmatched_functions: Dict[str, ReplacementValue] - unmatched_global_vars: Dict[str, ReplacementValue] - unmatched_go_to_labels: Dict[str, ReplacementValue] - unmatched_strings: Dict[str, ReplacementValue] - unmatched_variadic_lists: Dict[str, ReplacementValue] - unmatched_vars: Dict[str, ReplacementValue] - user_override_mappings: Dict[str, StrictStr] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["fields", "inverse_function_map", "inverse_string_map", "unmatched_custom_function_pointers", "unmatched_custom_types", "unmatched_enums", "unmatched_external_vars", "unmatched_functions", "unmatched_global_vars", "unmatched_go_to_labels", "unmatched_strings", "unmatched_variadic_lists", "unmatched_vars", "user_override_mappings"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AIDecompFunctionMapping from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each value in fields (dict) - _field_dict = {} - if self.fields: - for _key_fields in self.fields: - if self.fields[_key_fields]: - _field_dict[_key_fields] = self.fields[_key_fields].to_dict() - _dict['fields'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in inverse_function_map (dict) - _field_dict = {} - if self.inverse_function_map: - for _key_inverse_function_map in self.inverse_function_map: - if self.inverse_function_map[_key_inverse_function_map]: - _field_dict[_key_inverse_function_map] = self.inverse_function_map[_key_inverse_function_map].to_dict() - _dict['inverse_function_map'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in inverse_string_map (dict) - _field_dict = {} - if self.inverse_string_map: - for _key_inverse_string_map in self.inverse_string_map: - if self.inverse_string_map[_key_inverse_string_map]: - _field_dict[_key_inverse_string_map] = self.inverse_string_map[_key_inverse_string_map].to_dict() - _dict['inverse_string_map'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_custom_function_pointers (dict) - _field_dict = {} - if self.unmatched_custom_function_pointers: - for _key_unmatched_custom_function_pointers in self.unmatched_custom_function_pointers: - if self.unmatched_custom_function_pointers[_key_unmatched_custom_function_pointers]: - _field_dict[_key_unmatched_custom_function_pointers] = self.unmatched_custom_function_pointers[_key_unmatched_custom_function_pointers].to_dict() - _dict['unmatched_custom_function_pointers'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_custom_types (dict) - _field_dict = {} - if self.unmatched_custom_types: - for _key_unmatched_custom_types in self.unmatched_custom_types: - if self.unmatched_custom_types[_key_unmatched_custom_types]: - _field_dict[_key_unmatched_custom_types] = self.unmatched_custom_types[_key_unmatched_custom_types].to_dict() - _dict['unmatched_custom_types'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_enums (dict) - _field_dict = {} - if self.unmatched_enums: - for _key_unmatched_enums in self.unmatched_enums: - if self.unmatched_enums[_key_unmatched_enums]: - _field_dict[_key_unmatched_enums] = self.unmatched_enums[_key_unmatched_enums].to_dict() - _dict['unmatched_enums'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_external_vars (dict) - _field_dict = {} - if self.unmatched_external_vars: - for _key_unmatched_external_vars in self.unmatched_external_vars: - if self.unmatched_external_vars[_key_unmatched_external_vars]: - _field_dict[_key_unmatched_external_vars] = self.unmatched_external_vars[_key_unmatched_external_vars].to_dict() - _dict['unmatched_external_vars'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_functions (dict) - _field_dict = {} - if self.unmatched_functions: - for _key_unmatched_functions in self.unmatched_functions: - if self.unmatched_functions[_key_unmatched_functions]: - _field_dict[_key_unmatched_functions] = self.unmatched_functions[_key_unmatched_functions].to_dict() - _dict['unmatched_functions'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_global_vars (dict) - _field_dict = {} - if self.unmatched_global_vars: - for _key_unmatched_global_vars in self.unmatched_global_vars: - if self.unmatched_global_vars[_key_unmatched_global_vars]: - _field_dict[_key_unmatched_global_vars] = self.unmatched_global_vars[_key_unmatched_global_vars].to_dict() - _dict['unmatched_global_vars'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_go_to_labels (dict) - _field_dict = {} - if self.unmatched_go_to_labels: - for _key_unmatched_go_to_labels in self.unmatched_go_to_labels: - if self.unmatched_go_to_labels[_key_unmatched_go_to_labels]: - _field_dict[_key_unmatched_go_to_labels] = self.unmatched_go_to_labels[_key_unmatched_go_to_labels].to_dict() - _dict['unmatched_go_to_labels'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_strings (dict) - _field_dict = {} - if self.unmatched_strings: - for _key_unmatched_strings in self.unmatched_strings: - if self.unmatched_strings[_key_unmatched_strings]: - _field_dict[_key_unmatched_strings] = self.unmatched_strings[_key_unmatched_strings].to_dict() - _dict['unmatched_strings'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_variadic_lists (dict) - _field_dict = {} - if self.unmatched_variadic_lists: - for _key_unmatched_variadic_lists in self.unmatched_variadic_lists: - if self.unmatched_variadic_lists[_key_unmatched_variadic_lists]: - _field_dict[_key_unmatched_variadic_lists] = self.unmatched_variadic_lists[_key_unmatched_variadic_lists].to_dict() - _dict['unmatched_variadic_lists'] = _field_dict - # override the default output from pydantic by calling `to_dict()` of each value in unmatched_vars (dict) - _field_dict = {} - if self.unmatched_vars: - for _key_unmatched_vars in self.unmatched_vars: - if self.unmatched_vars[_key_unmatched_vars]: - _field_dict[_key_unmatched_vars] = self.unmatched_vars[_key_unmatched_vars].to_dict() - _dict['unmatched_vars'] = _field_dict - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AIDecompFunctionMapping from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "fields": dict( - (_k, dict( - (_ik, ReplacementValue.from_dict(_iv)) - for _ik, _iv in _v.items() - ) - if _v is not None - else None - ) - for _k, _v in obj.get("fields").items() - ) - if obj.get("fields") is not None - else None, - "inverse_function_map": dict( - (_k, AIDecompInverseFunctionMapItem.from_dict(_v)) - for _k, _v in obj["inverse_function_map"].items() - ) - if obj.get("inverse_function_map") is not None - else None, - "inverse_string_map": dict( - (_k, AIDecompInverseStringMapItem.from_dict(_v)) - for _k, _v in obj["inverse_string_map"].items() - ) - if obj.get("inverse_string_map") is not None - else None, - "unmatched_custom_function_pointers": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_custom_function_pointers"].items() - ) - if obj.get("unmatched_custom_function_pointers") is not None - else None, - "unmatched_custom_types": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_custom_types"].items() - ) - if obj.get("unmatched_custom_types") is not None - else None, - "unmatched_enums": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_enums"].items() - ) - if obj.get("unmatched_enums") is not None - else None, - "unmatched_external_vars": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_external_vars"].items() - ) - if obj.get("unmatched_external_vars") is not None - else None, - "unmatched_functions": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_functions"].items() - ) - if obj.get("unmatched_functions") is not None - else None, - "unmatched_global_vars": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_global_vars"].items() - ) - if obj.get("unmatched_global_vars") is not None - else None, - "unmatched_go_to_labels": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_go_to_labels"].items() - ) - if obj.get("unmatched_go_to_labels") is not None - else None, - "unmatched_strings": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_strings"].items() - ) - if obj.get("unmatched_strings") is not None - else None, - "unmatched_variadic_lists": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_variadic_lists"].items() - ) - if obj.get("unmatched_variadic_lists") is not None - else None, - "unmatched_vars": dict( - (_k, ReplacementValue.from_dict(_v)) - for _k, _v in obj["unmatched_vars"].items() - ) - if obj.get("unmatched_vars") is not None - else None, - "user_override_mappings": obj.get("user_override_mappings") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/revengai/models/analysis_basic_info_output_body.py b/revengai/models/analysis_basic_info_output_body.py index b130e019..0f66cc7e 100644 --- a/revengai/models/analysis_basic_info_output_body.py +++ b/revengai/models/analysis_basic_info_output_body.py @@ -34,6 +34,9 @@ class AnalysisBasicInfoOutputBody(BaseModel): binary_uuid: StrictStr = Field(description="UUID of the binary, omitted when not set") creation: datetime = Field(description="When the binary was uploaded") debug: StrictBool = Field(description="True when the binary was analysed with debug symbols") + detected_architecture: StrictStr = Field(description="Detected instruction-set architecture; empty when unavailable") + detected_binary_format: StrictStr = Field(description="Detected binary container format; empty when unavailable") + detected_binary_type: StrictStr = Field(description="Detected operating-system platform; empty when unavailable") function_count: StrictInt = Field(description="Number of functions in the binary") is_advanced: StrictBool = Field(description="True when the analysis was run in advanced mode") is_owner: StrictBool = Field(description="True when the caller is the analysis owner") @@ -43,9 +46,12 @@ class AnalysisBasicInfoOutputBody(BaseModel): owner_username: StrictStr = Field(description="Username of the analysis owner") sequencer_version: Optional[StrictStr] = Field(default=None, description="Sequencer version, omitted when not set") sha_256_hash: StrictStr = Field(description="SHA-256 hash of the binary") + supplied_architecture: StrictStr = Field(description="User-supplied instruction-set architecture; \"AUTO\" when not overridden") + supplied_binary_format: StrictStr = Field(description="User-supplied binary container format; \"AUTO\" when not overridden") + supplied_binary_type: StrictStr = Field(description="User-supplied operating-system platform; \"AUTO\" when not overridden") team_id: StrictInt = Field(description="Team ID of the analysis") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "owner_username", "sequencer_version", "sha_256_hash", "team_id"] + __properties: ClassVar[List[str]] = ["analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "binary_uuid", "creation", "debug", "detected_architecture", "detected_binary_format", "detected_binary_type", "function_count", "is_advanced", "is_owner", "is_system", "model_id", "model_name", "owner_username", "sequencer_version", "sha_256_hash", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "team_id"] @field_validator('analysis_scope') def analysis_scope_validate_enum(cls, value): @@ -125,6 +131,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "binary_uuid": obj.get("binary_uuid"), "creation": obj.get("creation"), "debug": obj.get("debug"), + "detected_architecture": obj.get("detected_architecture"), + "detected_binary_format": obj.get("detected_binary_format"), + "detected_binary_type": obj.get("detected_binary_type"), "function_count": obj.get("function_count"), "is_advanced": obj.get("is_advanced"), "is_owner": obj.get("is_owner"), @@ -134,6 +143,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "owner_username": obj.get("owner_username"), "sequencer_version": obj.get("sequencer_version"), "sha_256_hash": obj.get("sha_256_hash"), + "supplied_architecture": obj.get("supplied_architecture"), + "supplied_binary_format": obj.get("supplied_binary_format"), + "supplied_binary_type": obj.get("supplied_binary_type"), "team_id": obj.get("team_id") }) # store additional fields in additional_properties diff --git a/revengai/models/list_functions_data_types_output_body.py b/revengai/models/analysis_data_types_group.py similarity index 82% rename from revengai/models/list_functions_data_types_output_body.py rename to revengai/models/analysis_data_types_group.py index 8e5b57e6..c487f692 100644 --- a/revengai/models/list_functions_data_types_output_body.py +++ b/revengai/models/analysis_data_types_group.py @@ -16,19 +16,20 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.data_types_entry import DataTypesEntry +from revengai.models.data_type_entry import DataTypeEntry from typing import Optional, Set from typing_extensions import Self -class ListFunctionsDataTypesOutputBody(BaseModel): +class AnalysisDataTypesGroup(BaseModel): """ - ListFunctionsDataTypesOutputBody + AnalysisDataTypesGroup """ # noqa: E501 - items: Optional[List[DataTypesEntry]] + analysis_id: StrictInt + items: Optional[List[DataTypeEntry]] = Field(description="The analysis's types the returned signatures name, ordered by data_type_id.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["items"] + __properties: ClassVar[List[str]] = ["analysis_id", "items"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListFunctionsDataTypesOutputBody from a JSON string""" + """Create an instance of AnalysisDataTypesGroup from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -92,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListFunctionsDataTypesOutputBody from a dict""" + """Create an instance of AnalysisDataTypesGroup from a dict""" if obj is None: return None @@ -100,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "items": [DataTypesEntry.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + "analysis_id": obj.get("analysis_id"), + "items": [DataTypeEntry.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/update_data_types_input_body.py b/revengai/models/analysis_data_types_output_body.py similarity index 76% rename from revengai/models/update_data_types_input_body.py rename to revengai/models/analysis_data_types_output_body.py index c7f35a5c..50cdfec7 100644 --- a/revengai/models/update_data_types_input_body.py +++ b/revengai/models/analysis_data_types_output_body.py @@ -18,18 +18,17 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated +from revengai.models.data_type_entry import DataTypeEntry from typing import Optional, Set from typing_extensions import Self -class UpdateDataTypesInputBody(BaseModel): +class AnalysisDataTypesOutputBody(BaseModel): """ - UpdateDataTypesInputBody + AnalysisDataTypesOutputBody """ # noqa: E501 - data_types: Optional[Any] - data_types_version: Annotated[int, Field(strict=True, ge=0)] = Field(description="Current version of the function data types. The update is rejected if the stored version has moved on. Pass 0 on the first write.") + data_types: Optional[List[DataTypeEntry]] = Field(description="The stored types, ordered by data_type_id.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data_types", "data_types_version"] + __properties: ClassVar[List[str]] = ["data_types"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateDataTypesInputBody from a JSON string""" + """Create an instance of AnalysisDataTypesOutputBody from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,6 +71,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -86,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateDataTypesInputBody from a dict""" + """Create an instance of AnalysisDataTypesOutputBody from a dict""" if obj is None: return None @@ -94,8 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "data_types": obj.get("data_types"), - "data_types_version": obj.get("data_types_version") + "data_types": [DataTypeEntry.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/analysis_log_entry.py b/revengai/models/analysis_log_entry.py new file mode 100644 index 00000000..c686362a --- /dev/null +++ b/revengai/models/analysis_log_entry.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisLogEntry(BaseModel): + """ + AnalysisLogEntry + """ # noqa: E501 + level: StrictStr = Field(description="Severity") + source: StrictStr = Field(description="Component that emitted the line") + text: StrictStr = Field(description="Log line text") + timestamp: datetime = Field(description="When the line was emitted (UTC)") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["level", "source", "text", "timestamp"] + + @field_validator('level') + def level_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['INFO', 'WARN', 'ERROR', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('INFO', 'WARN', 'ERROR', '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 AnalysisLogEntry 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 AnalysisLogEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "level": obj.get("level"), + "source": obj.get("source"), + "text": obj.get("text"), + "timestamp": obj.get("timestamp") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_record_body.py b/revengai/models/analysis_record_body.py index 09c070c8..2b2902b4 100644 --- a/revengai/models/analysis_record_body.py +++ b/revengai/models/analysis_record_body.py @@ -34,16 +34,22 @@ class AnalysisRecordBody(BaseModel): binary_name: StrictStr = Field(description="Binary filename") binary_size: StrictInt = Field(description="Binary size in bytes") creation: datetime = Field(description="When the analysis was created") + detected_architecture: StrictStr = Field(description="Detected instruction-set architecture; empty when unavailable") + detected_binary_format: StrictStr = Field(description="Detected binary container format; empty when unavailable") + detected_binary_type: StrictStr = Field(description="Detected operating-system platform; empty when unavailable") function_boundaries_hash: StrictStr = Field(description="Hash of the binary's provided function boundaries") is_owner: StrictBool = Field(description="True when the caller owns the analysis") model_id: StrictInt = Field(description="Model ID") model_name: StrictStr = Field(description="Model name") sha_256_hash: StrictStr = Field(description="SHA-256 hash of the binary") status: StrictStr = Field(description="Analysis status") + supplied_architecture: StrictStr = Field(description="User-supplied instruction-set architecture; \"AUTO\" when not overridden") + supplied_binary_format: StrictStr = Field(description="User-supplied binary container format; \"AUTO\" when not overridden") + supplied_binary_type: StrictStr = Field(description="User-supplied operating-system platform; \"AUTO\" when not overridden") tags: Optional[List[AnalysisTagBody]] = Field(description="Tags associated with the binary") username: StrictStr = Field(description="Username of the analysis owner") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["analysis_id", "analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "function_boundaries_hash", "is_owner", "model_id", "model_name", "sha_256_hash", "status", "tags", "username"] + __properties: ClassVar[List[str]] = ["analysis_id", "analysis_scope", "base_address", "binary_id", "binary_name", "binary_size", "creation", "detected_architecture", "detected_binary_format", "detected_binary_type", "function_boundaries_hash", "is_owner", "model_id", "model_name", "sha_256_hash", "status", "supplied_architecture", "supplied_binary_format", "supplied_binary_type", "tags", "username"] @field_validator('analysis_scope') def analysis_scope_validate_enum(cls, value): @@ -129,12 +135,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "binary_name": obj.get("binary_name"), "binary_size": obj.get("binary_size"), "creation": obj.get("creation"), + "detected_architecture": obj.get("detected_architecture"), + "detected_binary_format": obj.get("detected_binary_format"), + "detected_binary_type": obj.get("detected_binary_type"), "function_boundaries_hash": obj.get("function_boundaries_hash"), "is_owner": obj.get("is_owner"), "model_id": obj.get("model_id"), "model_name": obj.get("model_name"), "sha_256_hash": obj.get("sha_256_hash"), "status": obj.get("status"), + "supplied_architecture": obj.get("supplied_architecture"), + "supplied_binary_format": obj.get("supplied_binary_format"), + "supplied_binary_type": obj.get("supplied_binary_type"), "tags": [AnalysisTagBody.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, "username": obj.get("username") }) diff --git a/revengai/models/argument.py b/revengai/models/argument.py deleted file mode 100644 index 451e5dfb..00000000 --- a/revengai/models/argument.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class Argument(BaseModel): - """ - Argument - """ # noqa: E501 - last_change: Optional[StrictStr] = None - offset: StrictInt = Field(description="Offset of the argument in the function signature") - name: StrictStr = Field(description="Name of the argument") - type: StrictStr = Field(description="Data type of the argument") - size: StrictInt = Field(description="Size of the argument in bytes") - __properties: ClassVar[List[str]] = ["last_change", "offset", "name", "type", "size"] - - 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 Argument 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, - ) - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Argument from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "offset": obj.get("offset"), - "name": obj.get("name"), - "type": obj.get("type"), - "size": obj.get("size") - }) - return _obj - - diff --git a/revengai/models/array_data_type.py b/revengai/models/array_data_type.py new file mode 100644 index 00000000..39fd7dcf --- /dev/null +++ b/revengai/models/array_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.array_definition import ArrayDefinition +from typing import Optional, Set +from typing_extensions import Self + +class ArrayDataType(BaseModel): + """ + ArrayDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[ArrayDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ARRAY', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ARRAY', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 ArrayDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArrayDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": ArrayDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_argument.py b/revengai/models/array_definition.py similarity index 79% rename from revengai/models/function_argument.py rename to revengai/models/array_definition.py index 3a5b7555..a9848522 100644 --- a/revengai/models/function_argument.py +++ b/revengai/models/array_definition.py @@ -16,23 +16,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class FunctionArgument(BaseModel): +class ArrayDefinition(BaseModel): """ - FunctionArgument + ArrayDefinition """ # noqa: E501 - last_change: Optional[StrictStr] = None - name: StrictStr - offset: StrictInt - scope: Optional[StrictStr] = None - size: StrictInt - type: StrictStr + count: Optional[StrictInt] = Field(default=None, description="Element count. Zero is a genuinely empty trailing array; absent means it could not be determined.") + element_data_type_id: Optional[StrictInt] = Field(default=None, description="The element type.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["last_change", "name", "offset", "scope", "size", "type"] + __properties: ClassVar[List[str]] = ["count", "element_data_type_id"] model_config = ConfigDict( populate_by_name=True, @@ -52,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionArgument from a JSON string""" + """Create an instance of ArrayDefinition from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionArgument from a dict""" + """Create an instance of ArrayDefinition from a dict""" if obj is None: return None @@ -92,12 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "offset": obj.get("offset"), - "scope": obj.get("scope"), - "size": obj.get("size"), - "type": obj.get("type") + "count": obj.get("count"), + "element_data_type_id": obj.get("element_data_type_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/base_data_type.py b/revengai/models/base_data_type.py new file mode 100644 index 00000000..17ef7fa9 --- /dev/null +++ b/revengai/models/base_data_type.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BaseDataType(BaseModel): + """ + BaseDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BASE', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('BASE', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 BaseDataType 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 BaseDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/base_response_function_data_types.py b/revengai/models/base_response_function_data_types.py deleted file mode 100644 index 40151d0b..00000000 --- a/revengai/models/base_response_function_data_types.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.function_data_types import FunctionDataTypes -from revengai.models.meta_model import MetaModel -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseFunctionDataTypes(BaseModel): - """ - BaseResponseFunctionDataTypes - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[FunctionDataTypes] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseFunctionDataTypes from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseFunctionDataTypes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": FunctionDataTypes.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/base_response_function_data_types_list.py b/revengai/models/base_response_function_data_types_list.py deleted file mode 100644 index 2e5dcdf1..00000000 --- a/revengai/models/base_response_function_data_types_list.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.function_data_types_list import FunctionDataTypesList -from revengai.models.meta_model import MetaModel -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseFunctionDataTypesList(BaseModel): - """ - BaseResponseFunctionDataTypesList - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[FunctionDataTypesList] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseFunctionDataTypesList from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseFunctionDataTypesList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": FunctionDataTypesList.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/base_response_generate_function_data_types.py b/revengai/models/base_response_generate_function_data_types.py deleted file mode 100644 index 73162853..00000000 --- a/revengai/models/base_response_generate_function_data_types.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.generate_function_data_types import GenerateFunctionDataTypes -from revengai.models.meta_model import MetaModel -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseGenerateFunctionDataTypes(BaseModel): - """ - BaseResponseGenerateFunctionDataTypes - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[GenerateFunctionDataTypes] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseGenerateFunctionDataTypes from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseGenerateFunctionDataTypes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": GenerateFunctionDataTypes.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/base_response_generation_status_list.py b/revengai/models/base_response_generation_status_list.py deleted file mode 100644 index 190f882f..00000000 --- a/revengai/models/base_response_generation_status_list.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.error_model import ErrorModel -from revengai.models.generation_status_list import GenerationStatusList -from revengai.models.meta_model import MetaModel -from typing import Optional, Set -from typing_extensions import Self - -class BaseResponseGenerationStatusList(BaseModel): - """ - BaseResponseGenerationStatusList - """ # noqa: E501 - status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[GenerationStatusList] = None - message: Optional[StrictStr] = None - errors: Optional[List[ErrorModel]] = None - meta: Optional[MetaModel] = Field(default=None, description="Metadata") - __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseGenerationStatusList from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict['data'] = self.data.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in errors (list) - _items = [] - if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) - _dict['errors'] = _items - # override the default output from pydantic by calling `to_dict()` of meta - if self.meta: - _dict['meta'] = self.meta.to_dict() - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - - # set to None if message (nullable) is None - # and model_fields_set contains the field - if self.message is None and "message" in self.model_fields_set: - _dict['message'] = None - - # set to None if errors (nullable) is None - # and model_fields_set contains the field - if self.errors is None and "errors" in self.model_fields_set: - _dict['errors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseGenerationStatusList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status") if obj.get("status") is not None else True, - "data": GenerationStatusList.from_dict(obj["data"]) if obj.get("data") is not None else None, - "message": obj.get("message"), - "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, - "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None - }) - return _obj - - diff --git a/revengai/models/batch_function_signature_entry.py b/revengai/models/batch_function_signature_entry.py new file mode 100644 index 00000000..bee85b46 --- /dev/null +++ b/revengai/models/batch_function_signature_entry.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.signature_parameter_entry import SignatureParameterEntry +from typing import Optional, Set +from typing_extensions import Self + +class BatchFunctionSignatureEntry(BaseModel): + """ + BatchFunctionSignatureEntry + """ # noqa: E501 + analysis_id: StrictInt = Field(description="The analysis this signature belongs to. Its data_type_ids resolve against this analysis only.") + calling_convention: Optional[StrictStr] = Field(default=None, description="Calling convention, when the producer reported one.") + created_at: Optional[datetime] = Field(default=None, description="When this signature was extracted.") + function_id: StrictInt + function_name: StrictStr = Field(description="Current name of the function.") + has_signature: StrictBool = Field(description="Whether a signature was extracted for this function. False is a normal result: no signature is recorded unless data type extraction ran for the analysis, and thunks and external functions are skipped when it does.") + parameters: Optional[List[SignatureParameterEntry]] = Field(description="Parameters in argument order. Empty with has_signature true means the function is known to take no arguments.") + return_data_type_id: Optional[StrictInt] = Field(default=None, description="Return type, resolvable against the analysis data types list. Absent for an unresolved return type.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this signature was copied from, when it was transferred rather than extracted.") + source_type: Optional[StrictStr] = Field(default=None, description="Where this signature came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_id", "calling_convention", "created_at", "function_id", "function_name", "has_signature", "parameters", "return_data_type_id", "source_function_id", "source_type"] + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', '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 BatchFunctionSignatureEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchFunctionSignatureEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analysis_id": obj.get("analysis_id"), + "calling_convention": obj.get("calling_convention"), + "created_at": obj.get("created_at"), + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "has_signature": obj.get("has_signature"), + "parameters": [SignatureParameterEntry.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, + "return_data_type_id": obj.get("return_data_type_id"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/bitfield_data_type.py b/revengai/models/bitfield_data_type.py new file mode 100644 index 00000000..34a8d61c --- /dev/null +++ b/revengai/models/bitfield_data_type.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BitfieldDataType(BaseModel): + """ + BitfieldDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BITFIELD', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('BITFIELD', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 BitfieldDataType 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 BitfieldDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_update_data_types_input_body.py b/revengai/models/copy_function_signatures_input_body.py similarity index 72% rename from revengai/models/batch_update_data_types_input_body.py rename to revengai/models/copy_function_signatures_input_body.py index 9f447c58..dc5dcd4d 100644 --- a/revengai/models/batch_update_data_types_input_body.py +++ b/revengai/models/copy_function_signatures_input_body.py @@ -19,17 +19,17 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem +from revengai.models.copy_signature_item import CopySignatureItem from typing import Optional, Set from typing_extensions import Self -class BatchUpdateDataTypesInputBody(BaseModel): +class CopyFunctionSignaturesInputBody(BaseModel): """ - BatchUpdateDataTypesInputBody + CopyFunctionSignaturesInputBody """ # noqa: E501 - functions: Optional[Annotated[List[BatchUpdateDataTypesItem], Field(min_length=1, max_length=1000)]] = Field(description="List of functions to update. All function IDs must belong to the analysis in the URL.") + copies: Optional[Annotated[List[CopySignatureItem], Field(min_length=1, max_length=50)]] = Field(description="Signatures to copy. No target may repeat, and no pair may name the same function twice.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["functions"] + __properties: ClassVar[List[str]] = ["copies"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesInputBody from a JSON string""" + """Create an instance of CopyFunctionSignaturesInputBody from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,28 +72,28 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + # override the default output from pydantic by calling `to_dict()` of each item in copies (list) _items = [] - if self.functions: - for _item_functions in self.functions: - if _item_functions: - _items.append(_item_functions.to_dict()) - _dict['functions'] = _items + if self.copies: + for _item_copies in self.copies: + if _item_copies: + _items.append(_item_copies.to_dict()) + _dict['copies'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if functions (nullable) is None + # set to None if copies (nullable) is None # and model_fields_set contains the field - if self.functions is None and "functions" in self.model_fields_set: - _dict['functions'] = None + if self.copies is None and "copies" in self.model_fields_set: + _dict['copies'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesInputBody from a dict""" + """Create an instance of CopyFunctionSignaturesInputBody from a dict""" if obj is None: return None @@ -101,7 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "functions": [BatchUpdateDataTypesItem.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None + "copies": [CopySignatureItem.from_dict(_item) for _item in obj["copies"]] if obj.get("copies") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/copy_function_signatures_output_body.py b/revengai/models/copy_function_signatures_output_body.py new file mode 100644 index 00000000..b4f51db1 --- /dev/null +++ b/revengai/models/copy_function_signatures_output_body.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_type_entry import DataTypeEntry +from revengai.models.function_signature_entry import FunctionSignatureEntry +from typing import Optional, Set +from typing_extensions import Self + +class CopyFunctionSignaturesOutputBody(BaseModel): + """ + CopyFunctionSignaturesOutputBody + """ # noqa: E501 + data_types: Optional[List[DataTypeEntry]] = Field(description="The data types this analysis gained or had replaced, ordered by data_type_id. Empty when every type the copied signatures need was already stored unchanged.") + signatures: Optional[List[FunctionSignatureEntry]] = Field(description="The stored signatures of the target functions, in request order.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "signatures"] + + 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 CopyFunctionSignaturesOutputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signatures (list) + _items = [] + if self.signatures: + for _item_signatures in self.signatures: + if _item_signatures: + _items.append(_item_signatures.to_dict()) + _dict['signatures'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + # set to None if signatures (nullable) is None + # and model_fields_set contains the field + if self.signatures is None and "signatures" in self.model_fields_set: + _dict['signatures'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CopyFunctionSignaturesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_types": [DataTypeEntry.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None, + "signatures": [FunctionSignatureEntry.from_dict(_item) for _item in obj["signatures"]] if obj.get("signatures") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/copy_signature_item.py b/revengai/models/copy_signature_item.py new file mode 100644 index 00000000..050efc2b --- /dev/null +++ b/revengai/models/copy_signature_item.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CopySignatureItem(BaseModel): + """ + CopySignatureItem + """ # noqa: E501 + source_function_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Function to copy the signature from. May belong to another analysis the caller can read.") + target_function_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Function to copy the signature to. Must belong to the analysis in the URL.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["source_function_id", "target_function_id"] + + 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 CopySignatureItem 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 CopySignatureItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source_function_id": obj.get("source_function_id"), + "target_function_id": obj.get("target_function_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_update_data_types_item.py b/revengai/models/create_analysis_data_types_input_body.py similarity index 74% rename from revengai/models/batch_update_data_types_item.py rename to revengai/models/create_analysis_data_types_input_body.py index 0db860a0..50f3c69b 100644 --- a/revengai/models/batch_update_data_types_item.py +++ b/revengai/models/create_analysis_data_types_input_body.py @@ -19,18 +19,17 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from revengai.models.create_data_type_entry import CreateDataTypeEntry from typing import Optional, Set from typing_extensions import Self -class BatchUpdateDataTypesItem(BaseModel): +class CreateAnalysisDataTypesInputBody(BaseModel): """ - BatchUpdateDataTypesItem + CreateAnalysisDataTypesInputBody """ # noqa: E501 - data_types: Optional[Any] - data_types_version: Annotated[int, Field(strict=True, ge=0)] = Field(description="Current stored version. Pass 0 on the first write.") - function_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Function ID") + data_types: Optional[Annotated[List[CreateDataTypeEntry], Field(min_length=1, max_length=100)]] = Field(description="The types to create. Each namespace, name and kind must be new to the analysis.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "function_id"] + __properties: ClassVar[List[str]] = ["data_types"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesItem from a JSON string""" + """Create an instance of CreateAnalysisDataTypesInputBody from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,6 +72,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -87,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesItem from a dict""" + """Create an instance of CreateAnalysisDataTypesInputBody from a dict""" if obj is None: return None @@ -95,9 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "data_types": obj.get("data_types"), - "data_types_version": obj.get("data_types_version"), - "function_id": obj.get("function_id") + "data_types": [CreateDataTypeEntry.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/create_array_data_type.py b/revengai/models/create_array_data_type.py new file mode 100644 index 00000000..0778e6cc --- /dev/null +++ b/revengai/models/create_array_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.array_definition import ArrayDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreateArrayDataType(BaseModel): + """ + CreateArrayDataType + """ # noqa: E501 + definition: ArrayDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ARRAY', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ARRAY', '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 CreateArrayDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateArrayDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": ArrayDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_base_data_type.py b/revengai/models/create_base_data_type.py new file mode 100644 index 00000000..0ff5e9e5 --- /dev/null +++ b/revengai/models/create_base_data_type.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateBaseDataType(BaseModel): + """ + CreateBaseDataType + """ # noqa: E501 + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BASE', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('BASE', '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 CreateBaseDataType 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 CreateBaseDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_bitfield_data_type.py b/revengai/models/create_bitfield_data_type.py new file mode 100644 index 00000000..262659f8 --- /dev/null +++ b/revengai/models/create_bitfield_data_type.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateBitfieldDataType(BaseModel): + """ + CreateBitfieldDataType + """ # noqa: E501 + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BITFIELD', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('BITFIELD', '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 CreateBitfieldDataType 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 CreateBitfieldDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_data_type_entry.py b/revengai/models/create_data_type_entry.py new file mode 100644 index 00000000..731693ce --- /dev/null +++ b/revengai/models/create_data_type_entry.py @@ -0,0 +1,251 @@ +# 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.create_array_data_type import CreateArrayDataType +from revengai.models.create_base_data_type import CreateBaseDataType +from revengai.models.create_bitfield_data_type import CreateBitfieldDataType +from revengai.models.create_enum_data_type import CreateEnumDataType +from revengai.models.create_function_data_type import CreateFunctionDataType +from revengai.models.create_pointer_data_type import CreatePointerDataType +from revengai.models.create_struct_data_type import CreateStructDataType +from revengai.models.create_typedef_data_type import CreateTypedefDataType +from revengai.models.create_union_data_type import CreateUnionDataType +from revengai.models.create_unknown_data_type import CreateUnknownDataType +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +CREATEDATATYPEENTRY_ONE_OF_SCHEMAS = ["CreateArrayDataType", "CreateBaseDataType", "CreateBitfieldDataType", "CreateEnumDataType", "CreateFunctionDataType", "CreatePointerDataType", "CreateStructDataType", "CreateTypedefDataType", "CreateUnionDataType", "CreateUnknownDataType"] + +class CreateDataTypeEntry(BaseModel): + """ + A data type to create. `kind` selects the variant and so which definition the type must carry. + """ + # data type: CreateStructDataType + oneof_schema_1_validator: Optional[CreateStructDataType] = None + # data type: CreateUnionDataType + oneof_schema_2_validator: Optional[CreateUnionDataType] = None + # data type: CreateEnumDataType + oneof_schema_3_validator: Optional[CreateEnumDataType] = None + # data type: CreateTypedefDataType + oneof_schema_4_validator: Optional[CreateTypedefDataType] = None + # data type: CreatePointerDataType + oneof_schema_5_validator: Optional[CreatePointerDataType] = None + # data type: CreateArrayDataType + oneof_schema_6_validator: Optional[CreateArrayDataType] = None + # data type: CreateFunctionDataType + oneof_schema_7_validator: Optional[CreateFunctionDataType] = None + # data type: CreateBitfieldDataType + oneof_schema_8_validator: Optional[CreateBitfieldDataType] = None + # data type: CreateBaseDataType + oneof_schema_9_validator: Optional[CreateBaseDataType] = None + # data type: CreateUnknownDataType + oneof_schema_10_validator: Optional[CreateUnknownDataType] = None + actual_instance: Optional[Union[CreateArrayDataType, CreateBaseDataType, CreateBitfieldDataType, CreateEnumDataType, CreateFunctionDataType, CreatePointerDataType, CreateStructDataType, CreateTypedefDataType, CreateUnionDataType, CreateUnknownDataType]] = None + one_of_schemas: Set[str] = { "CreateArrayDataType", "CreateBaseDataType", "CreateBitfieldDataType", "CreateEnumDataType", "CreateFunctionDataType", "CreatePointerDataType", "CreateStructDataType", "CreateTypedefDataType", "CreateUnionDataType", "CreateUnknownDataType" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + 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 = CreateDataTypeEntry.model_construct() + error_messages = [] + match = 0 + # validate data type: CreateStructDataType + if not isinstance(v, CreateStructDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateStructDataType`") + else: + match += 1 + # validate data type: CreateUnionDataType + if not isinstance(v, CreateUnionDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateUnionDataType`") + else: + match += 1 + # validate data type: CreateEnumDataType + if not isinstance(v, CreateEnumDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateEnumDataType`") + else: + match += 1 + # validate data type: CreateTypedefDataType + if not isinstance(v, CreateTypedefDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateTypedefDataType`") + else: + match += 1 + # validate data type: CreatePointerDataType + if not isinstance(v, CreatePointerDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreatePointerDataType`") + else: + match += 1 + # validate data type: CreateArrayDataType + if not isinstance(v, CreateArrayDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateArrayDataType`") + else: + match += 1 + # validate data type: CreateFunctionDataType + if not isinstance(v, CreateFunctionDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateFunctionDataType`") + else: + match += 1 + # validate data type: CreateBitfieldDataType + if not isinstance(v, CreateBitfieldDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateBitfieldDataType`") + else: + match += 1 + # validate data type: CreateBaseDataType + if not isinstance(v, CreateBaseDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateBaseDataType`") + else: + match += 1 + # validate data type: CreateUnknownDataType + if not isinstance(v, CreateUnknownDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateUnknownDataType`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in CreateDataTypeEntry with oneOf schemas: CreateArrayDataType, CreateBaseDataType, CreateBitfieldDataType, CreateEnumDataType, CreateFunctionDataType, CreatePointerDataType, CreateStructDataType, CreateTypedefDataType, CreateUnionDataType, CreateUnknownDataType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in CreateDataTypeEntry with oneOf schemas: CreateArrayDataType, CreateBaseDataType, CreateBitfieldDataType, CreateEnumDataType, CreateFunctionDataType, CreatePointerDataType, CreateStructDataType, CreateTypedefDataType, CreateUnionDataType, CreateUnknownDataType. 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 CreateStructDataType + try: + instance.actual_instance = CreateStructDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateUnionDataType + try: + instance.actual_instance = CreateUnionDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateEnumDataType + try: + instance.actual_instance = CreateEnumDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateTypedefDataType + try: + instance.actual_instance = CreateTypedefDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreatePointerDataType + try: + instance.actual_instance = CreatePointerDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateArrayDataType + try: + instance.actual_instance = CreateArrayDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateFunctionDataType + try: + instance.actual_instance = CreateFunctionDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateBitfieldDataType + try: + instance.actual_instance = CreateBitfieldDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateBaseDataType + try: + instance.actual_instance = CreateBaseDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into CreateUnknownDataType + try: + instance.actual_instance = CreateUnknownDataType.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 CreateDataTypeEntry with oneOf schemas: CreateArrayDataType, CreateBaseDataType, CreateBitfieldDataType, CreateEnumDataType, CreateFunctionDataType, CreatePointerDataType, CreateStructDataType, CreateTypedefDataType, CreateUnionDataType, CreateUnknownDataType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into CreateDataTypeEntry with oneOf schemas: CreateArrayDataType, CreateBaseDataType, CreateBitfieldDataType, CreateEnumDataType, CreateFunctionDataType, CreatePointerDataType, CreateStructDataType, CreateTypedefDataType, CreateUnionDataType, CreateUnknownDataType. 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], CreateArrayDataType, CreateBaseDataType, CreateBitfieldDataType, CreateEnumDataType, CreateFunctionDataType, CreatePointerDataType, CreateStructDataType, CreateTypedefDataType, CreateUnionDataType, CreateUnknownDataType]]: + """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/create_enum_data_type.py b/revengai/models/create_enum_data_type.py new file mode 100644 index 00000000..d4696df5 --- /dev/null +++ b/revengai/models/create_enum_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.enum_definition import EnumDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreateEnumDataType(BaseModel): + """ + CreateEnumDataType + """ # noqa: E501 + definition: EnumDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ENUM', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ENUM', '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 CreateEnumDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateEnumDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": EnumDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_function_data_type.py b/revengai/models/create_function_data_type.py new file mode 100644 index 00000000..f262a3b7 --- /dev/null +++ b/revengai/models/create_function_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.function_type_definition import FunctionTypeDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreateFunctionDataType(BaseModel): + """ + CreateFunctionDataType + """ # noqa: E501 + definition: FunctionTypeDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['FUNCTION_DEFINITION', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('FUNCTION_DEFINITION', '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 CreateFunctionDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateFunctionDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": FunctionTypeDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_pointer_data_type.py b/revengai/models/create_pointer_data_type.py new file mode 100644 index 00000000..524c41ae --- /dev/null +++ b/revengai/models/create_pointer_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.pointer_definition import PointerDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreatePointerDataType(BaseModel): + """ + CreatePointerDataType + """ # noqa: E501 + definition: PointerDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['POINTER', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('POINTER', '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 CreatePointerDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreatePointerDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": PointerDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_struct_data_type.py b/revengai/models/create_struct_data_type.py new file mode 100644 index 00000000..cc25ad91 --- /dev/null +++ b/revengai/models/create_struct_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.struct_definition import StructDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreateStructDataType(BaseModel): + """ + CreateStructDataType + """ # noqa: E501 + definition: StructDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['STRUCT', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('STRUCT', '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 CreateStructDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateStructDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": StructDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_typedef_data_type.py b/revengai/models/create_typedef_data_type.py new file mode 100644 index 00000000..0f187ee3 --- /dev/null +++ b/revengai/models/create_typedef_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.typedef_definition import TypedefDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreateTypedefDataType(BaseModel): + """ + CreateTypedefDataType + """ # noqa: E501 + definition: TypedefDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['TYPEDEF', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('TYPEDEF', '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 CreateTypedefDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateTypedefDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": TypedefDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_union_data_type.py b/revengai/models/create_union_data_type.py new file mode 100644 index 00000000..52877773 --- /dev/null +++ b/revengai/models/create_union_data_type.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.union_definition import UnionDefinition +from typing import Optional, Set +from typing_extensions import Self + +class CreateUnionDataType(BaseModel): + """ + CreateUnionDataType + """ # noqa: E501 + definition: UnionDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNION', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNION', '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 CreateUnionDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateUnionDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition": UnionDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_unknown_data_type.py b/revengai/models/create_unknown_data_type.py new file mode 100644 index 00000000..fdfca888 --- /dev/null +++ b/revengai/models/create_unknown_data_type.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateUnknownDataType(BaseModel): + """ + CreateUnknownDataType + """ # noqa: E501 + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNKNOWN', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNKNOWN', '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 CreateUnknownDataType 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 CreateUnknownDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/data_type_entry.py b/revengai/models/data_type_entry.py new file mode 100644 index 00000000..080ec66f --- /dev/null +++ b/revengai/models/data_type_entry.py @@ -0,0 +1,251 @@ +# 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.array_data_type import ArrayDataType +from revengai.models.base_data_type import BaseDataType +from revengai.models.bitfield_data_type import BitfieldDataType +from revengai.models.enum_data_type import EnumDataType +from revengai.models.function_data_type import FunctionDataType +from revengai.models.pointer_data_type import PointerDataType +from revengai.models.struct_data_type import StructDataType +from revengai.models.typedef_data_type import TypedefDataType +from revengai.models.union_data_type import UnionDataType +from revengai.models.unknown_data_type import UnknownDataType +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +DATATYPEENTRY_ONE_OF_SCHEMAS = ["ArrayDataType", "BaseDataType", "BitfieldDataType", "EnumDataType", "FunctionDataType", "PointerDataType", "StructDataType", "TypedefDataType", "UnionDataType", "UnknownDataType"] + +class DataTypeEntry(BaseModel): + """ + A data type extracted from the binary. `kind` selects the variant and so which definition the type carries. + """ + # data type: StructDataType + oneof_schema_1_validator: Optional[StructDataType] = None + # data type: UnionDataType + oneof_schema_2_validator: Optional[UnionDataType] = None + # data type: EnumDataType + oneof_schema_3_validator: Optional[EnumDataType] = None + # data type: TypedefDataType + oneof_schema_4_validator: Optional[TypedefDataType] = None + # data type: PointerDataType + oneof_schema_5_validator: Optional[PointerDataType] = None + # data type: ArrayDataType + oneof_schema_6_validator: Optional[ArrayDataType] = None + # data type: FunctionDataType + oneof_schema_7_validator: Optional[FunctionDataType] = None + # data type: BitfieldDataType + oneof_schema_8_validator: Optional[BitfieldDataType] = None + # data type: BaseDataType + oneof_schema_9_validator: Optional[BaseDataType] = None + # data type: UnknownDataType + oneof_schema_10_validator: Optional[UnknownDataType] = None + actual_instance: Optional[Union[ArrayDataType, BaseDataType, BitfieldDataType, EnumDataType, FunctionDataType, PointerDataType, StructDataType, TypedefDataType, UnionDataType, UnknownDataType]] = None + one_of_schemas: Set[str] = { "ArrayDataType", "BaseDataType", "BitfieldDataType", "EnumDataType", "FunctionDataType", "PointerDataType", "StructDataType", "TypedefDataType", "UnionDataType", "UnknownDataType" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + 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 = DataTypeEntry.model_construct() + error_messages = [] + match = 0 + # validate data type: StructDataType + if not isinstance(v, StructDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `StructDataType`") + else: + match += 1 + # validate data type: UnionDataType + if not isinstance(v, UnionDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UnionDataType`") + else: + match += 1 + # validate data type: EnumDataType + if not isinstance(v, EnumDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `EnumDataType`") + else: + match += 1 + # validate data type: TypedefDataType + if not isinstance(v, TypedefDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `TypedefDataType`") + else: + match += 1 + # validate data type: PointerDataType + if not isinstance(v, PointerDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `PointerDataType`") + else: + match += 1 + # validate data type: ArrayDataType + if not isinstance(v, ArrayDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `ArrayDataType`") + else: + match += 1 + # validate data type: FunctionDataType + if not isinstance(v, FunctionDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `FunctionDataType`") + else: + match += 1 + # validate data type: BitfieldDataType + if not isinstance(v, BitfieldDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `BitfieldDataType`") + else: + match += 1 + # validate data type: BaseDataType + if not isinstance(v, BaseDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `BaseDataType`") + else: + match += 1 + # validate data type: UnknownDataType + if not isinstance(v, UnknownDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UnknownDataType`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in DataTypeEntry with oneOf schemas: ArrayDataType, BaseDataType, BitfieldDataType, EnumDataType, FunctionDataType, PointerDataType, StructDataType, TypedefDataType, UnionDataType, UnknownDataType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in DataTypeEntry with oneOf schemas: ArrayDataType, BaseDataType, BitfieldDataType, EnumDataType, FunctionDataType, PointerDataType, StructDataType, TypedefDataType, UnionDataType, UnknownDataType. 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 StructDataType + try: + instance.actual_instance = StructDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UnionDataType + try: + instance.actual_instance = UnionDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EnumDataType + try: + instance.actual_instance = EnumDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TypedefDataType + try: + instance.actual_instance = TypedefDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PointerDataType + try: + instance.actual_instance = PointerDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ArrayDataType + try: + instance.actual_instance = ArrayDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into FunctionDataType + try: + instance.actual_instance = FunctionDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into BitfieldDataType + try: + instance.actual_instance = BitfieldDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into BaseDataType + try: + instance.actual_instance = BaseDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UnknownDataType + try: + instance.actual_instance = UnknownDataType.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 DataTypeEntry with oneOf schemas: ArrayDataType, BaseDataType, BitfieldDataType, EnumDataType, FunctionDataType, PointerDataType, StructDataType, TypedefDataType, UnionDataType, UnknownDataType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into DataTypeEntry with oneOf schemas: ArrayDataType, BaseDataType, BitfieldDataType, EnumDataType, FunctionDataType, PointerDataType, StructDataType, TypedefDataType, UnionDataType, UnknownDataType. 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], ArrayDataType, BaseDataType, BitfieldDataType, EnumDataType, FunctionDataType, PointerDataType, StructDataType, TypedefDataType, UnionDataType, UnknownDataType]]: + """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/data_type_enum_value_entry.py b/revengai/models/data_type_enum_value_entry.py new file mode 100644 index 00000000..af1cdc28 --- /dev/null +++ b/revengai/models/data_type_enum_value_entry.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, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class DataTypeEnumValueEntry(BaseModel): + """ + DataTypeEnumValueEntry + """ # noqa: E501 + name: StrictStr = Field(description="Constant name.") + value: Annotated[str, Field(strict=True)] = Field(description="Constant value, a decimal integer as a string, with no leading zeros. A string because the value may be negative or exceed 64 unsigned bits, which a JSON number cannot carry safely.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "value"] + + @field_validator('value') + def value_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^-?(0|[1-9][0-9]*)$", value): + raise ValueError(r"must validate the regular expression /^-?(0|[1-9][0-9]*)$/") + 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 DataTypeEnumValueEntry 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 DataTypeEnumValueEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/data_type_function_entry.py b/revengai/models/data_type_function_entry.py new file mode 100644 index 00000000..76e7f548 --- /dev/null +++ b/revengai/models/data_type_function_entry.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class DataTypeFunctionEntry(BaseModel): + """ + DataTypeFunctionEntry + """ # noqa: E501 + function_id: StrictInt + function_name: StrictStr = Field(description="Current name of the function.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["function_id", "function_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DataTypeFunctionEntry 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 DataTypeFunctionEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/data_type_function_parameter_entry.py b/revengai/models/data_type_function_parameter_entry.py new file mode 100644 index 00000000..de49d610 --- /dev/null +++ b/revengai/models/data_type_function_parameter_entry.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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DataTypeFunctionParameterEntry(BaseModel): + """ + DataTypeFunctionParameterEntry + """ # noqa: E501 + data_type_id: Optional[StrictInt] = Field(default=None, description="The parameter's type.") + name: Optional[StrictStr] = Field(default=None, description="Parameter name, when the producer had one.") + ordinal: StrictInt = Field(description="Zero-based argument position.") + size: StrictInt = Field(description="Parameter size in bytes.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "name", "ordinal", "size"] + + 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 DataTypeFunctionParameterEntry 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 DataTypeFunctionParameterEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "name": obj.get("name"), + "ordinal": obj.get("ordinal"), + "size": obj.get("size") + }) + # 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/data_type_member_entry.py b/revengai/models/data_type_member_entry.py new file mode 100644 index 00000000..1fad422d --- /dev/null +++ b/revengai/models/data_type_member_entry.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DataTypeMemberEntry(BaseModel): + """ + DataTypeMemberEntry + """ # noqa: E501 + bit_offset: Optional[StrictInt] = Field(default=None, description="Bit offset from the start of the containing type, for bitfields.") + bit_size: Optional[StrictInt] = Field(default=None, description="Width in bits, for bitfields.") + data_type_id: Optional[StrictInt] = Field(default=None, description="The member's type.") + is_bitfield: StrictBool = Field(description="Whether this member is a bitfield.") + name: Optional[StrictStr] = Field(default=None, description="Member name, absent for unnamed padding.") + offset: StrictInt = Field(description="Byte offset from the start of the containing type.") + size: StrictInt = Field(description="Member size in bytes.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["bit_offset", "bit_size", "data_type_id", "is_bitfield", "name", "offset", "size"] + + 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 DataTypeMemberEntry 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 DataTypeMemberEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bit_offset": obj.get("bit_offset"), + "bit_size": obj.get("bit_size"), + "data_type_id": obj.get("data_type_id"), + "is_bitfield": obj.get("is_bitfield"), + "name": obj.get("name"), + "offset": obj.get("offset"), + "size": obj.get("size") + }) + # 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/function_info.py b/revengai/models/data_type_version.py similarity index 68% rename from revengai/models/function_info.py rename to revengai/models/data_type_version.py index 23b66389..d4366975 100644 --- a/revengai/models/function_info.py +++ b/revengai/models/data_type_version.py @@ -16,21 +16,23 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_dependency import FunctionDependency -from revengai.models.function_type import FunctionType +from revengai.models.data_type_entry import DataTypeEntry +from revengai.models.history_actor import HistoryActor from typing import Optional, Set from typing_extensions import Self -class FunctionInfo(BaseModel): +class DataTypeVersion(BaseModel): """ - FunctionInfo + DataTypeVersion """ # noqa: E501 - func_deps: Optional[List[FunctionDependency]] - func_types: Optional[FunctionType] = None + updated_at: Optional[datetime] = Field(default=None, description="When this version was written. Absent on a version that predates the recorded history.") + updated_by: Optional[HistoryActor] = Field(default=None, description="Who wrote this version. Absent on a version that predates the recorded history.") + value: DataTypeEntry = Field(description="The type as it stood in this version.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["func_deps", "func_types"] + __properties: ClassVar[List[str]] = ["updated_at", "updated_by", "value"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionInfo from a JSON string""" + """Create an instance of DataTypeVersion from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,31 +75,22 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in func_deps (list) - _items = [] - if self.func_deps: - for _item_func_deps in self.func_deps: - if _item_func_deps: - _items.append(_item_func_deps.to_dict()) - _dict['func_deps'] = _items - # override the default output from pydantic by calling `to_dict()` of func_types - if self.func_types: - _dict['func_types'] = self.func_types.to_dict() + # override the default output from pydantic by calling `to_dict()` of updated_by + if self.updated_by: + _dict['updated_by'] = self.updated_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if func_deps (nullable) is None - # and model_fields_set contains the field - if self.func_deps is None and "func_deps" in self.model_fields_set: - _dict['func_deps'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionInfo from a dict""" + """Create an instance of DataTypeVersion from a dict""" if obj is None: return None @@ -105,8 +98,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "func_deps": [FunctionDependency.from_dict(_item) for _item in obj["func_deps"]] if obj.get("func_deps") is not None else None, - "func_types": FunctionType.from_dict(obj["func_types"]) if obj.get("func_types") is not None else None + "updated_at": obj.get("updated_at"), + "updated_by": HistoryActor.from_dict(obj["updated_by"]) if obj.get("updated_by") is not None else None, + "value": DataTypeEntry.from_dict(obj["value"]) if obj.get("value") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/disassembly_output_body.py b/revengai/models/disassembly_output_body.py index 5ceeb663..618d59d4 100644 --- a/revengai/models/disassembly_output_body.py +++ b/revengai/models/disassembly_output_body.py @@ -27,12 +27,13 @@ class DisassemblyOutputBody(BaseModel): """ # noqa: E501 basic_blocks: Optional[Any] = None function_id: StrictInt + global_variables: Optional[Any] = None local_variables: Optional[Any] = None params: Optional[Any] = None return_type: Optional[StrictStr] = None returns: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["basic_blocks", "function_id", "local_variables", "params", "return_type", "returns"] + __properties: ClassVar[List[str]] = ["basic_blocks", "function_id", "global_variables", "local_variables", "params", "return_type", "returns"] model_config = ConfigDict( populate_by_name=True, @@ -85,6 +86,11 @@ def to_dict(self) -> Dict[str, Any]: if self.basic_blocks is None and "basic_blocks" in self.model_fields_set: _dict['basic_blocks'] = None + # set to None if global_variables (nullable) is None + # and model_fields_set contains the field + if self.global_variables is None and "global_variables" in self.model_fields_set: + _dict['global_variables'] = None + # set to None if local_variables (nullable) is None # and model_fields_set contains the field if self.local_variables is None and "local_variables" in self.model_fields_set: @@ -114,6 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "basic_blocks": obj.get("basic_blocks"), "function_id": obj.get("function_id"), + "global_variables": obj.get("global_variables"), "local_variables": obj.get("local_variables"), "params": obj.get("params"), "return_type": obj.get("return_type"), diff --git a/revengai/models/dynamic_execution_status_response.py b/revengai/models/dynamic_execution_status_response.py index b3e42b3e..cd4b75c3 100644 --- a/revengai/models/dynamic_execution_status_response.py +++ b/revengai/models/dynamic_execution_status_response.py @@ -27,7 +27,7 @@ class DynamicExecutionStatusResponse(BaseModel): DynamicExecutionStatusResponse """ # noqa: E501 error_message: Optional[StrictStr] = Field(default=None, description="Error detail, set when status is FAILED") - logs: AnalysisLogs = Field(description="Sandbox status log messages captured during the run. Contains a single \"No logs available\" message when none have been captured yet.") + logs: AnalysisLogs = Field(description="Sandbox status log messages captured during the run. Empty when none have been captured yet.") status: StrictStr = Field(description="Task status") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["error_message", "logs", "status"] diff --git a/revengai/models/enum_data_type.py b/revengai/models/enum_data_type.py new file mode 100644 index 00000000..e3a355af --- /dev/null +++ b/revengai/models/enum_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.enum_definition import EnumDefinition +from typing import Optional, Set +from typing_extensions import Self + +class EnumDataType(BaseModel): + """ + EnumDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[EnumDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ENUM', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ENUM', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 EnumDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EnumDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": EnumDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/enum_definition.py b/revengai/models/enum_definition.py new file mode 100644 index 00000000..bfc0ed06 --- /dev/null +++ b/revengai/models/enum_definition.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_type_enum_value_entry import DataTypeEnumValueEntry +from typing import Optional, Set +from typing_extensions import Self + +class EnumDefinition(BaseModel): + """ + EnumDefinition + """ # noqa: E501 + values: Optional[List[DataTypeEnumValueEntry]] = Field(description="The type's constants.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["values"] + + 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 EnumDefinition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in values (list) + _items = [] + if self.values: + for _item_values in self.values: + if _item_values: + _items.append(_item_values.to_dict()) + _dict['values'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EnumDefinition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "values": [DataTypeEnumValueEntry.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/enumeration.py b/revengai/models/enumeration.py deleted file mode 100644 index 0748ffbc..00000000 --- a/revengai/models/enumeration.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class Enumeration(BaseModel): - """ - Enumeration - """ # noqa: E501 - last_change: Optional[StrictStr] = None - name: StrictStr = Field(description="Name of the enumeration") - members: Dict[str, StrictInt] = Field(description="Dictionary of enumeration members and their values") - artifact_type: Optional[StrictStr] = Field(default=None, description="Type of artifact that the enumeration is associated with") - __properties: ClassVar[List[str]] = ["last_change", "name", "members", "artifact_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 Enumeration 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, - ) - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Enumeration from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "members": obj.get("members"), - "artifact_type": obj.get("artifact_type") - }) - return _obj - - diff --git a/revengai/models/function_data_type.py b/revengai/models/function_data_type.py new file mode 100644 index 00000000..9d78264f --- /dev/null +++ b/revengai/models/function_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_type_definition import FunctionTypeDefinition +from typing import Optional, Set +from typing_extensions import Self + +class FunctionDataType(BaseModel): + """ + FunctionDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[FunctionTypeDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['FUNCTION_DEFINITION', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('FUNCTION_DEFINITION', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 FunctionDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": FunctionTypeDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_data_types.py b/revengai/models/function_data_types.py deleted file mode 100644 index 18cfb197..00000000 --- a/revengai/models/function_data_types.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.v2_function_info import V2FunctionInfo -from typing import Optional, Set -from typing_extensions import Self - -class FunctionDataTypes(BaseModel): - """ - FunctionDataTypes - """ # noqa: E501 - completed: StrictBool = Field(description="Whether the service has completed data types generation") - status: StrictStr = Field(description="The current status of the data types service") - data_types: Optional[V2FunctionInfo] = None - data_types_version: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["completed", "status", "data_types", "data_types_version"] - - 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 FunctionDataTypes 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_types - if self.data_types: - _dict['data_types'] = self.data_types.to_dict() - # set to None if data_types (nullable) is None - # and model_fields_set contains the field - if self.data_types is None and "data_types" in self.model_fields_set: - _dict['data_types'] = None - - # set to None if data_types_version (nullable) is None - # and model_fields_set contains the field - if self.data_types_version is None and "data_types_version" in self.model_fields_set: - _dict['data_types_version'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionDataTypes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "completed": obj.get("completed"), - "status": obj.get("status"), - "data_types": V2FunctionInfo.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, - "data_types_version": obj.get("data_types_version") - }) - return _obj - - diff --git a/revengai/models/function_data_types_list.py b/revengai/models/function_data_types_list.py deleted file mode 100644 index 14c98217..00000000 --- a/revengai/models/function_data_types_list.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_data_types_list_item import FunctionDataTypesListItem -from typing import Optional, Set -from typing_extensions import Self - -class FunctionDataTypesList(BaseModel): - """ - FunctionDataTypesList - """ # noqa: E501 - total_count: Optional[StrictInt] = Field(default=0, description="Total number of functions in analysis") - total_data_types_count: Optional[StrictInt] = Field(default=0, description="Total number of functions with data types") - items: List[FunctionDataTypesListItem] = Field(description="List of function data types information") - __properties: ClassVar[List[str]] = ["total_count", "total_data_types_count", "items"] - - 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 FunctionDataTypesList from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionDataTypesList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "total_count": obj.get("total_count") if obj.get("total_count") is not None else 0, - "total_data_types_count": obj.get("total_data_types_count") if obj.get("total_data_types_count") is not None else 0, - "items": [FunctionDataTypesListItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/revengai/models/function_data_types_list_item.py b/revengai/models/function_data_types_list_item.py deleted file mode 100644 index e5636f21..00000000 --- a/revengai/models/function_data_types_list_item.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.v2_function_info import V2FunctionInfo -from typing import Optional, Set -from typing_extensions import Self - -class FunctionDataTypesListItem(BaseModel): - """ - FunctionDataTypesListItem - """ # noqa: E501 - completed: StrictBool = Field(description="Whether the service has completed data types generation") - status: StrictStr = Field(description="The current status of the data types service") - data_types: Optional[V2FunctionInfo] = None - data_types_version: Optional[StrictInt] = None - function_id: StrictInt = Field(description="Function id") - __properties: ClassVar[List[str]] = ["completed", "status", "data_types", "data_types_version", "function_id"] - - 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 FunctionDataTypesListItem 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_types - if self.data_types: - _dict['data_types'] = self.data_types.to_dict() - # set to None if data_types (nullable) is None - # and model_fields_set contains the field - if self.data_types is None and "data_types" in self.model_fields_set: - _dict['data_types'] = None - - # set to None if data_types_version (nullable) is None - # and model_fields_set contains the field - if self.data_types_version is None and "data_types_version" in self.model_fields_set: - _dict['data_types_version'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionDataTypesListItem from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "completed": obj.get("completed"), - "status": obj.get("status"), - "data_types": V2FunctionInfo.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, - "data_types_version": obj.get("data_types_version"), - "function_id": obj.get("function_id") - }) - return _obj - - diff --git a/revengai/models/function_data_types_params.py b/revengai/models/function_data_types_params.py deleted file mode 100644 index 51254250..00000000 --- a/revengai/models/function_data_types_params.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class FunctionDataTypesParams(BaseModel): - """ - FunctionDataTypesParams - """ # noqa: E501 - function_ids: List[StrictInt] = Field(description="The function ID's to generate/get data types for") - __properties: ClassVar[List[str]] = ["function_ids"] - - 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 FunctionDataTypesParams from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionDataTypesParams from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "function_ids": obj.get("function_ids") - }) - return _obj - - diff --git a/revengai/models/function_data_types_status.py b/revengai/models/function_data_types_status.py deleted file mode 100644 index b6ba71d1..00000000 --- a/revengai/models/function_data_types_status.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class FunctionDataTypesStatus(BaseModel): - """ - FunctionDataTypesStatus - """ # noqa: E501 - function_id: StrictInt = Field(description="Function id") - completed: StrictBool = Field(description="Whether the service has completed data types generation") - status: StrictStr = Field(description="The current status of the data types service") - __properties: ClassVar[List[str]] = ["function_id", "completed", "status"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionDataTypesStatus from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionDataTypesStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "function_id": obj.get("function_id"), - "completed": obj.get("completed"), - "status": obj.get("status") - }) - return _obj - - diff --git a/revengai/models/function_signature_body.py b/revengai/models/function_signature_body.py new file mode 100644 index 00000000..54d4d2b5 --- /dev/null +++ b/revengai/models/function_signature_body.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_type_entry import DataTypeEntry +from revengai.models.signature_parameter_entry import SignatureParameterEntry +from typing import Optional, Set +from typing_extensions import Self + +class FunctionSignatureBody(BaseModel): + """ + FunctionSignatureBody + """ # noqa: E501 + calling_convention: Optional[StrictStr] = Field(default=None, description="Calling convention, when the producer reported one.") + created_at: Optional[datetime] = Field(default=None, description="When this signature was extracted.") + data_types: Optional[List[DataTypeEntry]] = Field(default=None, description="The types the signature names — its parameter types and its return type — ordered by data_type_id. Each entry is identical to the one the data types endpoints serve for that id. Returned only when include_data_types is true.") + function_id: StrictInt + function_name: StrictStr = Field(description="Current name of the function.") + has_signature: StrictBool = Field(description="Whether a signature was extracted for this function. False is a normal result: no signature is recorded unless data type extraction ran for the analysis, and thunks and external functions are skipped when it does.") + parameters: Optional[List[SignatureParameterEntry]] = Field(description="Parameters in argument order. Empty with has_signature true means the function is known to take no arguments.") + return_data_type_id: Optional[StrictInt] = Field(default=None, description="Return type, resolvable against the analysis data types list. Absent for an unresolved return type.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this signature was copied from, when it was transferred rather than extracted.") + source_type: Optional[StrictStr] = Field(default=None, description="Where this signature came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["calling_convention", "created_at", "data_types", "function_id", "function_name", "has_signature", "parameters", "return_data_type_id", "source_function_id", "source_type"] + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', '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 FunctionSignatureBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionSignatureBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "calling_convention": obj.get("calling_convention"), + "created_at": obj.get("created_at"), + "data_types": [DataTypeEntry.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None, + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "has_signature": obj.get("has_signature"), + "parameters": [SignatureParameterEntry.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, + "return_data_type_id": obj.get("return_data_type_id"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_signature_entry.py b/revengai/models/function_signature_entry.py new file mode 100644 index 00000000..58e6bbe8 --- /dev/null +++ b/revengai/models/function_signature_entry.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.signature_parameter_entry import SignatureParameterEntry +from typing import Optional, Set +from typing_extensions import Self + +class FunctionSignatureEntry(BaseModel): + """ + FunctionSignatureEntry + """ # noqa: E501 + calling_convention: Optional[StrictStr] = Field(default=None, description="Calling convention, when the producer reported one.") + created_at: Optional[datetime] = Field(default=None, description="When this signature was extracted.") + function_id: StrictInt + function_name: StrictStr = Field(description="Current name of the function.") + has_signature: StrictBool = Field(description="Whether a signature was extracted for this function. False is a normal result: no signature is recorded unless data type extraction ran for the analysis, and thunks and external functions are skipped when it does.") + parameters: Optional[List[SignatureParameterEntry]] = Field(description="Parameters in argument order. Empty with has_signature true means the function is known to take no arguments.") + return_data_type_id: Optional[StrictInt] = Field(default=None, description="Return type, resolvable against the analysis data types list. Absent for an unresolved return type.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this signature was copied from, when it was transferred rather than extracted.") + source_type: Optional[StrictStr] = Field(default=None, description="Where this signature came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["calling_convention", "created_at", "function_id", "function_name", "has_signature", "parameters", "return_data_type_id", "source_function_id", "source_type"] + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', '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 FunctionSignatureEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionSignatureEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "calling_convention": obj.get("calling_convention"), + "created_at": obj.get("created_at"), + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "has_signature": obj.get("has_signature"), + "parameters": [SignatureParameterEntry.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, + "return_data_type_id": obj.get("return_data_type_id"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_signature_version.py b/revengai/models/function_signature_version.py new file mode 100644 index 00000000..79336613 --- /dev/null +++ b/revengai/models/function_signature_version.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_signature_entry import FunctionSignatureEntry +from revengai.models.history_actor import HistoryActor +from typing import Optional, Set +from typing_extensions import Self + +class FunctionSignatureVersion(BaseModel): + """ + FunctionSignatureVersion + """ # noqa: E501 + updated_at: Optional[datetime] = Field(default=None, description="When this version was written. Absent on a version that predates the recorded history.") + updated_by: Optional[HistoryActor] = Field(default=None, description="Who wrote this version. Absent on a version that predates the recorded history.") + value: FunctionSignatureEntry = Field(description="The signature as it stood in this version.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["updated_at", "updated_by", "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 FunctionSignatureVersion from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of updated_by + if self.updated_by: + _dict['updated_by'] = self.updated_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionSignatureVersion from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "updated_at": obj.get("updated_at"), + "updated_by": HistoryActor.from_dict(obj["updated_by"]) if obj.get("updated_by") is not None else None, + "value": FunctionSignatureEntry.from_dict(obj["value"]) if obj.get("value") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_type_definition.py b/revengai/models/function_type_definition.py new file mode 100644 index 00000000..52fc33e7 --- /dev/null +++ b/revengai/models/function_type_definition.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_type_function_parameter_entry import DataTypeFunctionParameterEntry +from typing import Optional, Set +from typing_extensions import Self + +class FunctionTypeDefinition(BaseModel): + """ + FunctionTypeDefinition + """ # noqa: E501 + parameters: Optional[List[DataTypeFunctionParameterEntry]] = Field(description="The parameters, in argument order.") + return_data_type_id: Optional[StrictInt] = Field(default=None, description="The return type.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["parameters", "return_data_type_id"] + + 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 FunctionTypeDefinition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionTypeDefinition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parameters": [DataTypeFunctionParameterEntry.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, + "return_data_type_id": obj.get("return_data_type_id") + }) + # 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/generate_function_data_types.py b/revengai/models/generate_function_data_types.py deleted file mode 100644 index 1beb0c66..00000000 --- a/revengai/models/generate_function_data_types.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from revengai.models.generation_status_list import GenerationStatusList -from typing import Optional, Set -from typing_extensions import Self - -class GenerateFunctionDataTypes(BaseModel): - """ - GenerateFunctionDataTypes - """ # noqa: E501 - queued: StrictBool = Field(description="[DEPRECATED] This value has been replaced with the `data_types_list` field") - reference: StrictStr = Field(description="[DEPRECATED] This value has been replaced with the `data_types_list` field") - data_types_list: GenerationStatusList = Field(description="List of function data types information that are either already generated, or now queued for generation") - __properties: ClassVar[List[str]] = ["queued", "reference", "data_types_list"] - - 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 GenerateFunctionDataTypes 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_types_list - if self.data_types_list: - _dict['data_types_list'] = self.data_types_list.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GenerateFunctionDataTypes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queued": obj.get("queued"), - "reference": obj.get("reference"), - "data_types_list": GenerationStatusList.from_dict(obj["data_types_list"]) if obj.get("data_types_list") is not None else None - }) - return _obj - - diff --git a/revengai/models/generation_status_list.py b/revengai/models/generation_status_list.py deleted file mode 100644 index ecad74d7..00000000 --- a/revengai/models/generation_status_list.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_data_types_status import FunctionDataTypesStatus -from typing import Optional, Set -from typing_extensions import Self - -class GenerationStatusList(BaseModel): - """ - GenerationStatusList - """ # noqa: E501 - total_count: Optional[StrictInt] = Field(default=0, description="Total number of functions in analysis") - total_data_types_count: Optional[StrictInt] = Field(default=0, description="Total number of functions with data types") - items: List[FunctionDataTypesStatus] = Field(description="List of function data types information") - __properties: ClassVar[List[str]] = ["total_count", "total_data_types_count", "items"] - - 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 GenerationStatusList from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict['items'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GenerationStatusList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "total_count": obj.get("total_count") if obj.get("total_count") is not None else 0, - "total_data_types_count": obj.get("total_data_types_count") if obj.get("total_data_types_count") is not None else 0, - "items": [FunctionDataTypesStatus.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - }) - return _obj - - diff --git a/revengai/models/get_analysis_logs_output_body.py b/revengai/models/get_analysis_logs_output_body.py new file mode 100644 index 00000000..6a8beb98 --- /dev/null +++ b/revengai/models/get_analysis_logs_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_log_entry import AnalysisLogEntry +from typing import Optional, Set +from typing_extensions import Self + +class GetAnalysisLogsOutputBody(BaseModel): + """ + GetAnalysisLogsOutputBody + """ # noqa: E501 + entries: Optional[List[AnalysisLogEntry]] = Field(description="Analysis log lines, oldest first") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["entries"] + + 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 GetAnalysisLogsOutputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in entries (list) + _items = [] + if self.entries: + for _item_entries in self.entries: + if _item_entries: + _items.append(_item_entries.to_dict()) + _dict['entries'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if entries (nullable) is None + # and model_fields_set contains the field + if self.entries is None and "entries" in self.model_fields_set: + _dict['entries'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAnalysisLogsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "entries": [AnalysisLogEntry.from_dict(_item) for _item in obj["entries"]] if obj.get("entries") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/get_data_type_history_body.py b/revengai/models/get_data_type_history_body.py new file mode 100644 index 00000000..33b08205 --- /dev/null +++ b/revengai/models/get_data_type_history_body.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, Field +from typing import Any, ClassVar, Dict, List +from revengai.models.data_type_version import DataTypeVersion +from typing import Optional, Set +from typing_extensions import Self + +class GetDataTypeHistoryBody(BaseModel): + """ + GetDataTypeHistoryBody + """ # noqa: E501 + versions: List[DataTypeVersion] = Field(description="Every version of the type, newest first. The first element is the current value, so the list is never empty; a type that has never been edited has that one element only.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["versions"] + + 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 GetDataTypeHistoryBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in versions (list) + _items = [] + if self.versions: + for _item_versions in self.versions: + if _item_versions: + _items.append(_item_versions.to_dict()) + _dict['versions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDataTypeHistoryBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "versions": [DataTypeVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/get_function_signature_history_body.py b/revengai/models/get_function_signature_history_body.py new file mode 100644 index 00000000..986953d5 --- /dev/null +++ b/revengai/models/get_function_signature_history_body.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, Field +from typing import Any, ClassVar, Dict, List +from revengai.models.function_signature_version import FunctionSignatureVersion +from typing import Optional, Set +from typing_extensions import Self + +class GetFunctionSignatureHistoryBody(BaseModel): + """ + GetFunctionSignatureHistoryBody + """ # noqa: E501 + versions: List[FunctionSignatureVersion] = Field(description="Every version of the signature, newest first. The first element is the current value, so the list is never empty; a signature that has never been edited has that one element only.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["versions"] + + 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 GetFunctionSignatureHistoryBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in versions (list) + _items = [] + if self.versions: + for _item_versions in self.versions: + if _item_versions: + _items.append(_item_versions.to_dict()) + _dict['versions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetFunctionSignatureHistoryBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "versions": [FunctionSignatureVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/get_tokens_response.py b/revengai/models/get_tokens_response.py new file mode 100644 index 00000000..ef5d8923 --- /dev/null +++ b/revengai/models/get_tokens_response.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from revengai.models.rendered_token import RenderedToken +from revengai.models.token import Token +from typing import Optional, Set +from typing_extensions import Self + +class GetTokensResponse(BaseModel): + """ + GetTokensResponse + """ # noqa: E501 + ai_decomp: StrictStr = Field(description="Tokenised AI-decompilation. Includes generated comments. Empty until a run has succeeded.") + analysis_id: StrictInt = Field(description="Analysis the function belongs to. Scopes every data_type_id below.") + placeholder_to_rendered_token: Dict[str, RenderedToken] = Field(description="Each placeholder token mapped to the value the server would render in its place, and the record it refers to. Null until a run has succeeded.") + placeholder_to_user_override: Dict[str, Token] = Field(description="The caller's own overrides, keyed by token. Null until a run has succeeded.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["ai_decomp", "analysis_id", "placeholder_to_rendered_token", "placeholder_to_user_override"] + + 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 GetTokensResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in placeholder_to_rendered_token (dict) + _field_dict = {} + if self.placeholder_to_rendered_token: + for _key_placeholder_to_rendered_token in self.placeholder_to_rendered_token: + if self.placeholder_to_rendered_token[_key_placeholder_to_rendered_token]: + _field_dict[_key_placeholder_to_rendered_token] = self.placeholder_to_rendered_token[_key_placeholder_to_rendered_token].to_dict() + _dict['placeholder_to_rendered_token'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each value in placeholder_to_user_override (dict) + _field_dict = {} + if self.placeholder_to_user_override: + for _key_placeholder_to_user_override in self.placeholder_to_user_override: + if self.placeholder_to_user_override[_key_placeholder_to_user_override]: + _field_dict[_key_placeholder_to_user_override] = self.placeholder_to_user_override[_key_placeholder_to_user_override].to_dict() + _dict['placeholder_to_user_override'] = _field_dict + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetTokensResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ai_decomp": obj.get("ai_decomp"), + "analysis_id": obj.get("analysis_id"), + "placeholder_to_rendered_token": dict( + (_k, RenderedToken.from_dict(_v)) + for _k, _v in obj["placeholder_to_rendered_token"].items() + ) + if obj.get("placeholder_to_rendered_token") is not None + else None, + "placeholder_to_user_override": dict( + (_k, Token.from_dict(_v)) + for _k, _v in obj["placeholder_to_user_override"].items() + ) + if obj.get("placeholder_to_user_override") is not None + else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/global_variable.py b/revengai/models/global_variable.py deleted file mode 100644 index 136d3d74..00000000 --- a/revengai/models/global_variable.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class GlobalVariable(BaseModel): - """ - GlobalVariable - """ # noqa: E501 - last_change: Optional[StrictStr] = None - addr: StrictInt = Field(description="Memory address of the global variable") - name: StrictStr = Field(description="Name of the global variable") - type: StrictStr = Field(description="Data type of the global variable") - size: StrictInt = Field(description="Size of the global variable in bytes") - artifact_type: Optional[StrictStr] = Field(default=None, description="Type of artifact that the global variable is associated with") - __properties: ClassVar[List[str]] = ["last_change", "addr", "name", "type", "size", "artifact_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 GlobalVariable 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, - ) - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GlobalVariable from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "addr": obj.get("addr"), - "name": obj.get("name"), - "type": obj.get("type"), - "size": obj.get("size"), - "artifact_type": obj.get("artifact_type") - }) - return _obj - - diff --git a/revengai/models/ai_decomp_inverse_function_map_item.py b/revengai/models/history_actor.py similarity index 78% rename from revengai/models/ai_decomp_inverse_function_map_item.py rename to revengai/models/history_actor.py index 5a502410..d734f274 100644 --- a/revengai/models/ai_decomp_inverse_function_map_item.py +++ b/revengai/models/history_actor.py @@ -16,20 +16,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class AIDecompInverseFunctionMapItem(BaseModel): +class HistoryActor(BaseModel): """ - AIDecompInverseFunctionMapItem + HistoryActor """ # noqa: E501 - addr: Optional[StrictInt] - is_external: StrictBool - name: StrictStr + user_id: StrictInt = Field(description="The user who made the change.") + username: Optional[StrictStr] = Field(default=None, description="Absent when the user no longer exists.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["addr", "is_external", "name"] + __properties: ClassVar[List[str]] = ["user_id", "username"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AIDecompInverseFunctionMapItem from a JSON string""" + """Create an instance of HistoryActor from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,16 +76,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if addr (nullable) is None - # and model_fields_set contains the field - if self.addr is None and "addr" in self.model_fields_set: - _dict['addr'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AIDecompInverseFunctionMapItem from a dict""" + """Create an instance of HistoryActor from a dict""" if obj is None: return None @@ -94,9 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": obj.get("addr"), - "is_external": obj.get("is_external"), - "name": obj.get("name") + "user_id": obj.get("user_id"), + "username": obj.get("username") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/update_data_types_output_body.py b/revengai/models/line_attributions_data.py similarity index 76% rename from revengai/models/update_data_types_output_body.py rename to revengai/models/line_attributions_data.py index 0d75f614..52311a68 100644 --- a/revengai/models/update_data_types_output_body.py +++ b/revengai/models/line_attributions_data.py @@ -21,15 +21,13 @@ from typing import Optional, Set from typing_extensions import Self -class UpdateDataTypesOutputBody(BaseModel): +class LineAttributionsData(BaseModel): """ - UpdateDataTypesOutputBody + LineAttributionsData """ # noqa: E501 - data_types: Optional[Any] - data_types_version: StrictInt = Field(description="Version of the stored function data types after the update") - function_id: StrictInt = Field(description="Function ID") + disassembly_line_number_to_ai_decompilation_line_numbers: Dict[str, Optional[List[StrictInt]]] = Field(description="Each disassembly line number mapped to the AI-decompilation line numbers it fed, e.g. {\"12\": [3, 4, 6], \"17\": [4]}. Both sides 0-based; many-to-many in both directions. Empty when no completed run has produced a correspondence, which is ordinary and not an error.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "function_id"] + __properties: ClassVar[List[str]] = ["disassembly_line_number_to_ai_decompilation_line_numbers"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateDataTypesOutputBody from a JSON string""" + """Create an instance of LineAttributionsData from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,16 +75,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if data_types (nullable) is None - # and model_fields_set contains the field - if self.data_types is None and "data_types" in self.model_fields_set: - _dict['data_types'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateDataTypesOutputBody from a dict""" + """Create an instance of LineAttributionsData from a dict""" if obj is None: return None @@ -94,9 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "data_types": obj.get("data_types"), - "data_types_version": obj.get("data_types_version"), - "function_id": obj.get("function_id") + "disassembly_line_number_to_ai_decompilation_line_numbers": obj.get("disassembly_line_number_to_ai_decompilation_line_numbers") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/list_analysis_functions_data_types_output_body.py b/revengai/models/list_analysis_data_types_output_body.py similarity index 85% rename from revengai/models/list_analysis_functions_data_types_output_body.py rename to revengai/models/list_analysis_data_types_output_body.py index 3c36453a..f36e478c 100644 --- a/revengai/models/list_analysis_functions_data_types_output_body.py +++ b/revengai/models/list_analysis_data_types_output_body.py @@ -18,16 +18,16 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.data_types_entry import DataTypesEntry +from revengai.models.data_type_entry import DataTypeEntry from typing import Optional, Set from typing_extensions import Self -class ListAnalysisFunctionsDataTypesOutputBody(BaseModel): +class ListAnalysisDataTypesOutputBody(BaseModel): """ - ListAnalysisFunctionsDataTypesOutputBody + ListAnalysisDataTypesOutputBody """ # noqa: E501 - items: Optional[List[DataTypesEntry]] - total_count: StrictInt = Field(description="Total functions in the analysis, ignoring pagination.") + items: Optional[List[DataTypeEntry]] + total_count: StrictInt = Field(description="Total types matching the filters, ignoring pagination.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["items", "total_count"] @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListAnalysisFunctionsDataTypesOutputBody from a JSON string""" + """Create an instance of ListAnalysisDataTypesOutputBody from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -93,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListAnalysisFunctionsDataTypesOutputBody from a dict""" + """Create an instance of ListAnalysisDataTypesOutputBody from a dict""" if obj is None: return None @@ -101,7 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "items": [DataTypesEntry.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "items": [DataTypeEntry.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, "total_count": obj.get("total_count") }) # store additional fields in additional_properties diff --git a/revengai/models/list_data_type_functions_body.py b/revengai/models/list_data_type_functions_body.py new file mode 100644 index 00000000..96789e34 --- /dev/null +++ b/revengai/models/list_data_type_functions_body.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, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_type_function_entry import DataTypeFunctionEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListDataTypeFunctionsBody(BaseModel): + """ + ListDataTypeFunctionsBody + """ # noqa: E501 + items: List[DataTypeFunctionEntry] = Field(description="The page of matching functions, in ascending function ID order. Empty when no function uses the type.") + next_after_function_id: Optional[StrictInt] = Field(default=None, description="Pass as after_function_id to fetch the next page. Absent on the last page.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["items", "next_after_function_id"] + + 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 ListDataTypeFunctionsBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListDataTypeFunctionsBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [DataTypeFunctionEntry.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "next_after_function_id": obj.get("next_after_function_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/list_function_signatures_output_body.py b/revengai/models/list_function_signatures_output_body.py new file mode 100644 index 00000000..dc0845f4 --- /dev/null +++ b/revengai/models/list_function_signatures_output_body.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_data_types_group import AnalysisDataTypesGroup +from revengai.models.batch_function_signature_entry import BatchFunctionSignatureEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListFunctionSignaturesOutputBody(BaseModel): + """ + ListFunctionSignaturesOutputBody + """ # noqa: E501 + data_types: Optional[List[AnalysisDataTypesGroup]] = Field(default=None, description="The types the returned signatures name, grouped by analysis and ordered by analysis_id. Returned only when include_data_types is true.") + items: Optional[List[BatchFunctionSignatureEntry]] = Field(description="One entry per distinct requested function ID, in request order. A repeated ID yields one entry.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "items"] + + 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 ListFunctionSignaturesOutputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + # set to None if items (nullable) is None + # and model_fields_set contains the field + if self.items is None and "items" in self.model_fields_set: + _dict['items'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListFunctionSignaturesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_types": [AnalysisDataTypesGroup.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None, + "items": [BatchFunctionSignatureEntry.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/match_filters.py b/revengai/models/match_filters.py index 4ac62989..6eb4c5ea 100644 --- a/revengai/models/match_filters.py +++ b/revengai/models/match_filters.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -25,35 +25,38 @@ class MatchFilters(BaseModel): """ MatchFilters """ # noqa: E501 - arch: Optional[StrictStr] = Field(default=None, description="Restrict matches to this architecture (multi-platform models only; matches all architectures if omitted). Rejected for single-architecture models.") + architectures: Optional[List[StrictStr]] = Field(default=None, description="Restrict matches to candidates whose binary was detected as one of these architectures. Word size is part of the value, so there is no separate bits filter. Matches all architectures if omitted.") binary_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to these binary IDs.") - bits: Optional[StrictInt] = Field(default=None, description="Restrict matches to this word size (multi-platform models only). Rejected for single-architecture models.") collection_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to binaries in these collection IDs.") - debug_types: Optional[List[StrictStr]] = Field(default=None, description="Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER.") + debug: Optional[StrictBool] = Field(default=None, description="Restrict matches to candidates with auto/system debug symbols. Multi-platform models only; rejected for single-architecture models.") + debug_types: Optional[List[Optional[StrictStr]]] = Field(default=None, description="Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER.") function_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to these function IDs.") - platform: Optional[StrictStr] = Field(default=None, description="Restrict matches to this platform (multi-platform models only; matches all platforms if omitted). Rejected for single-architecture models.") + include_user_debug: Optional[StrictBool] = Field(default=None, description="When debug is set, also match user-named functions (not only auto/system debug). No effect unless debug is true.") + platforms: Optional[List[StrictStr]] = Field(default=None, description="Restrict matches to candidates whose binary was detected as one of these platforms. Matches all platforms if omitted; a binary whose detection has not run is never matched by a non-empty filter.") user_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to functions owned by these user IDs.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["arch", "binary_ids", "bits", "collection_ids", "debug_types", "function_ids", "platform", "user_ids"] + __properties: ClassVar[List[str]] = ["architectures", "binary_ids", "collection_ids", "debug", "debug_types", "function_ids", "include_user_debug", "platforms", "user_ids"] - @field_validator('arch') - def arch_validate_enum(cls, value): + @field_validator('architectures') + def architectures_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['x86', 'arm', 'unknown', 'unknown_default_open_api']): - raise ValueError("must be one of enum values ('x86', 'arm', 'unknown', 'unknown_default_open_api')") + for i in value: + if i not in set(['x86_64', 'x86_32', 'arm_64', 'unknown_default_open_api']): + raise ValueError("each list item must be one of ('x86_64', 'x86_32', 'arm_64', 'unknown_default_open_api')") return value - @field_validator('platform') - def platform_validate_enum(cls, value): + @field_validator('platforms') + def platforms_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['linux', 'windows', 'android', 'macos', 'unknown', 'unknown_default_open_api']): - raise ValueError("must be one of enum values ('linux', 'windows', 'android', 'macos', 'unknown', 'unknown_default_open_api')") + for i in value: + if i not in set(['windows', 'linux', 'android', 'unknown_default_open_api']): + raise ValueError("each list item must be one of ('windows', 'linux', 'android', 'unknown_default_open_api')") return value model_config = ConfigDict( @@ -102,6 +105,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if architectures (nullable) is None + # and model_fields_set contains the field + if self.architectures is None and "architectures" in self.model_fields_set: + _dict['architectures'] = None + # set to None if binary_ids (nullable) is None # and model_fields_set contains the field if self.binary_ids is None and "binary_ids" in self.model_fields_set: @@ -122,6 +130,11 @@ def to_dict(self) -> Dict[str, Any]: if self.function_ids is None and "function_ids" in self.model_fields_set: _dict['function_ids'] = None + # set to None if platforms (nullable) is None + # and model_fields_set contains the field + if self.platforms is None and "platforms" in self.model_fields_set: + _dict['platforms'] = None + # set to None if user_ids (nullable) is None # and model_fields_set contains the field if self.user_ids is None and "user_ids" in self.model_fields_set: @@ -139,13 +152,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "arch": obj.get("arch"), + "architectures": obj.get("architectures"), "binary_ids": obj.get("binary_ids"), - "bits": obj.get("bits"), "collection_ids": obj.get("collection_ids"), + "debug": obj.get("debug"), "debug_types": obj.get("debug_types"), "function_ids": obj.get("function_ids"), - "platform": obj.get("platform"), + "include_user_debug": obj.get("include_user_debug"), + "platforms": obj.get("platforms"), "user_ids": obj.get("user_ids") }) # store additional fields in additional_properties diff --git a/revengai/models/pointer_data_type.py b/revengai/models/pointer_data_type.py new file mode 100644 index 00000000..c3d736ec --- /dev/null +++ b/revengai/models/pointer_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.pointer_definition import PointerDefinition +from typing import Optional, Set +from typing_extensions import Self + +class PointerDataType(BaseModel): + """ + PointerDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[PointerDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['POINTER', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('POINTER', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 PointerDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PointerDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": PointerDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/ai_decomp_inverse_string_map_item.py b/revengai/models/pointer_definition.py similarity index 80% rename from revengai/models/ai_decomp_inverse_string_map_item.py rename to revengai/models/pointer_definition.py index d36c380a..ba84587c 100644 --- a/revengai/models/ai_decomp_inverse_string_map_item.py +++ b/revengai/models/pointer_definition.py @@ -16,19 +16,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class AIDecompInverseStringMapItem(BaseModel): +class PointerDefinition(BaseModel): """ - AIDecompInverseStringMapItem + PointerDefinition """ # noqa: E501 - addr: Optional[StrictInt] - string: StrictStr + pointee_data_type_id: Optional[StrictInt] = Field(default=None, description="The type pointed at.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["addr", "string"] + __properties: ClassVar[List[str]] = ["pointee_data_type_id"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AIDecompInverseStringMapItem from a JSON string""" + """Create an instance of PointerDefinition from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,16 +75,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if addr (nullable) is None - # and model_fields_set contains the field - if self.addr is None and "addr" in self.model_fields_set: - _dict['addr'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AIDecompInverseStringMapItem from a dict""" + """Create an instance of PointerDefinition from a dict""" if obj is None: return None @@ -93,8 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": obj.get("addr"), - "string": obj.get("string") + "pointee_data_type_id": obj.get("pointee_data_type_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/data_types_entry.py b/revengai/models/rename_unnamed_functions_result.py similarity index 73% rename from revengai/models/data_types_entry.py rename to revengai/models/rename_unnamed_functions_result.py index ac7cf46d..8244a924 100644 --- a/revengai/models/data_types_entry.py +++ b/revengai/models/rename_unnamed_functions_result.py @@ -17,20 +17,21 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_info import FunctionInfo +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class DataTypesEntry(BaseModel): +class RenameUnnamedFunctionsResult(BaseModel): """ - DataTypesEntry + RenameUnnamedFunctionsResult """ # noqa: E501 - data_types: Optional[FunctionInfo] = None - data_types_version: StrictInt = Field(description="Current version of the function data types. Pass this back on the next write to satisfy the CAS check.") - function_id: StrictInt + analysis_id: StrictInt = Field(description="Analysis the run was performed against") + failed: StrictInt = Field(description="Functions whose rename attempt errored") + renamed: StrictInt = Field(description="Functions successfully renamed") + skipped: StrictInt = Field(description="Functions the agent chose not to rename") + total: StrictInt = Field(description="Unnamed functions the run considered") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "function_id"] + __properties: ClassVar[List[str]] = ["analysis_id", "failed", "renamed", "skipped", "total"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DataTypesEntry from a JSON string""" + """Create an instance of RenameUnnamedFunctionsResult from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,9 +74,6 @@ 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_types - if self.data_types: - _dict['data_types'] = self.data_types.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -85,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataTypesEntry from a dict""" + """Create an instance of RenameUnnamedFunctionsResult from a dict""" if obj is None: return None @@ -93,9 +91,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "data_types": FunctionInfo.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, - "data_types_version": obj.get("data_types_version"), - "function_id": obj.get("function_id") + "analysis_id": obj.get("analysis_id"), + "failed": obj.get("failed"), + "renamed": obj.get("renamed"), + "skipped": obj.get("skipped"), + "total": obj.get("total") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/rendered_token.py b/revengai/models/rendered_token.py new file mode 100644 index 00000000..ed7d7f51 --- /dev/null +++ b/revengai/models/rendered_token.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RenderedToken(BaseModel): + """ + RenderedToken + """ # noqa: E501 + data_type_id: Optional[StrictInt] = Field(default=None, description="Data type this token names, or for a field the type that declares it. Scoped by the response's analysis_id.") + function_id: Optional[StrictInt] = Field(default=None, description="Function this token calls or names. Absent when the address reaches no function of this binary.") + imported_function_id: Optional[StrictInt] = Field(default=None, description="Imported function this token calls. Set instead of function_id for an external call.") + kind: StrictStr = Field(description="What the token names.") + vaddr: Optional[StrictInt] = Field(default=None, description="Virtual address the token resolves to. Absent for a token with no address.") + value: StrictStr = Field(description="Name the token resolves to.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "function_id", "imported_function_id", "kind", "vaddr", "value"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['own_function', 'function', 'funcptr', 'type', 'field', 'param', 'local', 'global', 'enum', 'label', 'string', 'float', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('own_function', 'function', 'funcptr', 'type', 'field', 'param', 'local', 'global', 'enum', 'label', 'string', 'float', '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 RenderedToken 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 RenderedToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "function_id": obj.get("function_id"), + "imported_function_id": obj.get("imported_function_id"), + "kind": obj.get("kind"), + "vaddr": obj.get("vaddr"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/resolved_entity.py b/revengai/models/resolved_entity.py new file mode 100644 index 00000000..101f03b3 --- /dev/null +++ b/revengai/models/resolved_entity.py @@ -0,0 +1,252 @@ +# 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, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ResolvedEntity(BaseModel): + """ + ResolvedEntity + """ # noqa: E501 + addr_token: Optional[StrictStr] + all_addr_tokens: Optional[List[StrictStr]] + bit_offset: Optional[StrictInt] + byte_offset: Optional[StrictInt] + byte_size: Optional[StrictInt] + count: StrictInt + data_type_index: Optional[StrictInt] + field_status: Optional[StrictStr] = None + function_id: Optional[StrictInt] = None + imported_function_id: Optional[StrictInt] = None + kind: Optional[StrictStr] + name: Optional[StrictStr] + name_source: StrictStr + needs_naming: StrictBool + provenance: Optional[StrictStr] + resolved_name: Optional[StrictStr] + suggested_type: Optional[StrictStr] + suggestion_confidence: Optional[StrictStr] + token: Optional[StrictStr] + type_index: Optional[StrictInt] + vaddr: Optional[StrictInt] + value: Optional[StrictStr] + value_confidence: Optional[StrictStr] + value_type: Optional[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["addr_token", "all_addr_tokens", "bit_offset", "byte_offset", "byte_size", "count", "data_type_index", "field_status", "function_id", "imported_function_id", "kind", "name", "name_source", "needs_naming", "provenance", "resolved_name", "suggested_type", "suggestion_confidence", "token", "type_index", "vaddr", "value", "value_confidence", "value_type"] + + @field_validator('field_status') + def field_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['backed', 'unbacked', 'unmatched', 'ambiguous', 'unkeyed', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('backed', 'unbacked', 'unmatched', 'ambiguous', 'unkeyed', 'unknown_default_open_api')") + return value + + @field_validator('name_source') + def name_source_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['database', 'frozen', 'default', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('database', 'frozen', 'default', '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 ResolvedEntity 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 addr_token (nullable) is None + # and model_fields_set contains the field + if self.addr_token is None and "addr_token" in self.model_fields_set: + _dict['addr_token'] = None + + # set to None if all_addr_tokens (nullable) is None + # and model_fields_set contains the field + if self.all_addr_tokens is None and "all_addr_tokens" in self.model_fields_set: + _dict['all_addr_tokens'] = None + + # set to None if bit_offset (nullable) is None + # and model_fields_set contains the field + if self.bit_offset is None and "bit_offset" in self.model_fields_set: + _dict['bit_offset'] = None + + # set to None if byte_offset (nullable) is None + # and model_fields_set contains the field + if self.byte_offset is None and "byte_offset" in self.model_fields_set: + _dict['byte_offset'] = None + + # set to None if byte_size (nullable) is None + # and model_fields_set contains the field + if self.byte_size is None and "byte_size" in self.model_fields_set: + _dict['byte_size'] = None + + # set to None if data_type_index (nullable) is None + # and model_fields_set contains the field + if self.data_type_index is None and "data_type_index" in self.model_fields_set: + _dict['data_type_index'] = None + + # set to None if kind (nullable) is None + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: + _dict['kind'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if provenance (nullable) is None + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: + _dict['provenance'] = None + + # set to None if resolved_name (nullable) is None + # and model_fields_set contains the field + if self.resolved_name is None and "resolved_name" in self.model_fields_set: + _dict['resolved_name'] = None + + # set to None if suggested_type (nullable) is None + # and model_fields_set contains the field + if self.suggested_type is None and "suggested_type" in self.model_fields_set: + _dict['suggested_type'] = None + + # set to None if suggestion_confidence (nullable) is None + # and model_fields_set contains the field + if self.suggestion_confidence is None and "suggestion_confidence" in self.model_fields_set: + _dict['suggestion_confidence'] = None + + # set to None if token (nullable) is None + # and model_fields_set contains the field + if self.token is None and "token" in self.model_fields_set: + _dict['token'] = None + + # set to None if type_index (nullable) is None + # and model_fields_set contains the field + if self.type_index is None and "type_index" in self.model_fields_set: + _dict['type_index'] = None + + # set to None if vaddr (nullable) is None + # and model_fields_set contains the field + if self.vaddr is None and "vaddr" in self.model_fields_set: + _dict['vaddr'] = None + + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + # set to None if value_confidence (nullable) is None + # and model_fields_set contains the field + if self.value_confidence is None and "value_confidence" in self.model_fields_set: + _dict['value_confidence'] = None + + # set to None if value_type (nullable) is None + # and model_fields_set contains the field + if self.value_type is None and "value_type" in self.model_fields_set: + _dict['value_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResolvedEntity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "addr_token": obj.get("addr_token"), + "all_addr_tokens": obj.get("all_addr_tokens"), + "bit_offset": obj.get("bit_offset"), + "byte_offset": obj.get("byte_offset"), + "byte_size": obj.get("byte_size"), + "count": obj.get("count"), + "data_type_index": obj.get("data_type_index"), + "field_status": obj.get("field_status"), + "function_id": obj.get("function_id"), + "imported_function_id": obj.get("imported_function_id"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "name_source": obj.get("name_source"), + "needs_naming": obj.get("needs_naming"), + "provenance": obj.get("provenance"), + "resolved_name": obj.get("resolved_name"), + "suggested_type": obj.get("suggested_type"), + "suggestion_confidence": obj.get("suggestion_confidence"), + "token": obj.get("token"), + "type_index": obj.get("type_index"), + "vaddr": obj.get("vaddr"), + "value": obj.get("value"), + "value_confidence": obj.get("value_confidence"), + "value_type": obj.get("value_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/segment_info.py b/revengai/models/segment_info.py index 89aaeefa..c4c9fede 100644 --- a/revengai/models/segment_info.py +++ b/revengai/models/segment_info.py @@ -23,7 +23,7 @@ class SegmentInfo(BaseModel): """ - Represents the information about a segment. Attributes: name: The name of the segment. r: Determines if the segment has read permission. w: Determines if the segment has write permission. x: Determines if the segment has execute permission. start: The start address of the segment. end: The end address of the segment. + Represents the information about a segment. Attributes: name: The name of the segment. r: Determines if the segment has read permission. w: Determines if the segment has write permission. x: Determines if the segment has execute permission. start: The start address of the segment. end: The end address of the segment (inclusive). kind: Coarse classification of the segment: \"code\", \"data\", or \"other\". """ # noqa: E501 name: Optional[StrictStr] = '' r: Optional[StrictBool] = None @@ -31,7 +31,8 @@ class SegmentInfo(BaseModel): x: Optional[StrictBool] = None start: Optional[StrictInt] = 0 end: Optional[StrictInt] = 0 - __properties: ClassVar[List[str]] = ["name", "r", "w", "x", "start", "end"] + kind: Optional[StrictStr] = 'other' + __properties: ClassVar[List[str]] = ["name", "r", "w", "x", "start", "end", "kind"] model_config = ConfigDict( populate_by_name=True, @@ -104,7 +105,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "w": obj.get("w"), "x": obj.get("x"), "start": obj.get("start") if obj.get("start") is not None else 0, - "end": obj.get("end") if obj.get("end") is not None else 0 + "end": obj.get("end") if obj.get("end") is not None else 0, + "kind": obj.get("kind") if obj.get("kind") is not None else 'other' }) return _obj diff --git a/revengai/models/function_header.py b/revengai/models/signature_parameter_entry.py similarity index 68% rename from revengai/models/function_header.py rename to revengai/models/signature_parameter_entry.py index 8da28420..64fc46f6 100644 --- a/revengai/models/function_header.py +++ b/revengai/models/signature_parameter_entry.py @@ -18,22 +18,21 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_argument import FunctionArgument +from revengai.models.signature_storage_entry import SignatureStorageEntry from typing import Optional, Set from typing_extensions import Self -class FunctionHeader(BaseModel): +class SignatureParameterEntry(BaseModel): """ - FunctionHeader + SignatureParameterEntry """ # noqa: E501 - addr: StrictInt - args: Dict[str, FunctionArgument] = Field(description="Argument map keyed by ordinal hex (e.g. \"0x0\", \"0x1\").") - last_change: Optional[StrictStr] = None - name: StrictStr - scope: Optional[StrictStr] = None - type: StrictStr + bit_length: Optional[StrictInt] = Field(default=None, description="Width in bits, when the parameter occupies less than its type's full size.") + data_type_id: Optional[StrictInt] = Field(default=None, description="The parameter's type, resolvable against the analysis data types list. Absent when the type could not be resolved.") + name: Optional[StrictStr] = Field(default=None, description="Parameter name, absent when the producer had none.") + ordinal: StrictInt = Field(description="Zero-based argument position.") + storage: Optional[SignatureStorageEntry] = Field(default=None, description="Where the parameter is passed.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["addr", "args", "last_change", "name", "scope", "type"] + __properties: ClassVar[List[str]] = ["bit_length", "data_type_id", "name", "ordinal", "storage"] model_config = ConfigDict( populate_by_name=True, @@ -53,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionHeader from a JSON string""" + """Create an instance of SignatureParameterEntry from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,13 +75,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each value in args (dict) - _field_dict = {} - if self.args: - for _key_args in self.args: - if self.args[_key_args]: - _field_dict[_key_args] = self.args[_key_args].to_dict() - _dict['args'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -92,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionHeader from a dict""" + """Create an instance of SignatureParameterEntry from a dict""" if obj is None: return None @@ -100,17 +95,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": obj.get("addr"), - "args": dict( - (_k, FunctionArgument.from_dict(_v)) - for _k, _v in obj["args"].items() - ) - if obj.get("args") is not None - else None, - "last_change": obj.get("last_change"), + "bit_length": obj.get("bit_length"), + "data_type_id": obj.get("data_type_id"), "name": obj.get("name"), - "scope": obj.get("scope"), - "type": obj.get("type") + "ordinal": obj.get("ordinal"), + "storage": SignatureStorageEntry.from_dict(obj["storage"]) if obj.get("storage") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/signature_parameter_input.py b/revengai/models/signature_parameter_input.py new file mode 100644 index 00000000..83335485 --- /dev/null +++ b/revengai/models/signature_parameter_input.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.signature_storage_input import SignatureStorageInput +from typing import Optional, Set +from typing_extensions import Self + +class SignatureParameterInput(BaseModel): + """ + SignatureParameterInput + """ # noqa: E501 + bit_length: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Width in bits, when the parameter occupies less than its type's full size.") + data_type_id: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The parameter's type, which must belong to this analysis. Omit for an unresolved type.") + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Parameter name. Omit for an unnamed parameter.") + ordinal: Annotated[int, Field(strict=True, ge=0)] = Field(description="Zero-based argument position. Must equal the parameter's index in the list.") + storage: Optional[SignatureStorageInput] = Field(default=None, description="Where the parameter is passed.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["bit_length", "data_type_id", "name", "ordinal", "storage"] + + 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 SignatureParameterInput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureParameterInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bit_length": obj.get("bit_length"), + "data_type_id": obj.get("data_type_id"), + "name": obj.get("name"), + "ordinal": obj.get("ordinal"), + "storage": SignatureStorageInput.from_dict(obj["storage"]) if obj.get("storage") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/signature_storage_entry.py b/revengai/models/signature_storage_entry.py new file mode 100644 index 00000000..c9eaa0ee --- /dev/null +++ b/revengai/models/signature_storage_entry.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SignatureStorageEntry(BaseModel): + """ + SignatureStorageEntry + """ # noqa: E501 + kind: Optional[StrictStr] = Field(default=None, description="Storage class — typically reg, stack, mem or unknown. Not restricted to a fixed set.") + location: Optional[StrictStr] = Field(default=None, description="Register name or stack slot.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["kind", "location"] + + 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 SignatureStorageEntry 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 SignatureStorageEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "kind": obj.get("kind"), + "location": obj.get("location") + }) + # 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/function_stack_variable.py b/revengai/models/signature_storage_input.py similarity index 77% rename from revengai/models/function_stack_variable.py rename to revengai/models/signature_storage_input.py index 4221cc84..97215350 100644 --- a/revengai/models/function_stack_variable.py +++ b/revengai/models/signature_storage_input.py @@ -16,24 +16,20 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class FunctionStackVariable(BaseModel): +class SignatureStorageInput(BaseModel): """ - FunctionStackVariable + SignatureStorageInput """ # noqa: E501 - addr: StrictInt - last_change: Optional[StrictStr] = None - name: StrictStr - offset: StrictInt - scope: Optional[StrictStr] = None - size: StrictInt - type: StrictStr + kind: Optional[Annotated[str, Field(strict=True, max_length=32)]] = Field(default=None, description="Storage class — typically reg, stack, mem or unknown. Not restricted to a fixed set.") + location: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="Register name or stack slot.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["addr", "last_change", "name", "offset", "scope", "size", "type"] + __properties: ClassVar[List[str]] = ["kind", "location"] model_config = ConfigDict( populate_by_name=True, @@ -53,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionStackVariable from a JSON string""" + """Create an instance of SignatureStorageInput from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -85,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionStackVariable from a dict""" + """Create an instance of SignatureStorageInput from a dict""" if obj is None: return None @@ -93,13 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": obj.get("addr"), - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "offset": obj.get("offset"), - "scope": obj.get("scope"), - "size": obj.get("size"), - "type": obj.get("type") + "kind": obj.get("kind"), + "location": obj.get("location") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/stack_variable.py b/revengai/models/stack_variable.py deleted file mode 100644 index 03162681..00000000 --- a/revengai/models/stack_variable.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class StackVariable(BaseModel): - """ - StackVariable - """ # noqa: E501 - last_change: Optional[StrictStr] = None - offset: StrictInt = Field(description="Offset of the stack variable") - name: StrictStr = Field(description="Name of the stack variable") - type: StrictStr = Field(description="Data type of the stack variable") - size: StrictInt = Field(description="Size of the stack variable in bytes") - addr: StrictInt = Field(description="Memory address of the stack variable") - __properties: ClassVar[List[str]] = ["last_change", "offset", "name", "type", "size", "addr"] - - 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 StackVariable 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, - ) - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of StackVariable from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "offset": obj.get("offset"), - "name": obj.get("name"), - "type": obj.get("type"), - "size": obj.get("size"), - "addr": obj.get("addr") - }) - return _obj - - diff --git a/revengai/models/batch_update_data_types_result.py b/revengai/models/status_body.py similarity index 68% rename from revengai/models/batch_update_data_types_result.py rename to revengai/models/status_body.py index 6d087595..6d0bad4f 100644 --- a/revengai/models/batch_update_data_types_result.py +++ b/revengai/models/status_body.py @@ -16,28 +16,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class BatchUpdateDataTypesResult(BaseModel): +class StatusBody(BaseModel): """ - BatchUpdateDataTypesResult + StatusBody """ # noqa: E501 - data_types: Optional[Any] = None - data_types_version: Optional[StrictInt] = Field(default=None, description="Version after update (present when status is 'updated')") - error: Optional[StrictStr] = Field(default=None, description="Error message (present when status is 'error')") - function_id: StrictInt = Field(description="Function ID") - status: StrictStr = Field(description="Outcome for this function") + error_message: Optional[StrictStr] = Field(default=None, description="Why the run failed. Only set when status is FAILED.") + log_history: Optional[List[Annotated[List[Any], Field(min_length=2, max_length=2)]]] = Field(default=None, description="Progress messages the run recorded, oldest first.") + status: StrictStr = Field(description="Run status. UNINITIALISED means the agent has never been triggered for this analysis.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "error", "function_id", "status"] + __properties: ClassVar[List[str]] = ["error_message", "log_history", "status"] @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['updated', 'version_conflict', 'error', 'unknown_default_open_api']): - raise ValueError("must be one of enum values ('updated', 'version_conflict', 'error', 'unknown_default_open_api')") + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'unknown_default_open_api')") return value model_config = ConfigDict( @@ -58,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesResult from a JSON string""" + """Create an instance of StatusBody from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -86,16 +85,16 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if data_types (nullable) is None + # set to None if log_history (nullable) is None # and model_fields_set contains the field - if self.data_types is None and "data_types" in self.model_fields_set: - _dict['data_types'] = None + if self.log_history is None and "log_history" in self.model_fields_set: + _dict['log_history'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesResult from a dict""" + """Create an instance of StatusBody from a dict""" if obj is None: return None @@ -103,10 +102,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "data_types": obj.get("data_types"), - "data_types_version": obj.get("data_types_version"), - "error": obj.get("error"), - "function_id": obj.get("function_id"), + "error_message": obj.get("error_message"), + "log_history": obj.get("log_history"), "status": obj.get("status") }) # store additional fields in additional_properties diff --git a/revengai/models/struct_data_type.py b/revengai/models/struct_data_type.py new file mode 100644 index 00000000..f69cd0de --- /dev/null +++ b/revengai/models/struct_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.struct_definition import StructDefinition +from typing import Optional, Set +from typing_extensions import Self + +class StructDataType(BaseModel): + """ + StructDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[StructDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['STRUCT', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('STRUCT', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 StructDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StructDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": StructDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_update_data_types_output_body.py b/revengai/models/struct_definition.py similarity index 74% rename from revengai/models/batch_update_data_types_output_body.py rename to revengai/models/struct_definition.py index f4db7d1b..09b5ddba 100644 --- a/revengai/models/batch_update_data_types_output_body.py +++ b/revengai/models/struct_definition.py @@ -18,17 +18,17 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult +from revengai.models.data_type_member_entry import DataTypeMemberEntry from typing import Optional, Set from typing_extensions import Self -class BatchUpdateDataTypesOutputBody(BaseModel): +class StructDefinition(BaseModel): """ - BatchUpdateDataTypesOutputBody + StructDefinition """ # noqa: E501 - results: Optional[List[BatchUpdateDataTypesResult]] = Field(description="Per-function outcomes in the same order as the input") + members: Optional[List[DataTypeMemberEntry]] = Field(description="The type's fields, in offset order.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["results"] + __properties: ClassVar[List[str]] = ["members"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesOutputBody from a JSON string""" + """Create an instance of StructDefinition from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,28 +71,28 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in results (list) + # override the default output from pydantic by calling `to_dict()` of each item in members (list) _items = [] - if self.results: - for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) - _dict['results'] = _items + if self.members: + for _item_members in self.members: + if _item_members: + _items.append(_item_members.to_dict()) + _dict['members'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if results (nullable) is None + # set to None if members (nullable) is None # and model_fields_set contains the field - if self.results is None and "results" in self.model_fields_set: - _dict['results'] = None + if self.members is None and "members" in self.model_fields_set: + _dict['members'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BatchUpdateDataTypesOutputBody from a dict""" + """Create an instance of StructDefinition from a dict""" if obj is None: return None @@ -100,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "results": [BatchUpdateDataTypesResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + "members": [DataTypeMemberEntry.from_dict(_item) for _item in obj["members"]] if obj.get("members") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/structure.py b/revengai/models/structure.py deleted file mode 100644 index 9fb91596..00000000 --- a/revengai/models/structure.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.structure_member import StructureMember -from typing import Optional, Set -from typing_extensions import Self - -class Structure(BaseModel): - """ - Structure - """ # noqa: E501 - last_change: Optional[StrictStr] = None - name: StrictStr = Field(description="Name of the structure") - size: Optional[StrictInt] = None - members: Dict[str, StructureMember] = Field(description="Dictionary of structure members") - artifact_type: Optional[StrictStr] = Field(default=None, description="Type of artifact that the structure is associated with") - __properties: ClassVar[List[str]] = ["last_change", "name", "size", "members", "artifact_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 Structure from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each value in members (dict) - _field_dict = {} - if self.members: - for _key_members in self.members: - if self.members[_key_members]: - _field_dict[_key_members] = self.members[_key_members].to_dict() - _dict['members'] = _field_dict - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - # set to None if size (nullable) is None - # and model_fields_set contains the field - if self.size is None and "size" in self.model_fields_set: - _dict['size'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Structure from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "size": obj.get("size"), - "members": dict( - (_k, StructureMember.from_dict(_v)) - for _k, _v in obj["members"].items() - ) - if obj.get("members") is not None - else None, - "artifact_type": obj.get("artifact_type") - }) - return _obj - - diff --git a/revengai/models/structure_member.py b/revengai/models/structure_member.py deleted file mode 100644 index ace2a473..00000000 --- a/revengai/models/structure_member.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class StructureMember(BaseModel): - """ - StructureMember - """ # noqa: E501 - last_change: Optional[StrictStr] = None - name: StrictStr = Field(description="Name of the structure member") - offset: StrictInt = Field(description="Offset of the member within the structure") - type: StrictStr = Field(description="Data type of the structure member") - size: StrictInt = Field(description="Size of the structure member in bytes") - __properties: ClassVar[List[str]] = ["last_change", "name", "offset", "type", "size"] - - 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 StructureMember 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, - ) - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of StructureMember from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "offset": obj.get("offset"), - "type": obj.get("type"), - "size": obj.get("size") - }) - return _obj - - diff --git a/revengai/models/replacement_value.py b/revengai/models/token.py similarity index 89% rename from revengai/models/replacement_value.py rename to revengai/models/token.py index 6d2fc024..d1153fb9 100644 --- a/revengai/models/replacement_value.py +++ b/revengai/models/token.py @@ -16,16 +16,16 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class ReplacementValue(BaseModel): +class Token(BaseModel): """ - ReplacementValue + Token """ # noqa: E501 - value: StrictStr + value: StrictStr = Field(description="Name the token resolves to. An empty string in a request removes the override.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["value"] @@ -47,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReplacementValue from a JSON string""" + """Create an instance of Token from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReplacementValue from a dict""" + """Create an instance of Token from a dict""" if obj is None: return None diff --git a/revengai/models/tokenised_data.py b/revengai/models/tokenised_data.py index f42ddbd5..ac292114 100644 --- a/revengai/models/tokenised_data.py +++ b/revengai/models/tokenised_data.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.ai_decomp_function_mapping import AIDecompFunctionMapping +from revengai.models.resolved_entity import ResolvedEntity from typing import Optional, Set from typing_extensions import Self @@ -26,12 +26,13 @@ class TokenisedData(BaseModel): """ TokenisedData """ # noqa: E501 - function_mapping: Optional[AIDecompFunctionMapping] = Field(default=None, description="Complete mapping data for token resolution") + entities: Optional[List[ResolvedEntity]] = Field(default=None, description="One entry per token in the tokenised source, with the name it resolves to and its hover metadata.") + line_attribution: Optional[Any] = None predicted_function_name: Optional[StrictStr] = Field(default=None, description="Predicted function name from the AI model") status: StrictStr = Field(description="Task status") tokenised_decompilation: Optional[StrictStr] = Field(default=None, description="Source code with placeholder tokens") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["function_mapping", "predicted_function_name", "status", "tokenised_decompilation"] + __properties: ClassVar[List[str]] = ["entities", "line_attribution", "predicted_function_name", "status", "tokenised_decompilation"] @field_validator('status') def status_validate_enum(cls, value): @@ -81,14 +82,28 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of function_mapping - if self.function_mapping: - _dict['function_mapping'] = self.function_mapping.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in entities (list) + _items = [] + if self.entities: + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) + _dict['entities'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if entities (nullable) is None + # and model_fields_set contains the field + if self.entities is None and "entities" in self.model_fields_set: + _dict['entities'] = None + + # set to None if line_attribution (nullable) is None + # and model_fields_set contains the field + if self.line_attribution is None and "line_attribution" in self.model_fields_set: + _dict['line_attribution'] = None + return _dict @classmethod @@ -101,7 +116,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "function_mapping": AIDecompFunctionMapping.from_dict(obj["function_mapping"]) if obj.get("function_mapping") is not None else None, + "entities": [ResolvedEntity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, + "line_attribution": obj.get("line_attribution"), "predicted_function_name": obj.get("predicted_function_name"), "status": obj.get("status"), "tokenised_decompilation": obj.get("tokenised_decompilation") diff --git a/revengai/models/trigger_rename_unnamed_functions_input_body.py b/revengai/models/trigger_rename_unnamed_functions_input_body.py new file mode 100644 index 00000000..3defd335 --- /dev/null +++ b/revengai/models/trigger_rename_unnamed_functions_input_body.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class TriggerRenameUnnamedFunctionsInputBody(BaseModel): + """ + TriggerRenameUnnamedFunctionsInputBody + """ # noqa: E501 + limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Stop after this many functions. Omit to process every unnamed function in the analysis.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["limit"] + + 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 TriggerRenameUnnamedFunctionsInputBody 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 TriggerRenameUnnamedFunctionsInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "limit": obj.get("limit") + }) + # 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/type_definition.py b/revengai/models/type_definition.py deleted file mode 100644 index 7a53e510..00000000 --- a/revengai/models/type_definition.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class TypeDefinition(BaseModel): - """ - TypeDefinition - """ # noqa: E501 - last_change: Optional[StrictStr] = None - name: StrictStr = Field(description="Name of the type definition") - type: StrictStr = Field(description="Underlying type of the type definition") - artifact_type: Optional[StrictStr] = Field(default=None, description="Type of artifact the type definition is associated with") - __properties: ClassVar[List[str]] = ["last_change", "name", "type", "artifact_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 TypeDefinition 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, - ) - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TypeDefinition from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "type": obj.get("type"), - "artifact_type": obj.get("artifact_type") - }) - return _obj - - diff --git a/revengai/models/typedef_data_type.py b/revengai/models/typedef_data_type.py new file mode 100644 index 00000000..36fd4fa0 --- /dev/null +++ b/revengai/models/typedef_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.typedef_definition import TypedefDefinition +from typing import Optional, Set +from typing_extensions import Self + +class TypedefDataType(BaseModel): + """ + TypedefDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[TypedefDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['TYPEDEF', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('TYPEDEF', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 TypedefDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TypedefDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": TypedefDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/typedef_definition.py b/revengai/models/typedef_definition.py new file mode 100644 index 00000000..8b7dfc1a --- /dev/null +++ b/revengai/models/typedef_definition.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TypedefDefinition(BaseModel): + """ + TypedefDefinition + """ # noqa: E501 + target_data_type_id: Optional[StrictInt] = Field(default=None, description="The type being aliased.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["target_data_type_id"] + + 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 TypedefDefinition 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 TypedefDefinition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "target_data_type_id": obj.get("target_data_type_id") + }) + # 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/union_data_type.py b/revengai/models/union_data_type.py new file mode 100644 index 00000000..7f940527 --- /dev/null +++ b/revengai/models/union_data_type.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.union_definition import UnionDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UnionDataType(BaseModel): + """ + UnionDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + definition: Optional[UnionDefinition] = Field(default=None, description="Absent only for a type referenced but never defined.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "definition", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNION', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNION', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 UnionDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnionDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "definition": UnionDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/union_definition.py b/revengai/models/union_definition.py new file mode 100644 index 00000000..9415f085 --- /dev/null +++ b/revengai/models/union_definition.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_type_member_entry import DataTypeMemberEntry +from typing import Optional, Set +from typing_extensions import Self + +class UnionDefinition(BaseModel): + """ + UnionDefinition + """ # noqa: E501 + members: Optional[List[DataTypeMemberEntry]] = Field(description="The type's fields. Every member starts at offset 0.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["members"] + + 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 UnionDefinition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in members (list) + _items = [] + if self.members: + for _item_members in self.members: + if _item_members: + _items.append(_item_members.to_dict()) + _dict['members'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if members (nullable) is None + # and model_fields_set contains the field + if self.members is None and "members" in self.model_fields_set: + _dict['members'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnionDefinition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "members": [DataTypeMemberEntry.from_dict(_item) for _item in obj["members"]] if obj.get("members") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/unknown_data_type.py b/revengai/models/unknown_data_type.py new file mode 100644 index 00000000..9ddf1ad9 --- /dev/null +++ b/revengai/models/unknown_data_type.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UnknownDataType(BaseModel): + """ + UnknownDataType + """ # noqa: E501 + created_at: datetime = Field(description="When this type was extracted.") + data_type_id: StrictInt = Field(description="Identifies the type within its analysis. 0 is a valid id.") + has_definition: StrictBool = Field(description="Whether this type carries a definition. False for the kinds that never have one and for a type referenced but never defined.") + kind: StrictStr + name: StrictStr = Field(description="Type name.") + namespace: StrictStr = Field(description="The scope qualifying the type name. Empty for a program-defined type.") + size: Optional[StrictInt] = Field(default=None, description="Size in bytes, absent when it could not be determined.") + source_function_id: Optional[StrictInt] = Field(default=None, description="The function this type was copied from, when transferred rather than extracted.") + source_type: StrictStr = Field(description="Where this type came from.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created_at", "data_type_id", "has_definition", "kind", "name", "namespace", "size", "source_function_id", "source_type"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNKNOWN', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNKNOWN', 'unknown_default_open_api')") + return value + + @field_validator('source_type') + def source_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('SYSTEM', 'USER', 'AUTO_UNSTRIP', 'AI_DECOMP', '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 UnknownDataType 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 UnknownDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data_type_id": obj.get("data_type_id"), + "has_definition": obj.get("has_definition"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size"), + "source_function_id": obj.get("source_function_id"), + "source_type": obj.get("source_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/update_analysis_data_types_input_body.py b/revengai/models/update_analysis_data_types_input_body.py new file mode 100644 index 00000000..6082891b --- /dev/null +++ b/revengai/models/update_analysis_data_types_input_body.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.update_data_type_entry import UpdateDataTypeEntry +from typing import Optional, Set +from typing_extensions import Self + +class UpdateAnalysisDataTypesInputBody(BaseModel): + """ + UpdateAnalysisDataTypesInputBody + """ # noqa: E501 + data_types: Optional[Annotated[List[UpdateDataTypeEntry], Field(min_length=1, max_length=100)]] = Field(description="The replacements. Every data_type_id must belong to the analysis, and none may repeat.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types"] + + 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 UpdateAnalysisDataTypesInputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAnalysisDataTypesInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_types": [UpdateDataTypeEntry.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/update_array_data_type.py b/revengai/models/update_array_data_type.py new file mode 100644 index 00000000..f1ea47ff --- /dev/null +++ b/revengai/models/update_array_data_type.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.array_definition import ArrayDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UpdateArrayDataType(BaseModel): + """ + UpdateArrayDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: ArrayDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ARRAY', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ARRAY', '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 UpdateArrayDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateArrayDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "definition": ArrayDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/function_dependency.py b/revengai/models/update_base_data_type.py similarity index 65% rename from revengai/models/function_dependency.py rename to revengai/models/update_base_data_type.py index 6fd4d67c..57cac6cd 100644 --- a/revengai/models/function_dependency.py +++ b/revengai/models/update_base_data_type.py @@ -16,25 +16,30 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class FunctionDependency(BaseModel): +class UpdateBaseDataType(BaseModel): """ - FunctionDependency + UpdateBaseDataType """ # noqa: E501 - addr: Optional[StrictInt] = Field(default=None, description="Memory address (GlobalVariable).") - artifact_type: Optional[StrictStr] = None - last_change: Optional[StrictStr] = None - members: Optional[Any] = None - name: StrictStr - scope: Optional[StrictStr] = None - size: Optional[StrictInt] = Field(default=None, description="Total byte size (Struct, GlobalVariable).") - type: Optional[StrictStr] = Field(default=None, description="Underlying type (TypeDefinition, GlobalVariable).") + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["addr", "artifact_type", "last_change", "members", "name", "scope", "size", "type"] + __properties: ClassVar[List[str]] = ["data_type_id", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BASE', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('BASE', 'unknown_default_open_api')") + return value model_config = ConfigDict( populate_by_name=True, @@ -54,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionDependency from a JSON string""" + """Create an instance of UpdateBaseDataType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,16 +87,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value - # set to None if members (nullable) is None - # and model_fields_set contains the field - if self.members is None and "members" in self.model_fields_set: - _dict['members'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionDependency from a dict""" + """Create an instance of UpdateBaseDataType from a dict""" if obj is None: return None @@ -99,14 +99,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": obj.get("addr"), - "artifact_type": obj.get("artifact_type"), - "last_change": obj.get("last_change"), - "members": obj.get("members"), + "data_type_id": obj.get("data_type_id"), + "kind": obj.get("kind"), "name": obj.get("name"), - "scope": obj.get("scope"), - "size": obj.get("size"), - "type": obj.get("type") + "namespace": obj.get("namespace"), + "size": obj.get("size") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/update_bitfield_data_type.py b/revengai/models/update_bitfield_data_type.py new file mode 100644 index 00000000..3de374d6 --- /dev/null +++ b/revengai/models/update_bitfield_data_type.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UpdateBitfieldDataType(BaseModel): + """ + UpdateBitfieldDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['BITFIELD', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('BITFIELD', '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 UpdateBitfieldDataType 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 UpdateBitfieldDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/update_data_type_entry.py b/revengai/models/update_data_type_entry.py new file mode 100644 index 00000000..bb6af910 --- /dev/null +++ b/revengai/models/update_data_type_entry.py @@ -0,0 +1,251 @@ +# 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.update_array_data_type import UpdateArrayDataType +from revengai.models.update_base_data_type import UpdateBaseDataType +from revengai.models.update_bitfield_data_type import UpdateBitfieldDataType +from revengai.models.update_enum_data_type import UpdateEnumDataType +from revengai.models.update_function_data_type import UpdateFunctionDataType +from revengai.models.update_pointer_data_type import UpdatePointerDataType +from revengai.models.update_struct_data_type import UpdateStructDataType +from revengai.models.update_typedef_data_type import UpdateTypedefDataType +from revengai.models.update_union_data_type import UpdateUnionDataType +from revengai.models.update_unknown_data_type import UpdateUnknownDataType +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +UPDATEDATATYPEENTRY_ONE_OF_SCHEMAS = ["UpdateArrayDataType", "UpdateBaseDataType", "UpdateBitfieldDataType", "UpdateEnumDataType", "UpdateFunctionDataType", "UpdatePointerDataType", "UpdateStructDataType", "UpdateTypedefDataType", "UpdateUnionDataType", "UpdateUnknownDataType"] + +class UpdateDataTypeEntry(BaseModel): + """ + A replacement for the data type named by `data_type_id`. `kind` selects the variant and so which definition the type must carry; changing it is allowed. + """ + # data type: UpdateStructDataType + oneof_schema_1_validator: Optional[UpdateStructDataType] = None + # data type: UpdateUnionDataType + oneof_schema_2_validator: Optional[UpdateUnionDataType] = None + # data type: UpdateEnumDataType + oneof_schema_3_validator: Optional[UpdateEnumDataType] = None + # data type: UpdateTypedefDataType + oneof_schema_4_validator: Optional[UpdateTypedefDataType] = None + # data type: UpdatePointerDataType + oneof_schema_5_validator: Optional[UpdatePointerDataType] = None + # data type: UpdateArrayDataType + oneof_schema_6_validator: Optional[UpdateArrayDataType] = None + # data type: UpdateFunctionDataType + oneof_schema_7_validator: Optional[UpdateFunctionDataType] = None + # data type: UpdateBitfieldDataType + oneof_schema_8_validator: Optional[UpdateBitfieldDataType] = None + # data type: UpdateBaseDataType + oneof_schema_9_validator: Optional[UpdateBaseDataType] = None + # data type: UpdateUnknownDataType + oneof_schema_10_validator: Optional[UpdateUnknownDataType] = None + actual_instance: Optional[Union[UpdateArrayDataType, UpdateBaseDataType, UpdateBitfieldDataType, UpdateEnumDataType, UpdateFunctionDataType, UpdatePointerDataType, UpdateStructDataType, UpdateTypedefDataType, UpdateUnionDataType, UpdateUnknownDataType]] = None + one_of_schemas: Set[str] = { "UpdateArrayDataType", "UpdateBaseDataType", "UpdateBitfieldDataType", "UpdateEnumDataType", "UpdateFunctionDataType", "UpdatePointerDataType", "UpdateStructDataType", "UpdateTypedefDataType", "UpdateUnionDataType", "UpdateUnknownDataType" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + 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 = UpdateDataTypeEntry.model_construct() + error_messages = [] + match = 0 + # validate data type: UpdateStructDataType + if not isinstance(v, UpdateStructDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateStructDataType`") + else: + match += 1 + # validate data type: UpdateUnionDataType + if not isinstance(v, UpdateUnionDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUnionDataType`") + else: + match += 1 + # validate data type: UpdateEnumDataType + if not isinstance(v, UpdateEnumDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateEnumDataType`") + else: + match += 1 + # validate data type: UpdateTypedefDataType + if not isinstance(v, UpdateTypedefDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateTypedefDataType`") + else: + match += 1 + # validate data type: UpdatePointerDataType + if not isinstance(v, UpdatePointerDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdatePointerDataType`") + else: + match += 1 + # validate data type: UpdateArrayDataType + if not isinstance(v, UpdateArrayDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateArrayDataType`") + else: + match += 1 + # validate data type: UpdateFunctionDataType + if not isinstance(v, UpdateFunctionDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateFunctionDataType`") + else: + match += 1 + # validate data type: UpdateBitfieldDataType + if not isinstance(v, UpdateBitfieldDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateBitfieldDataType`") + else: + match += 1 + # validate data type: UpdateBaseDataType + if not isinstance(v, UpdateBaseDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateBaseDataType`") + else: + match += 1 + # validate data type: UpdateUnknownDataType + if not isinstance(v, UpdateUnknownDataType): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUnknownDataType`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in UpdateDataTypeEntry with oneOf schemas: UpdateArrayDataType, UpdateBaseDataType, UpdateBitfieldDataType, UpdateEnumDataType, UpdateFunctionDataType, UpdatePointerDataType, UpdateStructDataType, UpdateTypedefDataType, UpdateUnionDataType, UpdateUnknownDataType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in UpdateDataTypeEntry with oneOf schemas: UpdateArrayDataType, UpdateBaseDataType, UpdateBitfieldDataType, UpdateEnumDataType, UpdateFunctionDataType, UpdatePointerDataType, UpdateStructDataType, UpdateTypedefDataType, UpdateUnionDataType, UpdateUnknownDataType. 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 UpdateStructDataType + try: + instance.actual_instance = UpdateStructDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateUnionDataType + try: + instance.actual_instance = UpdateUnionDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateEnumDataType + try: + instance.actual_instance = UpdateEnumDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateTypedefDataType + try: + instance.actual_instance = UpdateTypedefDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdatePointerDataType + try: + instance.actual_instance = UpdatePointerDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateArrayDataType + try: + instance.actual_instance = UpdateArrayDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateFunctionDataType + try: + instance.actual_instance = UpdateFunctionDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateBitfieldDataType + try: + instance.actual_instance = UpdateBitfieldDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateBaseDataType + try: + instance.actual_instance = UpdateBaseDataType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into UpdateUnknownDataType + try: + instance.actual_instance = UpdateUnknownDataType.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 UpdateDataTypeEntry with oneOf schemas: UpdateArrayDataType, UpdateBaseDataType, UpdateBitfieldDataType, UpdateEnumDataType, UpdateFunctionDataType, UpdatePointerDataType, UpdateStructDataType, UpdateTypedefDataType, UpdateUnionDataType, UpdateUnknownDataType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into UpdateDataTypeEntry with oneOf schemas: UpdateArrayDataType, UpdateBaseDataType, UpdateBitfieldDataType, UpdateEnumDataType, UpdateFunctionDataType, UpdatePointerDataType, UpdateStructDataType, UpdateTypedefDataType, UpdateUnionDataType, UpdateUnknownDataType. 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], UpdateArrayDataType, UpdateBaseDataType, UpdateBitfieldDataType, UpdateEnumDataType, UpdateFunctionDataType, UpdatePointerDataType, UpdateStructDataType, UpdateTypedefDataType, UpdateUnionDataType, UpdateUnknownDataType]]: + """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/update_enum_data_type.py b/revengai/models/update_enum_data_type.py new file mode 100644 index 00000000..e47a5d11 --- /dev/null +++ b/revengai/models/update_enum_data_type.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.enum_definition import EnumDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UpdateEnumDataType(BaseModel): + """ + UpdateEnumDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: EnumDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ENUM', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ENUM', '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 UpdateEnumDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateEnumDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "definition": EnumDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/function_type.py b/revengai/models/update_function_data_type.py similarity index 60% rename from revengai/models/function_type.py rename to revengai/models/update_function_data_type.py index 3365b5a6..55c128e8 100644 --- a/revengai/models/function_type.py +++ b/revengai/models/update_function_data_type.py @@ -16,28 +16,32 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_header import FunctionHeader -from revengai.models.function_stack_variable import FunctionStackVariable +from typing_extensions import Annotated +from revengai.models.function_type_definition import FunctionTypeDefinition from typing import Optional, Set from typing_extensions import Self -class FunctionType(BaseModel): +class UpdateFunctionDataType(BaseModel): """ - FunctionType + UpdateFunctionDataType """ # noqa: E501 - addr: StrictInt - artifact_type: Optional[StrictStr] = None - header: FunctionHeader - last_change: Optional[StrictStr] = None - name: StrictStr - scope: Optional[StrictStr] = None - size: StrictInt - stack_vars: Optional[Dict[str, FunctionStackVariable]] = Field(default=None, description="Stack variables keyed by offset hex.") - type: StrictStr + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: FunctionTypeDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["addr", "artifact_type", "header", "last_change", "name", "scope", "size", "stack_vars", "type"] + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['FUNCTION_DEFINITION', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('FUNCTION_DEFINITION', 'unknown_default_open_api')") + return value model_config = ConfigDict( populate_by_name=True, @@ -57,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionType from a JSON string""" + """Create an instance of UpdateFunctionDataType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,16 +84,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of header - if self.header: - _dict['header'] = self.header.to_dict() - # override the default output from pydantic by calling `to_dict()` of each value in stack_vars (dict) - _field_dict = {} - if self.stack_vars: - for _key_stack_vars in self.stack_vars: - if self.stack_vars[_key_stack_vars]: - _field_dict[_key_stack_vars] = self.stack_vars[_key_stack_vars].to_dict() - _dict['stack_vars'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -99,7 +96,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionType from a dict""" + """Create an instance of UpdateFunctionDataType from a dict""" if obj is None: return None @@ -107,20 +104,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "addr": obj.get("addr"), - "artifact_type": obj.get("artifact_type"), - "header": FunctionHeader.from_dict(obj["header"]) if obj.get("header") is not None else None, - "last_change": obj.get("last_change"), + "data_type_id": obj.get("data_type_id"), + "definition": FunctionTypeDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), "name": obj.get("name"), - "scope": obj.get("scope"), - "size": obj.get("size"), - "stack_vars": dict( - (_k, FunctionStackVariable.from_dict(_v)) - for _k, _v in obj["stack_vars"].items() - ) - if obj.get("stack_vars") is not None - else None, - "type": obj.get("type") + "namespace": obj.get("namespace"), + "size": obj.get("size") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/update_function_signature_input_body.py b/revengai/models/update_function_signature_input_body.py new file mode 100644 index 00000000..56005a5c --- /dev/null +++ b/revengai/models/update_function_signature_input_body.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.signature_parameter_input import SignatureParameterInput +from typing import Optional, Set +from typing_extensions import Self + +class UpdateFunctionSignatureInputBody(BaseModel): + """ + UpdateFunctionSignatureInputBody + """ # noqa: E501 + calling_convention: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="Calling convention. Omit when there is none to record.") + parameters: Optional[Annotated[List[SignatureParameterInput], Field(max_length=256)]] = Field(description="Parameters in argument order. An empty list records a function that takes no arguments.") + return_data_type_id: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Return type, which must belong to this analysis. Omit for an unresolved return type.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["calling_convention", "parameters", "return_data_type_id"] + + 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 UpdateFunctionSignatureInputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateFunctionSignatureInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "calling_convention": obj.get("calling_convention"), + "parameters": [SignatureParameterInput.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, + "return_data_type_id": obj.get("return_data_type_id") + }) + # 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/update_pointer_data_type.py b/revengai/models/update_pointer_data_type.py new file mode 100644 index 00000000..7ecf3f37 --- /dev/null +++ b/revengai/models/update_pointer_data_type.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.pointer_definition import PointerDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UpdatePointerDataType(BaseModel): + """ + UpdatePointerDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: PointerDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['POINTER', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('POINTER', '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 UpdatePointerDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdatePointerDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "definition": PointerDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/update_struct_data_type.py b/revengai/models/update_struct_data_type.py new file mode 100644 index 00000000..bd750582 --- /dev/null +++ b/revengai/models/update_struct_data_type.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.struct_definition import StructDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UpdateStructDataType(BaseModel): + """ + UpdateStructDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: StructDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['STRUCT', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('STRUCT', '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 UpdateStructDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateStructDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "definition": StructDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/update_typedef_data_type.py b/revengai/models/update_typedef_data_type.py new file mode 100644 index 00000000..970c047f --- /dev/null +++ b/revengai/models/update_typedef_data_type.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.typedef_definition import TypedefDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UpdateTypedefDataType(BaseModel): + """ + UpdateTypedefDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: TypedefDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['TYPEDEF', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('TYPEDEF', '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 UpdateTypedefDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateTypedefDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "definition": TypedefDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/update_union_data_type.py b/revengai/models/update_union_data_type.py new file mode 100644 index 00000000..fcfb1f12 --- /dev/null +++ b/revengai/models/update_union_data_type.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.union_definition import UnionDefinition +from typing import Optional, Set +from typing_extensions import Self + +class UpdateUnionDataType(BaseModel): + """ + UpdateUnionDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + definition: UnionDefinition + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "definition", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNION', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNION', '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 UpdateUnionDataType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of definition + if self.definition: + _dict['definition'] = self.definition.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateUnionDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "definition": UnionDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None, + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # 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/update_unknown_data_type.py b/revengai/models/update_unknown_data_type.py new file mode 100644 index 00000000..189b5d9d --- /dev/null +++ b/revengai/models/update_unknown_data_type.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UpdateUnknownDataType(BaseModel): + """ + UpdateUnknownDataType + """ # noqa: E501 + data_type_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The type to replace, as returned by the data types list for this analysis.") + kind: StrictStr + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Type name. Unique within the analysis for a given namespace and kind.") + namespace: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The scope qualifying the type name. Omit for a type of the binary's own.") + size: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Size in bytes. Omit when it is not known.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_type_id", "kind", "name", "namespace", "size"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNKNOWN', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('UNKNOWN', '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 UpdateUnknownDataType 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 UpdateUnknownDataType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_type_id": obj.get("data_type_id"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "namespace": obj.get("namespace"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/upsert_overrides_data.py b/revengai/models/upsert_overrides_data.py index 55be0818..d9cce59d 100644 --- a/revengai/models/upsert_overrides_data.py +++ b/revengai/models/upsert_overrides_data.py @@ -16,8 +16,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List +from revengai.models.token import Token from typing import Optional, Set from typing_extensions import Self @@ -25,9 +26,9 @@ class UpsertOverridesData(BaseModel): """ UpsertOverridesData """ # noqa: E501 - user_override_mappings: Dict[str, StrictStr] = Field(description="Merged override mappings after applying changes") + placeholder_to_user_override: Dict[str, Token] = Field(description="Every override on the function after applying this request, keyed by placeholder token.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["user_override_mappings"] + __properties: ClassVar[List[str]] = ["placeholder_to_user_override"] model_config = ConfigDict( populate_by_name=True, @@ -70,6 +71,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in placeholder_to_user_override (dict) + _field_dict = {} + if self.placeholder_to_user_override: + for _key_placeholder_to_user_override in self.placeholder_to_user_override: + if self.placeholder_to_user_override[_key_placeholder_to_user_override]: + _field_dict[_key_placeholder_to_user_override] = self.placeholder_to_user_override[_key_placeholder_to_user_override].to_dict() + _dict['placeholder_to_user_override'] = _field_dict # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -87,7 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "user_override_mappings": obj.get("user_override_mappings") + "placeholder_to_user_override": dict( + (_k, Token.from_dict(_v)) + for _k, _v in obj["placeholder_to_user_override"].items() + ) + if obj.get("placeholder_to_user_override") is not None + else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/upsert_overrides_input_body.py b/revengai/models/upsert_overrides_input_body.py index 42aa9a2d..9d30988e 100644 --- a/revengai/models/upsert_overrides_input_body.py +++ b/revengai/models/upsert_overrides_input_body.py @@ -16,8 +16,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List +from revengai.models.token import Token from typing import Optional, Set from typing_extensions import Self @@ -25,7 +26,7 @@ class UpsertOverridesInputBody(BaseModel): """ UpsertOverridesInputBody """ # noqa: E501 - overrides: Dict[str, StrictStr] = Field(description="Token to name mappings. Empty string removes the override.") + overrides: Dict[str, Token] = Field(description="Overrides keyed by placeholder token. An entry whose value is an empty string removes that override.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["overrides"] @@ -70,6 +71,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each value in overrides (dict) + _field_dict = {} + if self.overrides: + for _key_overrides in self.overrides: + if self.overrides[_key_overrides]: + _field_dict[_key_overrides] = self.overrides[_key_overrides].to_dict() + _dict['overrides'] = _field_dict # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -87,7 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "overrides": obj.get("overrides") + "overrides": dict( + (_k, Token.from_dict(_v)) + for _k, _v in obj["overrides"].items() + ) + if obj.get("overrides") is not None + else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/v2_function_header.py b/revengai/models/v2_function_header.py deleted file mode 100644 index 1a950bbd..00000000 --- a/revengai/models/v2_function_header.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.argument import Argument -from typing import Optional, Set -from typing_extensions import Self - -class V2FunctionHeader(BaseModel): - """ - V2FunctionHeader - """ # noqa: E501 - last_change: Optional[StrictStr] = None - name: StrictStr = Field(description="Name of the function") - addr: StrictInt = Field(description="Memory address of the function") - type: StrictStr = Field(description="Return type of the function") - args: Dict[str, Argument] = Field(description="Dictionary of function arguments") - __properties: ClassVar[List[str]] = ["last_change", "name", "addr", "type", "args"] - - 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 V2FunctionHeader from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each value in args (dict) - _field_dict = {} - if self.args: - for _key_args in self.args: - if self.args[_key_args]: - _field_dict[_key_args] = self.args[_key_args].to_dict() - _dict['args'] = _field_dict - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of V2FunctionHeader from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "name": obj.get("name"), - "addr": obj.get("addr"), - "type": obj.get("type"), - "args": dict( - (_k, Argument.from_dict(_v)) - for _k, _v in obj["args"].items() - ) - if obj.get("args") is not None - else None - }) - return _obj - - diff --git a/revengai/models/v2_function_info.py b/revengai/models/v2_function_info.py deleted file mode 100644 index 0dd6e9e0..00000000 --- a/revengai/models/v2_function_info.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.v2_function_info_func_deps_inner import V2FunctionInfoFuncDepsInner -from revengai.models.v2_function_type import V2FunctionType -from typing import Optional, Set -from typing_extensions import Self - -class V2FunctionInfo(BaseModel): - """ - V2FunctionInfo - """ # noqa: E501 - func_types: Optional[V2FunctionType] = None - func_deps: List[V2FunctionInfoFuncDepsInner] = Field(description="List of function dependencies") - __properties: ClassVar[List[str]] = ["func_types", "func_deps"] - - 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 V2FunctionInfo 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 func_types - if self.func_types: - _dict['func_types'] = self.func_types.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in func_deps (list) - _items = [] - if self.func_deps: - for _item_func_deps in self.func_deps: - if _item_func_deps: - _items.append(_item_func_deps.to_dict()) - _dict['func_deps'] = _items - # set to None if func_types (nullable) is None - # and model_fields_set contains the field - if self.func_types is None and "func_types" in self.model_fields_set: - _dict['func_types'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of V2FunctionInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "func_types": V2FunctionType.from_dict(obj["func_types"]) if obj.get("func_types") is not None else None, - "func_deps": [V2FunctionInfoFuncDepsInner.from_dict(_item) for _item in obj["func_deps"]] if obj.get("func_deps") is not None else None - }) - return _obj - - diff --git a/revengai/models/v2_function_info_func_deps_inner.py b/revengai/models/v2_function_info_func_deps_inner.py deleted file mode 100644 index 40cfa584..00000000 --- a/revengai/models/v2_function_info_func_deps_inner.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 -from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional -from revengai.models.enumeration import Enumeration -from revengai.models.global_variable import GlobalVariable -from revengai.models.structure import Structure -from revengai.models.type_definition import TypeDefinition -from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal, Self -from pydantic import Field - -V2FUNCTIONINFOFUNCDEPSINNER_ANY_OF_SCHEMAS = ["Enumeration", "GlobalVariable", "Structure", "TypeDefinition"] - -class V2FunctionInfoFuncDepsInner(BaseModel): - """ - V2FunctionInfoFuncDepsInner - """ - - # data type: Structure - anyof_schema_1_validator: Optional[Structure] = None - # data type: Enumeration - anyof_schema_2_validator: Optional[Enumeration] = None - # data type: TypeDefinition - anyof_schema_3_validator: Optional[TypeDefinition] = None - # data type: GlobalVariable - anyof_schema_4_validator: Optional[GlobalVariable] = None - if TYPE_CHECKING: - actual_instance: Optional[Union[Enumeration, GlobalVariable, Structure, TypeDefinition]] = None - else: - actual_instance: Any = None - any_of_schemas: Set[str] = { "Enumeration", "GlobalVariable", "Structure", "TypeDefinition" } - - model_config = { - "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_anyof(cls, v): - instance = V2FunctionInfoFuncDepsInner.model_construct() - error_messages = [] - # validate data type: Structure - if not isinstance(v, Structure): - error_messages.append(f"Error! Input type `{type(v)}` is not `Structure`") - else: - return v - - # validate data type: Enumeration - if not isinstance(v, Enumeration): - error_messages.append(f"Error! Input type `{type(v)}` is not `Enumeration`") - else: - return v - - # validate data type: TypeDefinition - if not isinstance(v, TypeDefinition): - error_messages.append(f"Error! Input type `{type(v)}` is not `TypeDefinition`") - else: - return v - - # validate data type: GlobalVariable - if not isinstance(v, GlobalVariable): - error_messages.append(f"Error! Input type `{type(v)}` is not `GlobalVariable`") - else: - return v - - if error_messages: - # no match - raise ValueError("No match found when setting the actual_instance in V2FunctionInfoFuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: 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 = [] - # anyof_schema_1_validator: Optional[Structure] = None - try: - instance.actual_instance = Structure.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[Enumeration] = None - try: - instance.actual_instance = Enumeration.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[TypeDefinition] = None - try: - instance.actual_instance = TypeDefinition.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_4_validator: Optional[GlobalVariable] = None - try: - instance.actual_instance = GlobalVariable.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if error_messages: - # no match - raise ValueError("No match found when deserializing the JSON string into V2FunctionInfoFuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. 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], Enumeration, GlobalVariable, Structure, TypeDefinition]]: - """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: - 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/v2_function_type.py b/revengai/models/v2_function_type.py deleted file mode 100644 index 92a59529..00000000 --- a/revengai/models/v2_function_type.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.stack_variable import StackVariable -from revengai.models.v2_function_header import V2FunctionHeader -from typing import Optional, Set -from typing_extensions import Self - -class V2FunctionType(BaseModel): - """ - V2FunctionType - """ # noqa: E501 - last_change: Optional[StrictStr] = None - addr: StrictInt = Field(description="Memory address of the function") - size: StrictInt = Field(description="Size of the function in bytes") - header: V2FunctionHeader = Field(description="Function header information") - stack_vars: Optional[Dict[str, StackVariable]] = None - name: StrictStr = Field(description="Name of the function") - type: StrictStr = Field(description="Return type of the function") - artifact_type: Optional[StrictStr] = Field(default='Function', description="Type of artifact that the structure is associated with") - __properties: ClassVar[List[str]] = ["last_change", "addr", "size", "header", "stack_vars", "name", "type", "artifact_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 V2FunctionType 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 header - if self.header: - _dict['header'] = self.header.to_dict() - # override the default output from pydantic by calling `to_dict()` of each value in stack_vars (dict) - _field_dict = {} - if self.stack_vars: - for _key_stack_vars in self.stack_vars: - if self.stack_vars[_key_stack_vars]: - _field_dict[_key_stack_vars] = self.stack_vars[_key_stack_vars].to_dict() - _dict['stack_vars'] = _field_dict - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - # set to None if stack_vars (nullable) is None - # and model_fields_set contains the field - if self.stack_vars is None and "stack_vars" in self.model_fields_set: - _dict['stack_vars'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of V2FunctionType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "addr": obj.get("addr"), - "size": obj.get("size"), - "header": V2FunctionHeader.from_dict(obj["header"]) if obj.get("header") is not None else None, - "stack_vars": dict( - (_k, StackVariable.from_dict(_v)) - for _k, _v in obj["stack_vars"].items() - ) - if obj.get("stack_vars") is not None - else None, - "name": obj.get("name"), - "type": obj.get("type"), - "artifact_type": obj.get("artifact_type") if obj.get("artifact_type") is not None else 'Function' - }) - return _obj - -