From 6e108c89200527b8dba6311c335063daa70a47bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 24 Jun 2026 07:22:55 +0000 Subject: [PATCH] Update SDK to version v3.96.2 - Generated from OpenAPI spec version v3.96.2 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 39 + docs/AnalysesCoreApi.md | 269 ++ docs/AnalysisFunctionEntry.md | 37 + docs/BatchBinaryMatchResult.md | 32 + docs/BatchMatchingOutputBody.md | 30 + docs/CallEdge.md | 36 + docs/CallEdgesOutputBody.md | 29 + docs/CapabilitiesOutputBody.md | 29 + docs/CapabilityEntry.md | 34 + docs/DataTypesEntry.md | 30 + docs/DisassemblyOutputBody.md | 34 + docs/FunctionArgument.md | 34 + docs/FunctionCallEdges.md | 31 + docs/FunctionDependency.md | 36 + docs/FunctionDetailsOutputBody.md | 37 + docs/FunctionStackVariable.md | 35 + docs/FunctionsCoreApi.md | 899 ++++- docs/FunctionsDataTypesApi.md | 272 ++ docs/GetMatchesOutputBody.md | 30 + docs/GetMatchesStatusOutputBody.md | 33 + ...istAnalysisFunctionsDataTypesOutputBody.md | 30 + docs/ListAnalysisFunctionsOutputBody.md | 30 + docs/ListFunctionsDataTypesOutputBody.md | 29 + docs/MatchFilters.md | 33 + docs/StartBatchMatchingInputBody.md | 32 + docs/StartMatchingForAnalysisInputBody.md | 31 + docs/StartMatchingForFunctionsInputBody.md | 32 + docs/StartMatchingOutputBody.md | 33 + revengai/__init__.py | 50 +- revengai/api/analyses_core_api.py | 1938 +++++++--- revengai/api/analyses_results_metadata_api.py | 9 +- revengai/api/functions_core_api.py | 3131 +++++++++++++++-- revengai/api/functions_data_types_api.py | 904 ++++- revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 24 + revengai/models/add_callee_input_body.py | 2 +- revengai/models/analysis_function_entry.py | 120 + revengai/models/batch_binary_match_result.py | 112 + revengai/models/batch_matching_output_body.py | 121 + revengai/models/batch_rename_item.py | 4 +- revengai/models/call_edge.py | 113 + revengai/models/call_edges_output_body.py | 112 + revengai/models/capabilities_output_body.py | 112 + revengai/models/capability_entry.py | 109 + revengai/models/data_types_entry.py | 105 + revengai/models/disassembly_output_body.py | 129 + revengai/models/error_body.py | 4 +- revengai/models/function_argument.py | 129 + revengai/models/function_call_edges.py | 128 + revengai/models/function_dependency.py | 133 + .../models/function_details_output_body.py | 116 + revengai/models/function_stack_variable.py | 131 + revengai/models/get_matches_output_body.py | 121 + .../models/get_matches_status_output_body.py | 127 + ...alysis_functions_data_types_output_body.py | 114 + .../list_analysis_functions_output_body.py | 114 + .../list_functions_data_types_output_body.py | 112 + revengai/models/match_filters.py | 132 + revengai/models/rename_input_body.py | 4 +- .../models/start_batch_matching_input_body.py | 116 + .../start_matching_for_analysis_input_body.py | 108 + ...start_matching_for_functions_input_body.py | 115 + revengai/models/start_matching_output_body.py | 127 + 65 files changed, 10295 insertions(+), 895 deletions(-) create mode 100644 docs/AnalysisFunctionEntry.md create mode 100644 docs/BatchBinaryMatchResult.md create mode 100644 docs/BatchMatchingOutputBody.md create mode 100644 docs/CallEdge.md create mode 100644 docs/CallEdgesOutputBody.md create mode 100644 docs/CapabilitiesOutputBody.md create mode 100644 docs/CapabilityEntry.md create mode 100644 docs/DataTypesEntry.md create mode 100644 docs/DisassemblyOutputBody.md create mode 100644 docs/FunctionArgument.md create mode 100644 docs/FunctionCallEdges.md create mode 100644 docs/FunctionDependency.md create mode 100644 docs/FunctionDetailsOutputBody.md create mode 100644 docs/FunctionStackVariable.md create mode 100644 docs/GetMatchesOutputBody.md create mode 100644 docs/GetMatchesStatusOutputBody.md create mode 100644 docs/ListAnalysisFunctionsDataTypesOutputBody.md create mode 100644 docs/ListAnalysisFunctionsOutputBody.md create mode 100644 docs/ListFunctionsDataTypesOutputBody.md create mode 100644 docs/MatchFilters.md create mode 100644 docs/StartBatchMatchingInputBody.md create mode 100644 docs/StartMatchingForAnalysisInputBody.md create mode 100644 docs/StartMatchingForFunctionsInputBody.md create mode 100644 docs/StartMatchingOutputBody.md create mode 100644 revengai/models/analysis_function_entry.py create mode 100644 revengai/models/batch_binary_match_result.py create mode 100644 revengai/models/batch_matching_output_body.py create mode 100644 revengai/models/call_edge.py create mode 100644 revengai/models/call_edges_output_body.py create mode 100644 revengai/models/capabilities_output_body.py create mode 100644 revengai/models/capability_entry.py create mode 100644 revengai/models/data_types_entry.py create mode 100644 revengai/models/disassembly_output_body.py create mode 100644 revengai/models/function_argument.py create mode 100644 revengai/models/function_call_edges.py create mode 100644 revengai/models/function_dependency.py create mode 100644 revengai/models/function_details_output_body.py create mode 100644 revengai/models/function_stack_variable.py create mode 100644 revengai/models/get_matches_output_body.py create mode 100644 revengai/models/get_matches_status_output_body.py create mode 100644 revengai/models/list_analysis_functions_data_types_output_body.py create mode 100644 revengai/models/list_analysis_functions_output_body.py create mode 100644 revengai/models/list_functions_data_types_output_body.py create mode 100644 revengai/models/match_filters.py create mode 100644 revengai/models/start_batch_matching_input_body.py create mode 100644 revengai/models/start_matching_for_analysis_input_body.py create mode 100644 revengai/models/start_matching_for_functions_input_body.py create mode 100644 revengai/models/start_matching_output_body.py diff --git a/.sdk-version b/.sdk-version index e5bccb1..723fa07 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.95.1 +v3.96.2 diff --git a/README.md b/README.md index 22034e3..d6b3195 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**get_analysis_basic_info_0**](docs/AnalysesCoreApi.md#get_analysis_basic_info_0) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information *AnalysesCoreApi* | [**get_analysis_bytes**](docs/AnalysesCoreApi.md#get_analysis_bytes) | **GET** /v3/analyses/{analysis_id}/bytes | Get the bytes of a binary *AnalysesCoreApi* | [**get_analysis_function_map**](docs/AnalysesCoreApi.md#get_analysis_function_map) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map +*AnalysesCoreApi* | [**get_analysis_function_matches**](docs/AnalysesCoreApi.md#get_analysis_function_matches) | **GET** /v3/analyses/{analysis_id}/functions/matches | Get function-matching results for an analysis +*AnalysesCoreApi* | [**get_analysis_function_matching_status**](docs/AnalysesCoreApi.md#get_analysis_function_matching_status) | **GET** /v3/analyses/{analysis_id}/functions/matches/status | Get function-matching status for an analysis *AnalysesCoreApi* | [**get_analysis_logs**](docs/AnalysesCoreApi.md#get_analysis_logs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis *AnalysesCoreApi* | [**get_analysis_params**](docs/AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information *AnalysesCoreApi* | [**get_analysis_status**](docs/AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis @@ -73,6 +75,7 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**lookup_binary_id**](docs/AnalysesCoreApi.md#lookup_binary_id) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID *AnalysesCoreApi* | [**put_analysis_strings**](docs/AnalysesCoreApi.md#put_analysis_strings) | **PUT** /v2/analyses/{analysis_id}/strings | Add strings to the analysis *AnalysesCoreApi* | [**requeue_analysis**](docs/AnalysesCoreApi.md#requeue_analysis) | **POST** /v2/analyses/{analysis_id}/requeue | Requeue Analysis +*AnalysesCoreApi* | [**start_analysis_function_matching**](docs/AnalysesCoreApi.md#start_analysis_function_matching) | **POST** /v3/analyses/{analysis_id}/functions/matches | Start function matching for an analysis *AnalysesCoreApi* | [**update_analysis**](docs/AnalysesCoreApi.md#update_analysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis *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 @@ -152,18 +155,30 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**get_analysis_strings**](docs/FunctionsCoreApi.md#get_analysis_strings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis *FunctionsCoreApi* | [**get_analysis_strings_status**](docs/FunctionsCoreApi.md#get_analysis_strings_status) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis *FunctionsCoreApi* | [**get_function_blocks**](docs/FunctionsCoreApi.md#get_function_blocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function +*FunctionsCoreApi* | [**get_function_blocks_0**](docs/FunctionsCoreApi.md#get_function_blocks_0) | **GET** /v3/functions/{function_id}/blocks | Get function disassembly *FunctionsCoreApi* | [**get_function_callees_callers**](docs/FunctionsCoreApi.md#get_function_callees_callers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function +*FunctionsCoreApi* | [**get_function_callees_callers_0**](docs/FunctionsCoreApi.md#get_function_callees_callers_0) | **GET** /v3/functions/{function_id}/callees-callers | Get callees and callers for a function *FunctionsCoreApi* | [**get_function_callees_callers_bulk**](docs/FunctionsCoreApi.md#get_function_callees_callers_bulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions *FunctionsCoreApi* | [**get_function_capabilities**](docs/FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities +*FunctionsCoreApi* | [**get_function_capabilities_0**](docs/FunctionsCoreApi.md#get_function_capabilities_0) | **GET** /v3/functions/{function_id}/capabilities | Get capabilities for a function *FunctionsCoreApi* | [**get_function_details**](docs/FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details +*FunctionsCoreApi* | [**get_function_details_0**](docs/FunctionsCoreApi.md#get_function_details_0) | **GET** /v3/functions/{function_id} | Get function details *FunctionsCoreApi* | [**get_function_strings**](docs/FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function *FunctionsCoreApi* | [**get_function_strings_0**](docs/FunctionsCoreApi.md#get_function_strings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. +*FunctionsCoreApi* | [**get_functions_callees_callers**](docs/FunctionsCoreApi.md#get_functions_callees_callers) | **GET** /v3/functions/callees-callers | Get callees and callers for many functions +*FunctionsCoreApi* | [**get_functions_matches**](docs/FunctionsCoreApi.md#get_functions_matches) | **GET** /v3/functions/matches | Get function-matching results for an explicit set of functions +*FunctionsCoreApi* | [**get_functions_matching_status**](docs/FunctionsCoreApi.md#get_functions_matching_status) | **GET** /v3/functions/matches/status | Get function-matching status for an explicit set of functions +*FunctionsCoreApi* | [**list_analysis_functions**](docs/FunctionsCoreApi.md#list_analysis_functions) | **GET** /v3/analyses/{analysis_id}/functions | List 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 *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** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types +*FunctionsDataTypesApi* | [**get_function_data_types_0**](docs/FunctionsDataTypesApi.md#get_function_data_types_0) | **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 *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 @@ -203,6 +218,7 @@ Class | Method | HTTP request | Description - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) + - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) - [AnalysisFunctionMatchingRequest](docs/AnalysisFunctionMatchingRequest.md) - [AnalysisFunctions](docs/AnalysisFunctions.md) @@ -301,6 +317,8 @@ Class | Method | HTTP request | Description - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - [BaseResponseXrefResponse](docs/BaseResponseXrefResponse.md) - [Basic](docs/Basic.md) + - [BatchBinaryMatchResult](docs/BatchBinaryMatchResult.md) + - [BatchMatchingOutputBody](docs/BatchMatchingOutputBody.md) - [BatchRenameInputBody](docs/BatchRenameInputBody.md) - [BatchRenameItem](docs/BatchRenameItem.md) - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) @@ -320,11 +338,15 @@ Class | Method | HTTP request | Description - [BinarySearchResult](docs/BinarySearchResult.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) + - [CallEdge](docs/CallEdge.md) + - [CallEdgesOutputBody](docs/CallEdgesOutputBody.md) - [CalleeFunctionInfo](docs/CalleeFunctionInfo.md) - [CalleesCallerFunctionsResponse](docs/CalleesCallerFunctionsResponse.md) - [CallerFunctionInfo](docs/CallerFunctionInfo.md) - [Capabilities](docs/Capabilities.md) - [CapabilitiesAgentResponse](docs/CapabilitiesAgentResponse.md) + - [CapabilitiesOutputBody](docs/CapabilitiesOutputBody.md) + - [CapabilityEntry](docs/CapabilityEntry.md) - [ChildBinariesResponse](docs/ChildBinariesResponse.md) - [CodeSignatureModel](docs/CodeSignatureModel.md) - [CollectionBinariesUpdateRequest](docs/CollectionBinariesUpdateRequest.md) @@ -360,11 +382,13 @@ Class | Method | HTTP request | Description - [CreateConversationRequest](docs/CreateConversationRequest.md) - [CreatePortalSessionInputBody](docs/CreatePortalSessionInputBody.md) - [Created](docs/Created.md) + - [DataTypesEntry](docs/DataTypesEntry.md) - [DecompFailedEvent](docs/DecompFailedEvent.md) - [DecompFinishedEvent](docs/DecompFinishedEvent.md) - [DecompilationCommentContext](docs/DecompilationCommentContext.md) - [DecompilationData](docs/DecompilationData.md) - [DieMatch](docs/DieMatch.md) + - [DisassemblyOutputBody](docs/DisassemblyOutputBody.md) - [DnsQuery](docs/DnsQuery.md) - [DrakvufFileMetadata](docs/DrakvufFileMetadata.md) - [DynamicExecutionStatus](docs/DynamicExecutionStatus.md) @@ -415,16 +439,20 @@ Class | Method | HTTP request | Description - [FileHashes](docs/FileHashes.md) - [FileMetadata](docs/FileMetadata.md) - [Filters](docs/Filters.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) + - [FunctionDetailsOutputBody](docs/FunctionDetailsOutputBody.md) - [FunctionHeader](docs/FunctionHeader.md) - [FunctionInfo](docs/FunctionInfo.md) - [FunctionInfoFuncDepsInner](docs/FunctionInfoFuncDepsInner.md) @@ -442,6 +470,7 @@ Class | Method | HTTP request | Description - [FunctionSearchResponse](docs/FunctionSearchResponse.md) - [FunctionSearchResult](docs/FunctionSearchResult.md) - [FunctionSourceType](docs/FunctionSourceType.md) + - [FunctionStackVariable](docs/FunctionStackVariable.md) - [FunctionString](docs/FunctionString.md) - [FunctionStringItem](docs/FunctionStringItem.md) - [FunctionStringsResponse](docs/FunctionStringsResponse.md) @@ -456,6 +485,8 @@ Class | Method | HTTP request | Description - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) - [GetCollectionOutputBody](docs/GetCollectionOutputBody.md) + - [GetMatchesOutputBody](docs/GetMatchesOutputBody.md) + - [GetMatchesStatusOutputBody](docs/GetMatchesStatusOutputBody.md) - [GetProductsOutputBody](docs/GetProductsOutputBody.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - [GetSubscriptionOutputBody](docs/GetSubscriptionOutputBody.md) @@ -468,12 +499,16 @@ Class | Method | HTTP request | Description - [ImportModel](docs/ImportModel.md) - [InlineComment](docs/InlineComment.md) - [InsertAnalysisLogRequest](docs/InsertAnalysisLogRequest.md) + - [ListAnalysisFunctionsDataTypesOutputBody](docs/ListAnalysisFunctionsDataTypesOutputBody.md) + - [ListAnalysisFunctionsOutputBody](docs/ListAnalysisFunctionsOutputBody.md) - [ListAnalysisStringsOutputBody](docs/ListAnalysisStringsOutputBody.md) - [ListCollectionResults](docs/ListCollectionResults.md) - [ListCollectionsOutputBody](docs/ListCollectionsOutputBody.md) - [ListFunctionStringsOutputBody](docs/ListFunctionStringsOutputBody.md) + - [ListFunctionsDataTypesOutputBody](docs/ListFunctionsDataTypesOutputBody.md) - [Logs](docs/Logs.md) - [MITRETechnique](docs/MITRETechnique.md) + - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) - [MatchedFunctionSuggestion](docs/MatchedFunctionSuggestion.md) - [MemdumpEntry](docs/MemdumpEntry.md) @@ -560,6 +595,10 @@ Class | Method | HTTP request | Description - [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) - [StatusInput](docs/StatusInput.md) - [StatusOutput](docs/StatusOutput.md) diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index fba8d43..cde2a15 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -11,6 +11,8 @@ Method | HTTP request | Description [**get_analysis_basic_info_0**](AnalysesCoreApi.md#get_analysis_basic_info_0) | **GET** /v3/analyses/{analysis_id}/basic | Get basic analysis information [**get_analysis_bytes**](AnalysesCoreApi.md#get_analysis_bytes) | **GET** /v3/analyses/{analysis_id}/bytes | Get the bytes of a binary [**get_analysis_function_map**](AnalysesCoreApi.md#get_analysis_function_map) | **GET** /v2/analyses/{analysis_id}/func_maps | Get Analysis Function Map +[**get_analysis_function_matches**](AnalysesCoreApi.md#get_analysis_function_matches) | **GET** /v3/analyses/{analysis_id}/functions/matches | Get function-matching results for an analysis +[**get_analysis_function_matching_status**](AnalysesCoreApi.md#get_analysis_function_matching_status) | **GET** /v3/analyses/{analysis_id}/functions/matches/status | Get function-matching status for an analysis [**get_analysis_logs**](AnalysesCoreApi.md#get_analysis_logs) | **GET** /v2/analyses/{analysis_id}/logs | Gets the logs of an analysis [**get_analysis_params**](AnalysesCoreApi.md#get_analysis_params) | **GET** /v2/analyses/{analysis_id}/params | Gets analysis param information [**get_analysis_status**](AnalysesCoreApi.md#get_analysis_status) | **GET** /v2/analyses/{analysis_id}/status | Gets the status of an analysis @@ -21,6 +23,7 @@ Method | HTTP request | Description [**lookup_binary_id**](AnalysesCoreApi.md#lookup_binary_id) | **GET** /v2/analyses/lookup/{binary_id} | Gets the analysis ID from binary ID [**put_analysis_strings**](AnalysesCoreApi.md#put_analysis_strings) | **PUT** /v2/analyses/{analysis_id}/strings | Add strings to the analysis [**requeue_analysis**](AnalysesCoreApi.md#requeue_analysis) | **POST** /v2/analyses/{analysis_id}/requeue | Requeue Analysis +[**start_analysis_function_matching**](AnalysesCoreApi.md#start_analysis_function_matching) | **POST** /v3/analyses/{analysis_id}/functions/matches | Start function matching for an analysis [**update_analysis**](AnalysesCoreApi.md#update_analysis) | **PATCH** /v2/analyses/{analysis_id} | Update Analysis [**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 @@ -619,6 +622,180 @@ 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_analysis_function_matches** +> GetMatchesOutputBody get_analysis_function_matches(analysis_id) + +Get function-matching results for an analysis + +Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.get_matches_output_body import GetMatchesOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get function-matching results for an analysis + api_response = api_instance.get_analysis_function_matches(analysis_id) + print("The response of AnalysesCoreApi->get_analysis_function_matches:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->get_analysis_function_matches: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**GetMatchesOutputBody**](GetMatchesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_analysis_function_matching_status** +> GetMatchesStatusOutputBody get_analysis_function_matching_status(analysis_id) + +Get function-matching status for an analysis + +Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get function-matching status for an analysis + api_response = api_instance.get_analysis_function_matching_status(analysis_id) + print("The response of AnalysesCoreApi->get_analysis_function_matching_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->get_analysis_function_matching_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**GetMatchesStatusOutputBody**](GetMatchesStatusOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_analysis_logs** > BaseResponseLogs get_analysis_logs(analysis_id) @@ -1469,6 +1646,98 @@ 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) +# **start_analysis_function_matching** +> StartMatchingOutputBody start_analysis_function_matching(analysis_id, start_matching_for_analysis_input_body) + +Start function matching for an analysis + +Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.start_matching_for_analysis_input_body import StartMatchingForAnalysisInputBody +from revengai.models.start_matching_output_body import StartMatchingOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + start_matching_for_analysis_input_body = revengai.StartMatchingForAnalysisInputBody() # StartMatchingForAnalysisInputBody | + + try: + # Start function matching for an analysis + api_response = api_instance.start_analysis_function_matching(analysis_id, start_matching_for_analysis_input_body) + print("The response of AnalysesCoreApi->start_analysis_function_matching:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->start_analysis_function_matching: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **start_matching_for_analysis_input_body** | [**StartMatchingForAnalysisInputBody**](StartMatchingForAnalysisInputBody.md)| | + +### Return type + +[**StartMatchingOutputBody**](StartMatchingOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**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_analysis** > BaseResponseAnalysisDetailResponse update_analysis(analysis_id, analysis_update_request) diff --git a/docs/AnalysisFunctionEntry.md b/docs/AnalysisFunctionEntry.md new file mode 100644 index 0000000..28aef39 --- /dev/null +++ b/docs/AnalysisFunctionEntry.md @@ -0,0 +1,37 @@ +# AnalysisFunctionEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_id** | **int** | | +**debug** | **bool** | | +**function_id** | **int** | | +**function_name** | **str** | | +**function_size** | **int** | | +**function_vaddr** | **int** | | +**mangled_name** | **str** | | [optional] +**source_binary_id** | **int** | | [optional] +**source_type** | **str** | | + +## Example + +```python +from revengai.models.analysis_function_entry import AnalysisFunctionEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisFunctionEntry from a JSON string +analysis_function_entry_instance = AnalysisFunctionEntry.from_json(json) +# print the JSON string representation of the object +print(AnalysisFunctionEntry.to_json()) + +# convert the object into a dict +analysis_function_entry_dict = analysis_function_entry_instance.to_dict() +# create an instance of AnalysisFunctionEntry from a dict +analysis_function_entry_from_dict = AnalysisFunctionEntry.from_dict(analysis_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/BatchBinaryMatchResult.md b/docs/BatchBinaryMatchResult.md new file mode 100644 index 0000000..9a439a6 --- /dev/null +++ b/docs/BatchBinaryMatchResult.md @@ -0,0 +1,32 @@ +# BatchBinaryMatchResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_id** | **int** | Target binary | +**error_message** | **str** | Error description when status=FAILED. | [optional] +**matched_function_count** | **int** | Number of source functions that received at least one candidate match. Only meaningful when status=COMPLETED. | +**status** | **str** | Per-binary workflow status | + +## Example + +```python +from revengai.models.batch_binary_match_result import BatchBinaryMatchResult + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchBinaryMatchResult from a JSON string +batch_binary_match_result_instance = BatchBinaryMatchResult.from_json(json) +# print the JSON string representation of the object +print(BatchBinaryMatchResult.to_json()) + +# convert the object into a dict +batch_binary_match_result_dict = batch_binary_match_result_instance.to_dict() +# create an instance of BatchBinaryMatchResult from a dict +batch_binary_match_result_from_dict = BatchBinaryMatchResult.from_dict(batch_binary_match_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/BatchMatchingOutputBody.md b/docs/BatchMatchingOutputBody.md new file mode 100644 index 0000000..a16ae20 --- /dev/null +++ b/docs/BatchMatchingOutputBody.md @@ -0,0 +1,30 @@ +# BatchMatchingOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**per_binary** | [**List[BatchBinaryMatchResult]**](BatchBinaryMatchResult.md) | Per-binary status (order matches the request). | +**status** | **str** | Aggregate status across the batch: COMPLETED when every binary is completed, FAILED if any failed, RUNNING/PENDING otherwise. | + +## Example + +```python +from revengai.models.batch_matching_output_body import BatchMatchingOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchMatchingOutputBody from a JSON string +batch_matching_output_body_instance = BatchMatchingOutputBody.from_json(json) +# print the JSON string representation of the object +print(BatchMatchingOutputBody.to_json()) + +# convert the object into a dict +batch_matching_output_body_dict = batch_matching_output_body_instance.to_dict() +# create an instance of BatchMatchingOutputBody from a dict +batch_matching_output_body_from_dict = BatchMatchingOutputBody.from_dict(batch_matching_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/CallEdge.md b/docs/CallEdge.md new file mode 100644 index 0000000..4140047 --- /dev/null +++ b/docs/CallEdge.md @@ -0,0 +1,36 @@ +# CallEdge + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**callee_function_id** | **int** | | [optional] +**callee_name** | **str** | | [optional] +**callee_vaddr** | **int** | | +**caller_function_id** | **int** | | +**caller_name** | **str** | | [optional] +**caller_vaddr** | **int** | Entry vaddr of the caller function (joined from function_t). | +**is_external** | **bool** | | +**thunked_vaddr** | **int** | | [optional] + +## Example + +```python +from revengai.models.call_edge import CallEdge + +# TODO update the JSON string below +json = "{}" +# create an instance of CallEdge from a JSON string +call_edge_instance = CallEdge.from_json(json) +# print the JSON string representation of the object +print(CallEdge.to_json()) + +# convert the object into a dict +call_edge_dict = call_edge_instance.to_dict() +# create an instance of CallEdge from a dict +call_edge_from_dict = CallEdge.from_dict(call_edge_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/CallEdgesOutputBody.md b/docs/CallEdgesOutputBody.md new file mode 100644 index 0000000..7438067 --- /dev/null +++ b/docs/CallEdgesOutputBody.md @@ -0,0 +1,29 @@ +# CallEdgesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**edges** | [**List[FunctionCallEdges]**](FunctionCallEdges.md) | | + +## Example + +```python +from revengai.models.call_edges_output_body import CallEdgesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of CallEdgesOutputBody from a JSON string +call_edges_output_body_instance = CallEdgesOutputBody.from_json(json) +# print the JSON string representation of the object +print(CallEdgesOutputBody.to_json()) + +# convert the object into a dict +call_edges_output_body_dict = call_edges_output_body_instance.to_dict() +# create an instance of CallEdgesOutputBody from a dict +call_edges_output_body_from_dict = CallEdgesOutputBody.from_dict(call_edges_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/CapabilitiesOutputBody.md b/docs/CapabilitiesOutputBody.md new file mode 100644 index 0000000..c059951 --- /dev/null +++ b/docs/CapabilitiesOutputBody.md @@ -0,0 +1,29 @@ +# CapabilitiesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | [**List[CapabilityEntry]**](CapabilityEntry.md) | | + +## Example + +```python +from revengai.models.capabilities_output_body import CapabilitiesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of CapabilitiesOutputBody from a JSON string +capabilities_output_body_instance = CapabilitiesOutputBody.from_json(json) +# print the JSON string representation of the object +print(CapabilitiesOutputBody.to_json()) + +# convert the object into a dict +capabilities_output_body_dict = capabilities_output_body_instance.to_dict() +# create an instance of CapabilitiesOutputBody from a dict +capabilities_output_body_from_dict = CapabilitiesOutputBody.from_dict(capabilities_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/CapabilityEntry.md b/docs/CapabilityEntry.md new file mode 100644 index 0000000..3a55d7c --- /dev/null +++ b/docs/CapabilityEntry.md @@ -0,0 +1,34 @@ +# CapabilityEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capability** | **str** | | +**description** | **str** | | +**function_id** | **int** | | +**function_name** | **str** | | +**type** | **str** | | +**vaddr** | **int** | | + +## Example + +```python +from revengai.models.capability_entry import CapabilityEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of CapabilityEntry from a JSON string +capability_entry_instance = CapabilityEntry.from_json(json) +# print the JSON string representation of the object +print(CapabilityEntry.to_json()) + +# convert the object into a dict +capability_entry_dict = capability_entry_instance.to_dict() +# create an instance of CapabilityEntry from a dict +capability_entry_from_dict = CapabilityEntry.from_dict(capability_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/DataTypesEntry.md b/docs/DataTypesEntry.md new file mode 100644 index 0000000..a87ea67 --- /dev/null +++ b/docs/DataTypesEntry.md @@ -0,0 +1,30 @@ +# DataTypesEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | [**FunctionInfo**](FunctionInfo.md) | | [optional] +**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 new file mode 100644 index 0000000..93640b3 --- /dev/null +++ b/docs/DisassemblyOutputBody.md @@ -0,0 +1,34 @@ +# DisassemblyOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basic_blocks** | **object** | | [optional] +**function_id** | **int** | | +**local_variables** | **object** | | [optional] +**params** | **object** | | [optional] +**return_type** | **str** | | [optional] +**returns** | **bool** | | + +## Example + +```python +from revengai.models.disassembly_output_body import DisassemblyOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of DisassemblyOutputBody from a JSON string +disassembly_output_body_instance = DisassemblyOutputBody.from_json(json) +# print the JSON string representation of the object +print(DisassemblyOutputBody.to_json()) + +# convert the object into a dict +disassembly_output_body_dict = disassembly_output_body_instance.to_dict() +# create an instance of DisassemblyOutputBody from a dict +disassembly_output_body_from_dict = DisassemblyOutputBody.from_dict(disassembly_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/FunctionArgument.md b/docs/FunctionArgument.md new file mode 100644 index 0000000..2e4c35f --- /dev/null +++ b/docs/FunctionArgument.md @@ -0,0 +1,34 @@ +# 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/FunctionCallEdges.md b/docs/FunctionCallEdges.md new file mode 100644 index 0000000..6f6799a --- /dev/null +++ b/docs/FunctionCallEdges.md @@ -0,0 +1,31 @@ +# FunctionCallEdges + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**callees** | [**List[CallEdge]**](CallEdge.md) | | +**callers** | [**List[CallEdge]**](CallEdge.md) | | +**function_id** | **int** | | + +## Example + +```python +from revengai.models.function_call_edges import FunctionCallEdges + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionCallEdges from a JSON string +function_call_edges_instance = FunctionCallEdges.from_json(json) +# print the JSON string representation of the object +print(FunctionCallEdges.to_json()) + +# convert the object into a dict +function_call_edges_dict = function_call_edges_instance.to_dict() +# create an instance of FunctionCallEdges from a dict +function_call_edges_from_dict = FunctionCallEdges.from_dict(function_call_edges_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 new file mode 100644 index 0000000..5c84b67 --- /dev/null +++ b/docs/FunctionDependency.md @@ -0,0 +1,36 @@ +# 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/FunctionDetailsOutputBody.md b/docs/FunctionDetailsOutputBody.md new file mode 100644 index 0000000..1f97d61 --- /dev/null +++ b/docs/FunctionDetailsOutputBody.md @@ -0,0 +1,37 @@ +# FunctionDetailsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_id** | **int** | | +**creation** | **datetime** | | +**debug** | **bool** | | +**function_id** | **int** | | +**function_name** | **str** | | +**function_size** | **int** | | +**function_vaddr** | **int** | | +**mangled_name** | **str** | | [optional] +**source_function_id** | **int** | | [optional] + +## Example + +```python +from revengai.models.function_details_output_body import FunctionDetailsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionDetailsOutputBody from a JSON string +function_details_output_body_instance = FunctionDetailsOutputBody.from_json(json) +# print the JSON string representation of the object +print(FunctionDetailsOutputBody.to_json()) + +# convert the object into a dict +function_details_output_body_dict = function_details_output_body_instance.to_dict() +# create an instance of FunctionDetailsOutputBody from a dict +function_details_output_body_from_dict = FunctionDetailsOutputBody.from_dict(function_details_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/FunctionStackVariable.md b/docs/FunctionStackVariable.md new file mode 100644 index 0000000..84c7319 --- /dev/null +++ b/docs/FunctionStackVariable.md @@ -0,0 +1,35 @@ +# 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/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 53e5f80..81a1e67 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -15,12 +15,21 @@ Method | HTTP request | Description [**get_analysis_strings**](FunctionsCoreApi.md#get_analysis_strings) | **GET** /v2/analyses/{analysis_id}/functions/strings | Get string information found in the Analysis [**get_analysis_strings_status**](FunctionsCoreApi.md#get_analysis_strings_status) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis [**get_function_blocks**](FunctionsCoreApi.md#get_function_blocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function +[**get_function_blocks_0**](FunctionsCoreApi.md#get_function_blocks_0) | **GET** /v3/functions/{function_id}/blocks | Get function disassembly [**get_function_callees_callers**](FunctionsCoreApi.md#get_function_callees_callers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function +[**get_function_callees_callers_0**](FunctionsCoreApi.md#get_function_callees_callers_0) | **GET** /v3/functions/{function_id}/callees-callers | Get callees and callers for a function [**get_function_callees_callers_bulk**](FunctionsCoreApi.md#get_function_callees_callers_bulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions [**get_function_capabilities**](FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities +[**get_function_capabilities_0**](FunctionsCoreApi.md#get_function_capabilities_0) | **GET** /v3/functions/{function_id}/capabilities | Get capabilities for a function [**get_function_details**](FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details +[**get_function_details_0**](FunctionsCoreApi.md#get_function_details_0) | **GET** /v3/functions/{function_id} | Get function details [**get_function_strings**](FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function [**get_function_strings_0**](FunctionsCoreApi.md#get_function_strings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. +[**get_functions_callees_callers**](FunctionsCoreApi.md#get_functions_callees_callers) | **GET** /v3/functions/callees-callers | Get callees and callers for many functions +[**get_functions_matches**](FunctionsCoreApi.md#get_functions_matches) | **GET** /v3/functions/matches | Get function-matching results for an explicit set of functions +[**get_functions_matching_status**](FunctionsCoreApi.md#get_functions_matching_status) | **GET** /v3/functions/matches/status | Get function-matching status for an explicit set of functions +[**list_analysis_functions**](FunctionsCoreApi.md#list_analysis_functions) | **GET** /v3/analyses/{analysis_id}/functions | List functions in an analysis +[**start_functions_matching**](FunctionsCoreApi.md#start_functions_matching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions # **add_function_callee** @@ -946,6 +955,93 @@ 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_function_blocks_0** +> DisassemblyOutputBody get_function_blocks_0(function_id) + +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 + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.disassembly_output_body import DisassemblyOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get function disassembly + api_response = api_instance.get_function_blocks_0(function_id) + print("The response of FunctionsCoreApi->get_function_blocks_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_function_blocks_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**DisassemblyOutputBody**](DisassemblyOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_function_callees_callers** > BaseResponseCalleesCallerFunctionsResponse get_function_callees_callers(function_id) @@ -1024,6 +1120,93 @@ 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_function_callees_callers_0** +> CallEdgesOutputBody get_function_callees_callers_0(function_id) + +Get callees and callers for a function + +Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.call_edges_output_body import CallEdgesOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_id = 56 # int | Function ID + + try: + # Get callees and callers for a function + api_response = api_instance.get_function_callees_callers_0(function_id) + print("The response of FunctionsCoreApi->get_function_callees_callers_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_function_callees_callers_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + +### Return type + +[**CallEdgesOutputBody**](CallEdgesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_function_callees_callers_bulk** > BaseResponseListCalleesCallerFunctionsResponse get_function_callees_callers_bulk(function_ids) @@ -1181,10 +1364,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_function_details** -> BaseResponseFunctionsDetailResponse get_function_details(function_id) +# **get_function_capabilities_0** +> CapabilitiesOutputBody get_function_capabilities_0(function_id) -Get function details +Get capabilities for a function + +Returns the capability findings (CAPA-style behaviour matches) associated with the given function. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example @@ -1192,7 +1381,7 @@ Get function details ```python import revengai -from revengai.models.base_response_functions_detail_response import BaseResponseFunctionsDetailResponse +from revengai.models.capabilities_output_body import CapabilitiesOutputBody from revengai.rest import ApiException from pprint import pprint @@ -1217,15 +1406,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsCoreApi(api_client) - function_id = 56 # int | + function_id = 56 # int | Function ID try: - # Get function details - api_response = api_instance.get_function_details(function_id) - print("The response of FunctionsCoreApi->get_function_details:\n") + # Get capabilities for a function + api_response = api_instance.get_function_capabilities_0(function_id) + print("The response of FunctionsCoreApi->get_function_capabilities_0:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsCoreApi->get_function_details: %s\n" % e) + print("Exception when calling FunctionsCoreApi->get_function_capabilities_0: %s\n" % e) ``` @@ -1235,11 +1424,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **function_id** | **int**| | + **function_id** | **int**| Function ID | ### Return type -[**BaseResponseFunctionsDetailResponse**](BaseResponseFunctionsDetailResponse.md) +[**CapabilitiesOutputBody**](CapabilitiesOutputBody.md) ### Authorization @@ -1254,17 +1443,18 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Invalid request parameters | - | +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_function_strings** -> BaseResponseFunctionStringsResponse get_function_strings(function_id, page=page, page_size=page_size, search=search) - -Get string information found in the function +# **get_function_details** +> BaseResponseFunctionsDetailResponse get_function_details(function_id) -Get string information found in the function +Get function details ### Example @@ -1272,7 +1462,7 @@ Get string information found in the function ```python import revengai -from revengai.models.base_response_function_strings_response import BaseResponseFunctionStringsResponse +from revengai.models.base_response_functions_detail_response import BaseResponseFunctionsDetailResponse from revengai.rest import ApiException from pprint import pprint @@ -1298,17 +1488,14 @@ with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsCoreApi(api_client) function_id = 56 # int | - page = 1 # int | The page number to retrieve. (optional) (default to 1) - page_size = 100 # int | Number of items per page. (optional) (default to 100) - search = 'search_example' # str | Search is applied to string value (optional) try: - # Get string information found in the function - api_response = api_instance.get_function_strings(function_id, page=page, page_size=page_size, search=search) - print("The response of FunctionsCoreApi->get_function_strings:\n") + # Get function details + api_response = api_instance.get_function_details(function_id) + print("The response of FunctionsCoreApi->get_function_details:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsCoreApi->get_function_strings: %s\n" % e) + print("Exception when calling FunctionsCoreApi->get_function_details: %s\n" % e) ``` @@ -1319,13 +1506,10 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| | - **page** | **int**| The page number to retrieve. | [optional] [default to 1] - **page_size** | **int**| Number of items per page. | [optional] [default to 100] - **search** | **str**| Search is applied to string value | [optional] ### Return type -[**BaseResponseFunctionStringsResponse**](BaseResponseFunctionStringsResponse.md) +[**BaseResponseFunctionsDetailResponse**](BaseResponseFunctionsDetailResponse.md) ### Authorization @@ -1345,16 +1529,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_function_strings_0** -> ListFunctionStringsOutputBody get_function_strings_0(function_id, page=page, page_size=page_size, search=search) +# **get_function_details_0** +> FunctionDetailsOutputBody get_function_details_0(function_id) -List strings for a function. +Get function details -Returns the strings discovered in a function. Supports value search and pagination. +Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **Error codes:** -- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found ### Example @@ -1362,7 +1546,7 @@ Returns the strings discovered in a function. Supports value search and paginati ```python import revengai -from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody +from revengai.models.function_details_output_body import FunctionDetailsOutputBody from revengai.rest import ApiException from pprint import pprint @@ -1388,17 +1572,14 @@ with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsCoreApi(api_client) function_id = 56 # int | Function ID - page = 1 # int | Page number (1-indexed). (optional) (default to 1) - page_size = 100 # int | Number of results per page. (optional) (default to 100) - search = 'search_example' # str | Filter by string value (case-insensitive substring match). (optional) try: - # List strings for a function. - api_response = api_instance.get_function_strings_0(function_id, page=page, page_size=page_size, search=search) - print("The response of FunctionsCoreApi->get_function_strings_0:\n") + # Get function details + api_response = api_instance.get_function_details_0(function_id) + print("The response of FunctionsCoreApi->get_function_details_0:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsCoreApi->get_function_strings_0: %s\n" % e) + print("Exception when calling FunctionsCoreApi->get_function_details_0: %s\n" % e) ``` @@ -1409,13 +1590,10 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **function_id** | **int**| Function ID | - **page** | **int**| Page number (1-indexed). | [optional] [default to 1] - **page_size** | **int**| Number of results per page. | [optional] [default to 100] - **search** | **str**| Filter by string value (case-insensitive substring match). | [optional] ### Return type -[**ListFunctionStringsOutputBody**](ListFunctionStringsOutputBody.md) +[**FunctionDetailsOutputBody**](FunctionDetailsOutputBody.md) ### Authorization @@ -1438,3 +1616,630 @@ 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_function_strings** +> BaseResponseFunctionStringsResponse get_function_strings(function_id, page=page, page_size=page_size, search=search) + +Get string information found in the function + +Get string information found in the function + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_function_strings_response import BaseResponseFunctionStringsResponse +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_id = 56 # int | + page = 1 # int | The page number to retrieve. (optional) (default to 1) + page_size = 100 # int | Number of items per page. (optional) (default to 100) + search = 'search_example' # str | Search is applied to string value (optional) + + try: + # Get string information found in the function + api_response = api_instance.get_function_strings(function_id, page=page, page_size=page_size, search=search) + print("The response of FunctionsCoreApi->get_function_strings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_function_strings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| | + **page** | **int**| The page number to retrieve. | [optional] [default to 1] + **page_size** | **int**| Number of items per page. | [optional] [default to 100] + **search** | **str**| Search is applied to string value | [optional] + +### Return type + +[**BaseResponseFunctionStringsResponse**](BaseResponseFunctionStringsResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_function_strings_0** +> ListFunctionStringsOutputBody get_function_strings_0(function_id, page=page, page_size=page_size, search=search) + +List strings for a function. + +Returns the strings discovered in a function. Supports value search and pagination. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_id = 56 # int | Function ID + page = 1 # int | Page number (1-indexed). (optional) (default to 1) + page_size = 100 # int | Number of results per page. (optional) (default to 100) + search = 'search_example' # str | Filter by string value (case-insensitive substring match). (optional) + + try: + # List strings for a function. + api_response = api_instance.get_function_strings_0(function_id, page=page, page_size=page_size, search=search) + print("The response of FunctionsCoreApi->get_function_strings_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_function_strings_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **page** | **int**| Page number (1-indexed). | [optional] [default to 1] + **page_size** | **int**| Number of results per page. | [optional] [default to 100] + **search** | **str**| Filter by string value (case-insensitive substring match). | [optional] + +### Return type + +[**ListFunctionStringsOutputBody**](ListFunctionStringsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_functions_callees_callers** +> CallEdgesOutputBody get_functions_callees_callers(function_ids) + +Get callees and callers for many functions + +Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole 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): + +```python +import revengai +from revengai.models.call_edges_output_body import CallEdgesOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_ids = [56] # List[int] | Function IDs to fetch edges for. + + try: + # Get callees and callers for many functions + api_response = api_instance.get_functions_callees_callers(function_ids) + print("The response of FunctionsCoreApi->get_functions_callees_callers:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_functions_callees_callers: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_ids** | [**List[int]**](int.md)| Function IDs to fetch edges for. | + +### Return type + +[**CallEdgesOutputBody**](CallEdgesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**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) + +# **get_functions_matches** +> GetMatchesOutputBody get_functions_matches(function_ids) + +Get function-matching results for an explicit set of functions + +Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.get_matches_output_body import GetMatchesOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_ids = [56] # List[int] | Source function IDs whose matches to fetch. + + try: + # Get function-matching results for an explicit set of functions + api_response = api_instance.get_functions_matches(function_ids) + print("The response of FunctionsCoreApi->get_functions_matches:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_functions_matches: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_ids** | [**List[int]**](int.md)| Source function IDs whose matches to fetch. | + +### Return type + +[**GetMatchesOutputBody**](GetMatchesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**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) + +# **get_functions_matching_status** +> GetMatchesStatusOutputBody get_functions_matching_status(function_ids) + +Get function-matching status for an explicit set of functions + +Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_ids = [56] # List[int] | Source function IDs whose matches to fetch. + + try: + # Get function-matching status for an explicit set of functions + api_response = api_instance.get_functions_matching_status(function_ids) + print("The response of FunctionsCoreApi->get_functions_matching_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_functions_matching_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_ids** | [**List[int]**](int.md)| Source function IDs whose matches to fetch. | + +### Return type + +[**GetMatchesStatusOutputBody**](GetMatchesStatusOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**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) + +# **list_analysis_functions** +> ListAnalysisFunctionsOutputBody list_analysis_functions(analysis_id, offset=offset, limit=limit) + +List functions in an analysis + +Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(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 functions in an analysis + api_response = api_instance.list_analysis_functions(analysis_id, offset=offset, limit=limit) + print("The response of FunctionsCoreApi->list_analysis_functions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->list_analysis_functions: %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 + +[**ListAnalysisFunctionsOutputBody**](ListAnalysisFunctionsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **start_functions_matching** +> StartMatchingOutputBody start_functions_matching(start_matching_for_functions_input_body) + +Start function matching for an explicit set of functions + +Dispatches the function-matching workflow against the provided function IDs. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody +from revengai.models.start_matching_output_body import StartMatchingOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + start_matching_for_functions_input_body = revengai.StartMatchingForFunctionsInputBody() # StartMatchingForFunctionsInputBody | + + try: + # Start function matching for an explicit set of functions + api_response = api_instance.start_functions_matching(start_matching_for_functions_input_body) + print("The response of FunctionsCoreApi->start_functions_matching:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->start_functions_matching: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start_matching_for_functions_input_body** | [**StartMatchingForFunctionsInputBody**](StartMatchingForFunctionsInputBody.md)| | + +### Return type + +[**StartMatchingOutputBody**](StartMatchingOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**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/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md index 88d93a9..7435618 100644 --- a/docs/FunctionsDataTypesApi.md +++ b/docs/FunctionsDataTypesApi.md @@ -8,8 +8,11 @@ Method | HTTP request | Description [**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** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types +[**get_function_data_types_0**](FunctionsDataTypesApi.md#get_function_data_types_0) | **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 # **batch_update_function_data_types** @@ -350,6 +353,186 @@ 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_function_data_types_0** +> DataTypesEntry get_function_data_types_0(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): + +```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' + +# 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_0(analysis_id, function_id) + print("The response of FunctionsDataTypesApi->get_function_data_types_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsDataTypesApi->get_function_data_types_0: %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) + +### 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): + +```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' + +# 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) + +### 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) @@ -512,3 +695,92 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **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): + +```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' + +# 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) + +### 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) + diff --git a/docs/GetMatchesOutputBody.md b/docs/GetMatchesOutputBody.md new file mode 100644 index 0000000..da5fdf3 --- /dev/null +++ b/docs/GetMatchesOutputBody.md @@ -0,0 +1,30 @@ +# GetMatchesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**matches** | [**List[FunctionMatch]**](FunctionMatch.md) | Per-source-function matches. Populated when status=COMPLETED; empty otherwise. | [optional] +**status** | **str** | Current workflow status | + +## Example + +```python +from revengai.models.get_matches_output_body import GetMatchesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetMatchesOutputBody from a JSON string +get_matches_output_body_instance = GetMatchesOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetMatchesOutputBody.to_json()) + +# convert the object into a dict +get_matches_output_body_dict = get_matches_output_body_instance.to_dict() +# create an instance of GetMatchesOutputBody from a dict +get_matches_output_body_from_dict = GetMatchesOutputBody.from_dict(get_matches_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/GetMatchesStatusOutputBody.md b/docs/GetMatchesStatusOutputBody.md new file mode 100644 index 0000000..15964a4 --- /dev/null +++ b/docs/GetMatchesStatusOutputBody.md @@ -0,0 +1,33 @@ +# GetMatchesStatusOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messages** | [**List[ProgressMessage]**](ProgressMessage.md) | Log messages emitted during execution | +**status** | **str** | Current workflow status | +**step** | **str** | Name of the current step | +**step_index** | **int** | Zero-based index of the current step | +**steps_total** | **int** | Total number of steps in the workflow | + +## Example + +```python +from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetMatchesStatusOutputBody from a JSON string +get_matches_status_output_body_instance = GetMatchesStatusOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetMatchesStatusOutputBody.to_json()) + +# convert the object into a dict +get_matches_status_output_body_dict = get_matches_status_output_body_instance.to_dict() +# create an instance of GetMatchesStatusOutputBody from a dict +get_matches_status_output_body_from_dict = GetMatchesStatusOutputBody.from_dict(get_matches_status_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 new file mode 100644 index 0000000..4dd66e0 --- /dev/null +++ b/docs/ListAnalysisFunctionsDataTypesOutputBody.md @@ -0,0 +1,30 @@ +# 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/ListAnalysisFunctionsOutputBody.md b/docs/ListAnalysisFunctionsOutputBody.md new file mode 100644 index 0000000..668b604 --- /dev/null +++ b/docs/ListAnalysisFunctionsOutputBody.md @@ -0,0 +1,30 @@ +# ListAnalysisFunctionsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[AnalysisFunctionEntry]**](AnalysisFunctionEntry.md) | | +**total_count** | **int** | Total functions in the analysis, ignoring pagination. | + +## Example + +```python +from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ListAnalysisFunctionsOutputBody from a JSON string +list_analysis_functions_output_body_instance = ListAnalysisFunctionsOutputBody.from_json(json) +# print the JSON string representation of the object +print(ListAnalysisFunctionsOutputBody.to_json()) + +# convert the object into a dict +list_analysis_functions_output_body_dict = list_analysis_functions_output_body_instance.to_dict() +# create an instance of ListAnalysisFunctionsOutputBody from a dict +list_analysis_functions_output_body_from_dict = ListAnalysisFunctionsOutputBody.from_dict(list_analysis_functions_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 new file mode 100644 index 0000000..8d8a7c6 --- /dev/null +++ b/docs/ListFunctionsDataTypesOutputBody.md @@ -0,0 +1,29 @@ +# 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 new file mode 100644 index 0000000..ba0e959 --- /dev/null +++ b/docs/MatchFilters.md @@ -0,0 +1,33 @@ +# MatchFilters + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_ids** | **List[int]** | Restrict the candidate pool to these binary IDs. | [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] +**function_ids** | **List[int]** | Restrict the candidate pool to these function IDs. | [optional] +**user_ids** | **List[int]** | Restrict the candidate pool to functions owned by these user IDs. | [optional] + +## Example + +```python +from revengai.models.match_filters import MatchFilters + +# TODO update the JSON string below +json = "{}" +# create an instance of MatchFilters from a JSON string +match_filters_instance = MatchFilters.from_json(json) +# print the JSON string representation of the object +print(MatchFilters.to_json()) + +# convert the object into a dict +match_filters_dict = match_filters_instance.to_dict() +# create an instance of MatchFilters from a dict +match_filters_from_dict = MatchFilters.from_dict(match_filters_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/StartBatchMatchingInputBody.md b/docs/StartBatchMatchingInputBody.md new file mode 100644 index 0000000..59b5303 --- /dev/null +++ b/docs/StartBatchMatchingInputBody.md @@ -0,0 +1,32 @@ +# StartBatchMatchingInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_ids** | **List[int]** | Binary IDs to match the analysis against, one workflow per binary. | +**debug_types** | **List[Optional[str]]** | Restrict matches to candidates with these debug source types. Defaults to [\"SYSTEM\"]. | [optional] +**min_similarity** | **float** | Similarity floor as a percentage. Defaults to 90. | [optional] +**results_per_function** | **int** | Max matches returned per source function. Defaults to 1. | [optional] + +## Example + +```python +from revengai.models.start_batch_matching_input_body import StartBatchMatchingInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of StartBatchMatchingInputBody from a JSON string +start_batch_matching_input_body_instance = StartBatchMatchingInputBody.from_json(json) +# print the JSON string representation of the object +print(StartBatchMatchingInputBody.to_json()) + +# convert the object into a dict +start_batch_matching_input_body_dict = start_batch_matching_input_body_instance.to_dict() +# create an instance of StartBatchMatchingInputBody from a dict +start_batch_matching_input_body_from_dict = StartBatchMatchingInputBody.from_dict(start_batch_matching_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/StartMatchingForAnalysisInputBody.md b/docs/StartMatchingForAnalysisInputBody.md new file mode 100644 index 0000000..0b29d3c --- /dev/null +++ b/docs/StartMatchingForAnalysisInputBody.md @@ -0,0 +1,31 @@ +# StartMatchingForAnalysisInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**MatchFilters**](MatchFilters.md) | Narrow the candidate pool. | [optional] +**min_similarity** | **float** | Similarity floor as a percentage. Defaults to 90. | [optional] +**results_per_function** | **int** | Max matches returned per source function. Defaults to 1. | [optional] + +## Example + +```python +from revengai.models.start_matching_for_analysis_input_body import StartMatchingForAnalysisInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of StartMatchingForAnalysisInputBody from a JSON string +start_matching_for_analysis_input_body_instance = StartMatchingForAnalysisInputBody.from_json(json) +# print the JSON string representation of the object +print(StartMatchingForAnalysisInputBody.to_json()) + +# convert the object into a dict +start_matching_for_analysis_input_body_dict = start_matching_for_analysis_input_body_instance.to_dict() +# create an instance of StartMatchingForAnalysisInputBody from a dict +start_matching_for_analysis_input_body_from_dict = StartMatchingForAnalysisInputBody.from_dict(start_matching_for_analysis_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/StartMatchingForFunctionsInputBody.md b/docs/StartMatchingForFunctionsInputBody.md new file mode 100644 index 0000000..b8eaebd --- /dev/null +++ b/docs/StartMatchingForFunctionsInputBody.md @@ -0,0 +1,32 @@ +# StartMatchingForFunctionsInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**MatchFilters**](MatchFilters.md) | Narrow the candidate pool. | [optional] +**function_ids** | **List[int]** | Source function IDs to match against the rest of the corpus. | +**min_similarity** | **float** | Similarity floor as a percentage. Defaults to 90. | [optional] +**results_per_function** | **int** | Max matches returned per source function. Defaults to 1. | [optional] + +## Example + +```python +from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of StartMatchingForFunctionsInputBody from a JSON string +start_matching_for_functions_input_body_instance = StartMatchingForFunctionsInputBody.from_json(json) +# print the JSON string representation of the object +print(StartMatchingForFunctionsInputBody.to_json()) + +# convert the object into a dict +start_matching_for_functions_input_body_dict = start_matching_for_functions_input_body_instance.to_dict() +# create an instance of StartMatchingForFunctionsInputBody from a dict +start_matching_for_functions_input_body_from_dict = StartMatchingForFunctionsInputBody.from_dict(start_matching_for_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/StartMatchingOutputBody.md b/docs/StartMatchingOutputBody.md new file mode 100644 index 0000000..ff6c767 --- /dev/null +++ b/docs/StartMatchingOutputBody.md @@ -0,0 +1,33 @@ +# StartMatchingOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messages** | [**List[ProgressMessage]**](ProgressMessage.md) | Log messages emitted during execution | +**status** | **str** | Current workflow status | +**step** | **str** | Name of the current step | +**step_index** | **int** | Zero-based index of the current step | +**steps_total** | **int** | Total number of steps in the workflow | + +## Example + +```python +from revengai.models.start_matching_output_body import StartMatchingOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of StartMatchingOutputBody from a JSON string +start_matching_output_body_instance = StartMatchingOutputBody.from_json(json) +# print the JSON string representation of the object +print(StartMatchingOutputBody.to_json()) + +# convert the object into a dict +start_matching_output_body_dict = start_matching_output_body_instance.to_dict() +# create an instance of StartMatchingOutputBody from a dict +start_matching_output_body_from_dict = StartMatchingOutputBody.from_dict(start_matching_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index 245411c..4e6d25f 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.95.1" +__version__ = "v3.96.2" # Define package exports __all__ = [ @@ -65,6 +65,7 @@ "AnalysisCreateRequest", "AnalysisCreateResponse", "AnalysisDetailResponse", + "AnalysisFunctionEntry", "AnalysisFunctionMapping", "AnalysisFunctionMatchingRequest", "AnalysisFunctions", @@ -163,6 +164,8 @@ "BaseResponseVulnerabilities", "BaseResponseXrefResponse", "Basic", + "BatchBinaryMatchResult", + "BatchMatchingOutputBody", "BatchRenameInputBody", "BatchRenameItem", "BatchRenameOutputBody", @@ -182,11 +185,15 @@ "BinarySearchResult", "BinaryTaskStatus", "BulkDeleteAnalysesRequest", + "CallEdge", + "CallEdgesOutputBody", "CalleeFunctionInfo", "CalleesCallerFunctionsResponse", "CallerFunctionInfo", "Capabilities", "CapabilitiesAgentResponse", + "CapabilitiesOutputBody", + "CapabilityEntry", "ChildBinariesResponse", "CodeSignatureModel", "CollectionBinariesUpdateRequest", @@ -222,11 +229,13 @@ "CreateConversationRequest", "CreatePortalSessionInputBody", "Created", + "DataTypesEntry", "DecompFailedEvent", "DecompFinishedEvent", "DecompilationCommentContext", "DecompilationData", "DieMatch", + "DisassemblyOutputBody", "DnsQuery", "DrakvufFileMetadata", "DynamicExecutionStatus", @@ -277,16 +286,20 @@ "FileHashes", "FileMetadata", "Filters", + "FunctionArgument", "FunctionBlockDestinationResponse", "FunctionBlockResponse", "FunctionBlocksResponse", "FunctionBoundary", + "FunctionCallEdges", "FunctionCapabilityResponse", "FunctionDataTypes", "FunctionDataTypesList", "FunctionDataTypesListItem", "FunctionDataTypesParams", "FunctionDataTypesStatus", + "FunctionDependency", + "FunctionDetailsOutputBody", "FunctionHeader", "FunctionInfo", "FunctionInfoFuncDepsInner", @@ -304,6 +317,7 @@ "FunctionSearchResponse", "FunctionSearchResult", "FunctionSourceType", + "FunctionStackVariable", "FunctionString", "FunctionStringItem", "FunctionStringsResponse", @@ -318,6 +332,8 @@ "GetAiDecompilationRatingResponse", "GetAnalysisStringsStatusOutputBody", "GetCollectionOutputBody", + "GetMatchesOutputBody", + "GetMatchesStatusOutputBody", "GetProductsOutputBody", "GetPublicUserResponse", "GetSubscriptionOutputBody", @@ -330,12 +346,16 @@ "ImportModel", "InlineComment", "InsertAnalysisLogRequest", + "ListAnalysisFunctionsDataTypesOutputBody", + "ListAnalysisFunctionsOutputBody", "ListAnalysisStringsOutputBody", "ListCollectionResults", "ListCollectionsOutputBody", "ListFunctionStringsOutputBody", + "ListFunctionsDataTypesOutputBody", "Logs", "MITRETechnique", + "MatchFilters", "MatchedFunction", "MatchedFunctionSuggestion", "MemdumpEntry", @@ -422,6 +442,10 @@ "SseEventToolCallStartData", "SseEventToolConfirmationRequiredData", "StackVariable", + "StartBatchMatchingInputBody", + "StartMatchingForAnalysisInputBody", + "StartMatchingForFunctionsInputBody", + "StartMatchingOutputBody", "StartupInfo", "StatusInput", "StatusOutput", @@ -522,6 +546,7 @@ from revengai.models.analysis_create_request import AnalysisCreateRequest as AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse as AnalysisCreateResponse 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_function_matching_request import AnalysisFunctionMatchingRequest as AnalysisFunctionMatchingRequest from revengai.models.analysis_functions import AnalysisFunctions as AnalysisFunctions @@ -620,6 +645,8 @@ from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities as BaseResponseVulnerabilities from revengai.models.base_response_xref_response import BaseResponseXrefResponse as BaseResponseXrefResponse from revengai.models.basic import Basic as Basic +from revengai.models.batch_binary_match_result import BatchBinaryMatchResult as BatchBinaryMatchResult +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 @@ -639,11 +666,15 @@ from revengai.models.binary_search_result import BinarySearchResult as BinarySearchResult from revengai.models.binary_task_status import BinaryTaskStatus as BinaryTaskStatus from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest as BulkDeleteAnalysesRequest +from revengai.models.call_edge import CallEdge as CallEdge +from revengai.models.call_edges_output_body import CallEdgesOutputBody as CallEdgesOutputBody from revengai.models.callee_function_info import CalleeFunctionInfo as CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse as CalleesCallerFunctionsResponse from revengai.models.caller_function_info import CallerFunctionInfo as CallerFunctionInfo from revengai.models.capabilities import Capabilities as Capabilities from revengai.models.capabilities_agent_response import CapabilitiesAgentResponse as CapabilitiesAgentResponse +from revengai.models.capabilities_output_body import CapabilitiesOutputBody as CapabilitiesOutputBody +from revengai.models.capability_entry import CapabilityEntry as CapabilityEntry from revengai.models.child_binaries_response import ChildBinariesResponse as ChildBinariesResponse from revengai.models.code_signature_model import CodeSignatureModel as CodeSignatureModel from revengai.models.collection_binaries_update_request import CollectionBinariesUpdateRequest as CollectionBinariesUpdateRequest @@ -679,11 +710,13 @@ from revengai.models.create_conversation_request import CreateConversationRequest as CreateConversationRequest from revengai.models.create_portal_session_input_body import CreatePortalSessionInputBody as CreatePortalSessionInputBody from revengai.models.created import Created as Created +from revengai.models.data_types_entry import DataTypesEntry as DataTypesEntry from revengai.models.decomp_failed_event import DecompFailedEvent as DecompFailedEvent from revengai.models.decomp_finished_event import DecompFinishedEvent as DecompFinishedEvent from revengai.models.decompilation_comment_context import DecompilationCommentContext as DecompilationCommentContext from revengai.models.decompilation_data import DecompilationData as DecompilationData from revengai.models.die_match import DieMatch as DieMatch +from revengai.models.disassembly_output_body import DisassemblyOutputBody as DisassemblyOutputBody from revengai.models.dns_query import DnsQuery as DnsQuery from revengai.models.drakvuf_file_metadata import DrakvufFileMetadata as DrakvufFileMetadata from revengai.models.dynamic_execution_status import DynamicExecutionStatus as DynamicExecutionStatus @@ -734,16 +767,20 @@ from revengai.models.file_hashes import FileHashes as FileHashes from revengai.models.file_metadata import FileMetadata as FileMetadata from revengai.models.filters import Filters as Filters +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_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_info_func_deps_inner import FunctionInfoFuncDepsInner as FunctionInfoFuncDepsInner @@ -761,6 +798,7 @@ from revengai.models.function_search_response import FunctionSearchResponse as FunctionSearchResponse from revengai.models.function_search_result import FunctionSearchResult as FunctionSearchResult 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 @@ -775,6 +813,8 @@ from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse as GetAiDecompilationRatingResponse 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_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 @@ -787,12 +827,16 @@ from revengai.models.import_model import ImportModel as ImportModel from revengai.models.inline_comment import InlineComment as InlineComment from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest as InsertAnalysisLogRequest +from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody as ListAnalysisFunctionsDataTypesOutputBody +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_collection_results import ListCollectionResults as ListCollectionResults from revengai.models.list_collections_output_body import ListCollectionsOutputBody as ListCollectionsOutputBody 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.logs import Logs as Logs from revengai.models.mitre_technique import MITRETechnique as MITRETechnique +from revengai.models.match_filters import MatchFilters as MatchFilters from revengai.models.matched_function import MatchedFunction as MatchedFunction from revengai.models.matched_function_suggestion import MatchedFunctionSuggestion as MatchedFunctionSuggestion from revengai.models.memdump_entry import MemdumpEntry as MemdumpEntry @@ -879,6 +923,10 @@ 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_input import StatusInput as StatusInput from revengai.models.status_output import StatusOutput as StatusOutput diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index ca94d20..361d7fe 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -41,12 +41,16 @@ from revengai.models.dynamic_execution_status import DynamicExecutionStatus from revengai.models.dynamic_execution_status_response import DynamicExecutionStatusResponse 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 from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.models.model_name import ModelName from revengai.models.order import Order from revengai.models.put_analysis_strings_request import PutAnalysisStringsRequest from revengai.models.re_analysis_form import ReAnalysisForm +from revengai.models.start_matching_for_analysis_input_body import StartMatchingForAnalysisInputBody +from revengai.models.start_matching_output_body import StartMatchingOutputBody from revengai.models.status_input import StatusInput from revengai.models.upload_file_type import UploadFileType from revengai.models.workspace import Workspace @@ -2036,9 +2040,9 @@ def _get_analysis_function_map_serialize( @validate_call - def get_analysis_logs( + def get_analysis_function_matches( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2051,12 +2055,12 @@ def get_analysis_logs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseLogs: - """Gets the logs of an analysis + ) -> GetMatchesOutputBody: + """Get function-matching results for an analysis - Given an analysis ID gets the current logs of an analysis + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :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 @@ -2080,7 +2084,7 @@ def get_analysis_logs( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_logs_serialize( + _param = self._get_analysis_function_matches_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2089,8 +2093,11 @@ def get_analysis_logs( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseLogs", - '422': "BaseResponse", + '200': "GetMatchesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2104,9 +2111,9 @@ def get_analysis_logs( @validate_call - def get_analysis_logs_with_http_info( + def get_analysis_function_matches_with_http_info( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2119,12 +2126,12 @@ def get_analysis_logs_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[BaseResponseLogs]: - """Gets the logs of an analysis + ) -> ApiResponse[GetMatchesOutputBody]: + """Get function-matching results for an analysis - Given an analysis ID gets the current logs of an analysis + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :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 @@ -2148,7 +2155,7 @@ def get_analysis_logs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_logs_serialize( + _param = self._get_analysis_function_matches_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2157,8 +2164,11 @@ def get_analysis_logs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseLogs", - '422': "BaseResponse", + '200': "GetMatchesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2172,9 +2182,9 @@ def get_analysis_logs_with_http_info( @validate_call - def get_analysis_logs_without_preload_content( + def get_analysis_function_matches_without_preload_content( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2188,11 +2198,11 @@ 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 + """Get function-matching results for an analysis - Given an analysis ID gets the current logs of an analysis + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :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 @@ -2216,7 +2226,7 @@ def get_analysis_logs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_logs_serialize( + _param = self._get_analysis_function_matches_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2225,8 +2235,11 @@ def get_analysis_logs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseLogs", - '422': "BaseResponse", + '200': "GetMatchesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2235,7 +2248,7 @@ def get_analysis_logs_without_preload_content( return response_data.response - def _get_analysis_logs_serialize( + def _get_analysis_function_matches_serialize( self, analysis_id, _request_auth, @@ -2283,7 +2296,7 @@ def _get_analysis_logs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/logs', + resource_path='/v3/analyses/{analysis_id}/functions/matches', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2300,9 +2313,9 @@ def _get_analysis_logs_serialize( @validate_call - def get_analysis_params( + def get_analysis_function_matching_status( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2315,12 +2328,12 @@ def get_analysis_params( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseParams: - """Gets analysis param information + ) -> GetMatchesStatusOutputBody: + """Get function-matching status for an analysis - Gets the params that the analysis was run with + Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :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 @@ -2344,7 +2357,7 @@ def get_analysis_params( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_params_serialize( + _param = self._get_analysis_function_matching_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2353,8 +2366,11 @@ def get_analysis_params( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseParams", - '422': "BaseResponse", + '200': "GetMatchesStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2368,9 +2384,9 @@ def get_analysis_params( @validate_call - def get_analysis_params_with_http_info( + def get_analysis_function_matching_status_with_http_info( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2383,12 +2399,12 @@ def get_analysis_params_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[BaseResponseParams]: - """Gets analysis param information + ) -> ApiResponse[GetMatchesStatusOutputBody]: + """Get function-matching status for an analysis - Gets the params that the analysis was run with + Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :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 @@ -2412,7 +2428,7 @@ def get_analysis_params_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_params_serialize( + _param = self._get_analysis_function_matching_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2421,8 +2437,11 @@ def get_analysis_params_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseParams", - '422': "BaseResponse", + '200': "GetMatchesStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2436,9 +2455,9 @@ def get_analysis_params_with_http_info( @validate_call - def get_analysis_params_without_preload_content( + def get_analysis_function_matching_status_without_preload_content( self, - analysis_id: StrictInt, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2452,11 +2471,11 @@ def get_analysis_params_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets analysis param information + """Get function-matching status for an analysis - Gets the params that the analysis was run with + Returns the matching workflow's current status. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param analysis_id: (required) + :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 @@ -2480,7 +2499,7 @@ def get_analysis_params_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_params_serialize( + _param = self._get_analysis_function_matching_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2489,8 +2508,11 @@ def get_analysis_params_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseParams", - '422': "BaseResponse", + '200': "GetMatchesStatusOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -2499,7 +2521,7 @@ def get_analysis_params_without_preload_content( return response_data.response - def _get_analysis_params_serialize( + def _get_analysis_function_matching_status_serialize( self, analysis_id, _request_auth, @@ -2547,7 +2569,7 @@ def _get_analysis_params_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/params', + resource_path='/v3/analyses/{analysis_id}/functions/matches/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2564,7 +2586,7 @@ def _get_analysis_params_serialize( @validate_call - def get_analysis_status( + def get_analysis_logs( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -2579,10 +2601,10 @@ def get_analysis_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseStatus: - """Gets the status of an analysis + ) -> BaseResponseLogs: + """Gets the logs of an analysis - Given an analysis ID gets the current status of the analysis + Given an analysis ID gets the current logs of an analysis :param analysis_id: (required) :type analysis_id: int @@ -2608,7 +2630,7 @@ def get_analysis_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_status_serialize( + _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2617,7 +2639,7 @@ def get_analysis_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseStatus", + '200': "BaseResponseLogs", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2632,7 +2654,7 @@ def get_analysis_status( @validate_call - def get_analysis_status_with_http_info( + def get_analysis_logs_with_http_info( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -2647,10 +2669,10 @@ def get_analysis_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseStatus]: - """Gets the status of an analysis + ) -> ApiResponse[BaseResponseLogs]: + """Gets the logs of an analysis - Given an analysis ID gets the current status of the analysis + Given an analysis ID gets the current logs of an analysis :param analysis_id: (required) :type analysis_id: int @@ -2676,7 +2698,7 @@ def get_analysis_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_status_serialize( + _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2685,7 +2707,7 @@ def get_analysis_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseStatus", + '200': "BaseResponseLogs", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2700,7 +2722,7 @@ def get_analysis_status_with_http_info( @validate_call - def get_analysis_status_without_preload_content( + def get_analysis_logs_without_preload_content( self, analysis_id: StrictInt, _request_timeout: Union[ @@ -2716,9 +2738,9 @@ def get_analysis_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the status of an analysis + """Gets the logs of an analysis - Given an analysis ID gets the current status of the analysis + Given an analysis ID gets the current logs of an analysis :param analysis_id: (required) :type analysis_id: int @@ -2744,7 +2766,7 @@ def get_analysis_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_analysis_status_serialize( + _param = self._get_analysis_logs_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2753,7 +2775,7 @@ def get_analysis_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseStatus", + '200': "BaseResponseLogs", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -2763,7 +2785,7 @@ def get_analysis_status_without_preload_content( return response_data.response - def _get_analysis_status_serialize( + def _get_analysis_logs_serialize( self, analysis_id, _request_auth, @@ -2811,7 +2833,7 @@ def _get_analysis_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/status', + resource_path='/v2/analyses/{analysis_id}/logs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2828,9 +2850,9 @@ def _get_analysis_status_serialize( @validate_call - def get_dynamic_execution_report( + def get_analysis_params( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2843,12 +2865,12 @@ def get_dynamic_execution_report( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AnalysisReport: - """Get dynamic execution report + ) -> BaseResponseParams: + """Gets analysis param information - Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + Gets the params that the analysis was run with - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2872,7 +2894,7 @@ def get_dynamic_execution_report( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dynamic_execution_report_serialize( + _param = self._get_analysis_params_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2881,11 +2903,8 @@ def get_dynamic_execution_report( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AnalysisReport", - '403': "APIError", - '409': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseParams", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2899,9 +2918,9 @@ def get_dynamic_execution_report( @validate_call - def get_dynamic_execution_report_with_http_info( + def get_analysis_params_with_http_info( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2914,12 +2933,12 @@ def get_dynamic_execution_report_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[AnalysisReport]: - """Get dynamic execution report + ) -> ApiResponse[BaseResponseParams]: + """Gets analysis param information - Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + Gets the params that the analysis was run with - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2943,7 +2962,7 @@ def get_dynamic_execution_report_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dynamic_execution_report_serialize( + _param = self._get_analysis_params_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2952,11 +2971,8 @@ def get_dynamic_execution_report_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AnalysisReport", - '403': "APIError", - '409': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseParams", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -2970,9 +2986,9 @@ def get_dynamic_execution_report_with_http_info( @validate_call - def get_dynamic_execution_report_without_preload_content( + def get_analysis_params_without_preload_content( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2986,11 +3002,11 @@ def get_dynamic_execution_report_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get dynamic execution report + """Gets analysis param information - Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete + Gets the params that the analysis was run with - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3014,7 +3030,7 @@ def get_dynamic_execution_report_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dynamic_execution_report_serialize( + _param = self._get_analysis_params_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3023,11 +3039,8 @@ def get_dynamic_execution_report_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AnalysisReport", - '403': "APIError", - '409': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseParams", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3036,7 +3049,7 @@ def get_dynamic_execution_report_without_preload_content( return response_data.response - def _get_dynamic_execution_report_serialize( + def _get_analysis_params_serialize( self, analysis_id, _request_auth, @@ -3084,7 +3097,7 @@ def _get_dynamic_execution_report_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/dynamic-execution/report', + resource_path='/v2/analyses/{analysis_id}/params', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3101,9 +3114,9 @@ def _get_dynamic_execution_report_serialize( @validate_call - def get_dynamic_execution_status( + def get_analysis_status( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3116,12 +3129,12 @@ def get_dynamic_execution_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DynamicExecutionStatusResponse: - """Get dynamic execution status + ) -> BaseResponseStatus: + """Gets the status of an analysis - Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Given an analysis ID gets the current status of the analysis - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3145,7 +3158,7 @@ def get_dynamic_execution_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dynamic_execution_status_serialize( + _param = self._get_analysis_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3154,10 +3167,8 @@ def get_dynamic_execution_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DynamicExecutionStatusResponse", - '403': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseStatus", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3171,9 +3182,9 @@ def get_dynamic_execution_status( @validate_call - def get_dynamic_execution_status_with_http_info( + def get_analysis_status_with_http_info( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3186,12 +3197,12 @@ def get_dynamic_execution_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DynamicExecutionStatusResponse]: - """Get dynamic execution status + ) -> ApiResponse[BaseResponseStatus]: + """Gets the status of an analysis - Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Given an analysis ID gets the current status of the analysis - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3215,7 +3226,7 @@ def get_dynamic_execution_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dynamic_execution_status_serialize( + _param = self._get_analysis_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3224,10 +3235,8 @@ def get_dynamic_execution_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DynamicExecutionStatusResponse", - '403': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseStatus", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3241,9 +3250,9 @@ def get_dynamic_execution_status_with_http_info( @validate_call - def get_dynamic_execution_status_without_preload_content( + def get_analysis_status_without_preload_content( self, - analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + analysis_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3257,11 +3266,11 @@ def get_dynamic_execution_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get dynamic execution status + """Gets the status of an analysis - Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Given an analysis ID gets the current status of the analysis - :param analysis_id: Analysis ID (required) + :param analysis_id: (required) :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3285,7 +3294,7 @@ def get_dynamic_execution_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dynamic_execution_status_serialize( + _param = self._get_analysis_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3294,10 +3303,8 @@ def get_dynamic_execution_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DynamicExecutionStatusResponse", - '403': "APIError", - '422': "APIError", - '500': "APIError", + '200': "BaseResponseStatus", + '422': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -3306,7 +3313,7 @@ def get_dynamic_execution_status_without_preload_content( return response_data.response - def _get_dynamic_execution_status_serialize( + def _get_analysis_status_serialize( self, analysis_id, _request_auth, @@ -3354,7 +3361,7 @@ def _get_dynamic_execution_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/dynamic-execution/status', + resource_path='/v2/analyses/{analysis_id}/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3371,10 +3378,9 @@ def _get_dynamic_execution_status_serialize( @validate_call - def insert_analysis_log( + def get_dynamic_execution_report( self, - analysis_id: StrictInt, - insert_analysis_log_request: InsertAnalysisLogRequest, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3387,15 +3393,13 @@ def insert_analysis_log( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponse: - """Insert a log entry for an analysis + ) -> AnalysisReport: + """Get dynamic execution report - Inserts a log record for an analysis. Only the analysis owner can insert logs. + Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param insert_analysis_log_request: (required) - :type insert_analysis_log_request: InsertAnalysisLogRequest :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 @@ -3418,9 +3422,8 @@ def insert_analysis_log( :return: Returns the result object. """ # noqa: E501 - _param = self._insert_analysis_log_serialize( + _param = self._get_dynamic_execution_report_serialize( analysis_id=analysis_id, - insert_analysis_log_request=insert_analysis_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3428,8 +3431,11 @@ def insert_analysis_log( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", - '422': "BaseResponse", + '200': "AnalysisReport", + '403': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3443,10 +3449,9 @@ def insert_analysis_log( @validate_call - def insert_analysis_log_with_http_info( + def get_dynamic_execution_report_with_http_info( self, - analysis_id: StrictInt, - insert_analysis_log_request: InsertAnalysisLogRequest, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3459,15 +3464,13 @@ def insert_analysis_log_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]: - """Insert a log entry for an analysis + ) -> ApiResponse[AnalysisReport]: + """Get dynamic execution report - Inserts a log record for an analysis. Only the analysis owner can insert logs. + Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param insert_analysis_log_request: (required) - :type insert_analysis_log_request: InsertAnalysisLogRequest :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 @@ -3490,9 +3493,8 @@ def insert_analysis_log_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._insert_analysis_log_serialize( + _param = self._get_dynamic_execution_report_serialize( analysis_id=analysis_id, - insert_analysis_log_request=insert_analysis_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3500,8 +3502,11 @@ def insert_analysis_log_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", - '422': "BaseResponse", + '200': "AnalysisReport", + '403': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3515,10 +3520,9 @@ def insert_analysis_log_with_http_info( @validate_call - def insert_analysis_log_without_preload_content( + def get_dynamic_execution_report_without_preload_content( self, - analysis_id: StrictInt, - insert_analysis_log_request: InsertAnalysisLogRequest, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3532,14 +3536,12 @@ def insert_analysis_log_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Insert a log entry for an analysis + """Get dynamic execution report - Inserts a log record for an analysis. Only the analysis owner can insert logs. + Returns the dynamic execution report JSON for the analysis. Requires the task to be in COMPLETED status. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`DYNAMIC_EXECUTION_INCOMPLETE`](/errors/DYNAMIC_EXECUTION_INCOMPLETE) — Dynamic Execution Incomplete - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param insert_analysis_log_request: (required) - :type insert_analysis_log_request: InsertAnalysisLogRequest :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 @@ -3562,9 +3564,8 @@ def insert_analysis_log_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._insert_analysis_log_serialize( + _param = self._get_dynamic_execution_report_serialize( analysis_id=analysis_id, - insert_analysis_log_request=insert_analysis_log_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3572,8 +3573,11 @@ def insert_analysis_log_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", - '422': "BaseResponse", + '200': "AnalysisReport", + '403': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3582,10 +3586,9 @@ def insert_analysis_log_without_preload_content( return response_data.response - def _insert_analysis_log_serialize( + def _get_dynamic_execution_report_serialize( self, analysis_id, - insert_analysis_log_request, _request_auth, _content_type, _headers, @@ -3613,8 +3616,6 @@ def _insert_analysis_log_serialize( # process the header parameters # process the form parameters # process the body parameter - if insert_analysis_log_request is not None: - _body_params = insert_analysis_log_request # set the HTTP header `Accept` @@ -3625,19 +3626,6 @@ def _insert_analysis_log_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] = [ @@ -3645,8 +3633,8 @@ def _insert_analysis_log_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/analyses/{analysis_id}/logs', + method='GET', + resource_path='/v2/analyses/{analysis_id}/dynamic-execution/report', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3663,19 +3651,9 @@ def _insert_analysis_log_serialize( @validate_call - def list_analyses( + def get_dynamic_execution_status( self, - search_term: Optional[StrictStr] = None, - workspace: Annotated[Optional[List[Workspace]], Field(description="The workspace to be viewed")] = None, - status: Annotated[Optional[List[StatusInput]], Field(description="The status of the analysis")] = None, - model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None, - dynamic_execution_status: Annotated[Optional[DynamicExecutionStatus], Field(description="Show analysis that have a dynamic execution with the given status")] = None, - usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None, - sha256_hash: Optional[StrictStr] = None, - limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None, - offset: Optional[StrictInt] = None, - order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None, - order: Optional[Order] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3688,33 +3666,13 @@ def list_analyses( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseRecent: - """Gets the most recent analyses + ) -> DynamicExecutionStatusResponse: + """Get dynamic execution status - Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param search_term: - :type search_term: str - :param workspace: The workspace to be viewed - :type workspace: List[Workspace] - :param status: The status of the analysis - :type status: List[StatusInput] - :param model_name: Show analysis belonging to the model - :type model_name: List[ModelName] - :param dynamic_execution_status: Show analysis that have a dynamic execution with the given status - :type dynamic_execution_status: DynamicExecutionStatus - :param usernames: Show analysis belonging to the user - :type usernames: List[Optional[str]] - :param sha256_hash: - :type sha256_hash: str - :param limit: - :type limit: int - :param offset: - :type offset: int - :param order_by: - :type order_by: AppApiRestV2AnalysesEnumsOrderBy - :param order: - :type order: Order + :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 @@ -3737,18 +3695,8 @@ def list_analyses( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analyses_serialize( - search_term=search_term, - workspace=workspace, - status=status, - model_name=model_name, - dynamic_execution_status=dynamic_execution_status, - usernames=usernames, - sha256_hash=sha256_hash, - limit=limit, - offset=offset, - order_by=order_by, - order=order, + _param = self._get_dynamic_execution_status_serialize( + analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3756,8 +3704,10 @@ def list_analyses( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseRecent", - '422': "BaseResponse", + '200': "DynamicExecutionStatusResponse", + '403': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3771,19 +3721,9 @@ def list_analyses( @validate_call - def list_analyses_with_http_info( + def get_dynamic_execution_status_with_http_info( self, - search_term: Optional[StrictStr] = None, - workspace: Annotated[Optional[List[Workspace]], Field(description="The workspace to be viewed")] = None, - status: Annotated[Optional[List[StatusInput]], Field(description="The status of the analysis")] = None, - model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None, - dynamic_execution_status: Annotated[Optional[DynamicExecutionStatus], Field(description="Show analysis that have a dynamic execution with the given status")] = None, - usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None, - sha256_hash: Optional[StrictStr] = None, - limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None, - offset: Optional[StrictInt] = None, - order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None, - order: Optional[Order] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3796,33 +3736,13 @@ def list_analyses_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[BaseResponseRecent]: - """Gets the most recent analyses + ) -> ApiResponse[DynamicExecutionStatusResponse]: + """Get dynamic execution status - Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param search_term: - :type search_term: str - :param workspace: The workspace to be viewed - :type workspace: List[Workspace] - :param status: The status of the analysis - :type status: List[StatusInput] - :param model_name: Show analysis belonging to the model - :type model_name: List[ModelName] - :param dynamic_execution_status: Show analysis that have a dynamic execution with the given status - :type dynamic_execution_status: DynamicExecutionStatus - :param usernames: Show analysis belonging to the user - :type usernames: List[Optional[str]] - :param sha256_hash: - :type sha256_hash: str - :param limit: - :type limit: int - :param offset: - :type offset: int - :param order_by: - :type order_by: AppApiRestV2AnalysesEnumsOrderBy - :param order: - :type order: Order + :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 @@ -3845,18 +3765,8 @@ def list_analyses_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analyses_serialize( - search_term=search_term, - workspace=workspace, - status=status, - model_name=model_name, - dynamic_execution_status=dynamic_execution_status, - usernames=usernames, - sha256_hash=sha256_hash, - limit=limit, - offset=offset, - order_by=order_by, - order=order, + _param = self._get_dynamic_execution_status_serialize( + analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3864,8 +3774,10 @@ def list_analyses_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseRecent", - '422': "BaseResponse", + '200': "DynamicExecutionStatusResponse", + '403': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3879,19 +3791,9 @@ def list_analyses_with_http_info( @validate_call - def list_analyses_without_preload_content( + def get_dynamic_execution_status_without_preload_content( self, - search_term: Optional[StrictStr] = None, - workspace: Annotated[Optional[List[Workspace]], Field(description="The workspace to be viewed")] = None, - status: Annotated[Optional[List[StatusInput]], Field(description="The status of the analysis")] = None, - model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None, - dynamic_execution_status: Annotated[Optional[DynamicExecutionStatus], Field(description="Show analysis that have a dynamic execution with the given status")] = None, - usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None, - sha256_hash: Optional[StrictStr] = None, - limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None, - offset: Optional[StrictInt] = None, - order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None, - order: Optional[Order] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3905,24 +3807,672 @@ def list_analyses_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the most recent analyses + """Get dynamic execution status - Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + Returns the status of the most recent dynamic execution task for the analysis. Returns UNINITIALISED if no task has been started. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param search_term: - :type search_term: str - :param workspace: The workspace to be viewed - :type workspace: List[Workspace] - :param status: The status of the analysis - :type status: List[StatusInput] - :param model_name: Show analysis belonging to the model - :type model_name: List[ModelName] - :param dynamic_execution_status: Show analysis that have a dynamic execution with the given status - :type dynamic_execution_status: DynamicExecutionStatus - :param usernames: Show analysis belonging to the user - :type usernames: List[Optional[str]] - :param sha256_hash: - :type sha256_hash: str + :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._get_dynamic_execution_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': "DynamicExecutionStatusResponse", + '403': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dynamic_execution_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' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/analyses/{analysis_id}/dynamic-execution/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 insert_analysis_log( + self, + analysis_id: StrictInt, + insert_analysis_log_request: InsertAnalysisLogRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponse: + """Insert a log entry for an analysis + + Inserts a log record for an analysis. Only the analysis owner can insert logs. + + :param analysis_id: (required) + :type analysis_id: int + :param insert_analysis_log_request: (required) + :type insert_analysis_log_request: InsertAnalysisLogRequest + :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._insert_analysis_log_serialize( + analysis_id=analysis_id, + insert_analysis_log_request=insert_analysis_log_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BaseResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def insert_analysis_log_with_http_info( + self, + analysis_id: StrictInt, + insert_analysis_log_request: InsertAnalysisLogRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponse]: + """Insert a log entry for an analysis + + Inserts a log record for an analysis. Only the analysis owner can insert logs. + + :param analysis_id: (required) + :type analysis_id: int + :param insert_analysis_log_request: (required) + :type insert_analysis_log_request: InsertAnalysisLogRequest + :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._insert_analysis_log_serialize( + analysis_id=analysis_id, + insert_analysis_log_request=insert_analysis_log_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BaseResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def insert_analysis_log_without_preload_content( + self, + analysis_id: StrictInt, + insert_analysis_log_request: InsertAnalysisLogRequest, + _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: + """Insert a log entry for an analysis + + Inserts a log record for an analysis. Only the analysis owner can insert logs. + + :param analysis_id: (required) + :type analysis_id: int + :param insert_analysis_log_request: (required) + :type insert_analysis_log_request: InsertAnalysisLogRequest + :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._insert_analysis_log_serialize( + analysis_id=analysis_id, + insert_analysis_log_request=insert_analysis_log_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BaseResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _insert_analysis_log_serialize( + self, + analysis_id, + insert_analysis_log_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if 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 insert_analysis_log_request is not None: + _body_params = insert_analysis_log_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/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 list_analyses( + self, + search_term: Optional[StrictStr] = None, + workspace: Annotated[Optional[List[Workspace]], Field(description="The workspace to be viewed")] = None, + status: Annotated[Optional[List[StatusInput]], Field(description="The status of the analysis")] = None, + model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None, + dynamic_execution_status: Annotated[Optional[DynamicExecutionStatus], Field(description="Show analysis that have a dynamic execution with the given status")] = None, + usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None, + sha256_hash: Optional[StrictStr] = None, + limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None, + offset: Optional[StrictInt] = None, + order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None, + order: Optional[Order] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseRecent: + """Gets the most recent analyses + + Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + + :param search_term: + :type search_term: str + :param workspace: The workspace to be viewed + :type workspace: List[Workspace] + :param status: The status of the analysis + :type status: List[StatusInput] + :param model_name: Show analysis belonging to the model + :type model_name: List[ModelName] + :param dynamic_execution_status: Show analysis that have a dynamic execution with the given status + :type dynamic_execution_status: DynamicExecutionStatus + :param usernames: Show analysis belonging to the user + :type usernames: List[Optional[str]] + :param sha256_hash: + :type sha256_hash: str + :param limit: + :type limit: int + :param offset: + :type offset: int + :param order_by: + :type order_by: AppApiRestV2AnalysesEnumsOrderBy + :param order: + :type order: Order + :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._list_analyses_serialize( + search_term=search_term, + workspace=workspace, + status=status, + model_name=model_name, + dynamic_execution_status=dynamic_execution_status, + usernames=usernames, + sha256_hash=sha256_hash, + limit=limit, + offset=offset, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseRecent", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_analyses_with_http_info( + self, + search_term: Optional[StrictStr] = None, + workspace: Annotated[Optional[List[Workspace]], Field(description="The workspace to be viewed")] = None, + status: Annotated[Optional[List[StatusInput]], Field(description="The status of the analysis")] = None, + model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None, + dynamic_execution_status: Annotated[Optional[DynamicExecutionStatus], Field(description="Show analysis that have a dynamic execution with the given status")] = None, + usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None, + sha256_hash: Optional[StrictStr] = None, + limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None, + offset: Optional[StrictInt] = None, + order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None, + order: Optional[Order] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseRecent]: + """Gets the most recent analyses + + Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + + :param search_term: + :type search_term: str + :param workspace: The workspace to be viewed + :type workspace: List[Workspace] + :param status: The status of the analysis + :type status: List[StatusInput] + :param model_name: Show analysis belonging to the model + :type model_name: List[ModelName] + :param dynamic_execution_status: Show analysis that have a dynamic execution with the given status + :type dynamic_execution_status: DynamicExecutionStatus + :param usernames: Show analysis belonging to the user + :type usernames: List[Optional[str]] + :param sha256_hash: + :type sha256_hash: str + :param limit: + :type limit: int + :param offset: + :type offset: int + :param order_by: + :type order_by: AppApiRestV2AnalysesEnumsOrderBy + :param order: + :type order: Order + :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._list_analyses_serialize( + search_term=search_term, + workspace=workspace, + status=status, + model_name=model_name, + dynamic_execution_status=dynamic_execution_status, + usernames=usernames, + sha256_hash=sha256_hash, + limit=limit, + offset=offset, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseRecent", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_analyses_without_preload_content( + self, + search_term: Optional[StrictStr] = None, + workspace: Annotated[Optional[List[Workspace]], Field(description="The workspace to be viewed")] = None, + status: Annotated[Optional[List[StatusInput]], Field(description="The status of the analysis")] = None, + model_name: Annotated[Optional[List[ModelName]], Field(description="Show analysis belonging to the model")] = None, + dynamic_execution_status: Annotated[Optional[DynamicExecutionStatus], Field(description="Show analysis that have a dynamic execution with the given status")] = None, + usernames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Show analysis belonging to the user")] = None, + sha256_hash: Optional[StrictStr] = None, + limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None, + offset: Optional[StrictInt] = None, + order_by: Optional[AppApiRestV2AnalysesEnumsOrderBy] = None, + order: Optional[Order] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets the most recent analyses + + Gets the most recent analyses provided a scope, this is then paginated, if pages and limit doesnt fit, it increases the limit + + :param search_term: + :type search_term: str + :param workspace: The workspace to be viewed + :type workspace: List[Workspace] + :param status: The status of the analysis + :type status: List[StatusInput] + :param model_name: Show analysis belonging to the model + :type model_name: List[ModelName] + :param dynamic_execution_status: Show analysis that have a dynamic execution with the given status + :type dynamic_execution_status: DynamicExecutionStatus + :param usernames: Show analysis belonging to the user + :type usernames: List[Optional[str]] + :param sha256_hash: + :type sha256_hash: str :param limit: :type limit: int :param offset: @@ -3953,18 +4503,202 @@ def list_analyses_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_analyses_serialize( - search_term=search_term, - workspace=workspace, - status=status, - model_name=model_name, - dynamic_execution_status=dynamic_execution_status, - usernames=usernames, - sha256_hash=sha256_hash, - limit=limit, - offset=offset, - order_by=order_by, - order=order, + _param = self._list_analyses_serialize( + search_term=search_term, + workspace=workspace, + status=status, + model_name=model_name, + dynamic_execution_status=dynamic_execution_status, + usernames=usernames, + sha256_hash=sha256_hash, + limit=limit, + offset=offset, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseRecent", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_analyses_serialize( + self, + search_term, + workspace, + status, + model_name, + dynamic_execution_status, + usernames, + sha256_hash, + limit, + offset, + order_by, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'workspace': 'multi', + 'status': 'multi', + 'model_name': 'multi', + 'usernames': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if search_term is not None: + + _query_params.append(('search_term', search_term)) + + if workspace is not None: + + _query_params.append(('workspace', workspace)) + + if status is not None: + + _query_params.append(('status', status)) + + if model_name is not None: + + _query_params.append(('model_name', model_name)) + + if dynamic_execution_status is not None: + + _query_params.append(('dynamic_execution_status', dynamic_execution_status.value)) + + if usernames is not None: + + _query_params.append(('usernames', usernames)) + + if sha256_hash is not None: + + _query_params.append(('sha256_hash', sha256_hash)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if order_by is not None: + + _query_params.append(('order_by', order_by.value)) + + if order is not None: + + _query_params.append(('order', order.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/analyses/list', + 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 lookup_binary_id( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> object: + """Gets the analysis ID from binary ID + + Given an binary ID gets the ID of an analysis + + :param binary_id: (required) + :type binary_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._lookup_binary_id_serialize( + binary_id=binary_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3972,7 +4706,143 @@ def list_analyses_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseRecent", + '200': "object", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def lookup_binary_id_with_http_info( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[object]: + """Gets the analysis ID from binary ID + + Given an binary ID gets the ID of an analysis + + :param binary_id: (required) + :type binary_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._lookup_binary_id_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def lookup_binary_id_without_preload_content( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets the analysis ID from binary ID + + Given an binary ID gets the ID of an analysis + + :param binary_id: (required) + :type binary_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._lookup_binary_id_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3982,19 +4852,9 @@ def list_analyses_without_preload_content( return response_data.response - def _list_analyses_serialize( + def _lookup_binary_id_serialize( self, - search_term, - workspace, - status, - model_name, - dynamic_execution_status, - usernames, - sha256_hash, - limit, - offset, - order_by, - order, + binary_id, _request_auth, _content_type, _headers, @@ -4004,10 +4864,6 @@ def _list_analyses_serialize( _host = None _collection_formats: Dict[str, str] = { - 'workspace': 'multi', - 'status': 'multi', - 'model_name': 'multi', - 'usernames': 'multi', } _path_params: Dict[str, str] = {} @@ -4020,51 +4876,9 @@ def _list_analyses_serialize( _body_params: Optional[bytes] = None # process the path parameters + if binary_id is not None: + _path_params['binary_id'] = binary_id # process the query parameters - if search_term is not None: - - _query_params.append(('search_term', search_term)) - - if workspace is not None: - - _query_params.append(('workspace', workspace)) - - if status is not None: - - _query_params.append(('status', status)) - - if model_name is not None: - - _query_params.append(('model_name', model_name)) - - if dynamic_execution_status is not None: - - _query_params.append(('dynamic_execution_status', dynamic_execution_status.value)) - - if usernames is not None: - - _query_params.append(('usernames', usernames)) - - if sha256_hash is not None: - - _query_params.append(('sha256_hash', sha256_hash)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if offset is not None: - - _query_params.append(('offset', offset)) - - if order_by is not None: - - _query_params.append(('order_by', order_by.value)) - - if order is not None: - - _query_params.append(('order', order.value)) - # process the header parameters # process the form parameters # process the body parameter @@ -4086,7 +4900,7 @@ def _list_analyses_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/list', + resource_path='/v2/analyses/lookup/{binary_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4103,9 +4917,10 @@ def _list_analyses_serialize( @validate_call - def lookup_binary_id( + def put_analysis_strings( self, - binary_id: StrictInt, + analysis_id: StrictInt, + put_analysis_strings_request: PutAnalysisStringsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4118,13 +4933,15 @@ def lookup_binary_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Gets the analysis ID from binary ID + ) -> BaseResponse: + """Add strings to the analysis - Given an binary ID gets the ID of an analysis + Add strings to the analysis. Rejects if any string already exists at the given vaddr. - :param binary_id: (required) - :type binary_id: int + :param analysis_id: (required) + :type analysis_id: int + :param put_analysis_strings_request: (required) + :type put_analysis_strings_request: PutAnalysisStringsRequest :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 @@ -4146,9 +4963,10 @@ def lookup_binary_id( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - - _param = self._lookup_binary_id_serialize( - binary_id=binary_id, + + _param = self._put_analysis_strings_serialize( + analysis_id=analysis_id, + put_analysis_strings_request=put_analysis_strings_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4156,7 +4974,7 @@ def lookup_binary_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '201': "BaseResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -4171,9 +4989,10 @@ def lookup_binary_id( @validate_call - def lookup_binary_id_with_http_info( + def put_analysis_strings_with_http_info( self, - binary_id: StrictInt, + analysis_id: StrictInt, + put_analysis_strings_request: PutAnalysisStringsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4186,13 +5005,15 @@ def lookup_binary_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Gets the analysis ID from binary ID + ) -> ApiResponse[BaseResponse]: + """Add strings to the analysis - Given an binary ID gets the ID of an analysis + Add strings to the analysis. Rejects if any string already exists at the given vaddr. - :param binary_id: (required) - :type binary_id: int + :param analysis_id: (required) + :type analysis_id: int + :param put_analysis_strings_request: (required) + :type put_analysis_strings_request: PutAnalysisStringsRequest :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 @@ -4215,8 +5036,9 @@ def lookup_binary_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._lookup_binary_id_serialize( - binary_id=binary_id, + _param = self._put_analysis_strings_serialize( + analysis_id=analysis_id, + put_analysis_strings_request=put_analysis_strings_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4224,7 +5046,7 @@ def lookup_binary_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '201': "BaseResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -4239,9 +5061,10 @@ def lookup_binary_id_with_http_info( @validate_call - def lookup_binary_id_without_preload_content( + def put_analysis_strings_without_preload_content( self, - binary_id: StrictInt, + analysis_id: StrictInt, + put_analysis_strings_request: PutAnalysisStringsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4255,12 +5078,14 @@ def lookup_binary_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the analysis ID from binary ID + """Add strings to the analysis - Given an binary ID gets the ID of an analysis + Add strings to the analysis. Rejects if any string already exists at the given vaddr. - :param binary_id: (required) - :type binary_id: int + :param analysis_id: (required) + :type analysis_id: int + :param put_analysis_strings_request: (required) + :type put_analysis_strings_request: PutAnalysisStringsRequest :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 @@ -4283,8 +5108,9 @@ def lookup_binary_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._lookup_binary_id_serialize( - binary_id=binary_id, + _param = self._put_analysis_strings_serialize( + analysis_id=analysis_id, + put_analysis_strings_request=put_analysis_strings_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4292,7 +5118,7 @@ def lookup_binary_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '201': "BaseResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -4302,9 +5128,10 @@ def lookup_binary_id_without_preload_content( return response_data.response - def _lookup_binary_id_serialize( + def _put_analysis_strings_serialize( self, - binary_id, + analysis_id, + put_analysis_strings_request, _request_auth, _content_type, _headers, @@ -4326,12 +5153,14 @@ def _lookup_binary_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if binary_id is not None: - _path_params['binary_id'] = binary_id + 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 put_analysis_strings_request is not None: + _body_params = put_analysis_strings_request # set the HTTP header `Accept` @@ -4342,6 +5171,19 @@ def _lookup_binary_id_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -4349,8 +5191,8 @@ def _lookup_binary_id_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v2/analyses/lookup/{binary_id}', + method='PUT', + resource_path='/v2/analyses/{analysis_id}/strings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4367,10 +5209,11 @@ def _lookup_binary_id_serialize( @validate_call - def put_analysis_strings( + def requeue_analysis( self, analysis_id: StrictInt, - put_analysis_strings_request: PutAnalysisStringsRequest, + re_analysis_form: ReAnalysisForm, + x_rev_eng_application: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4383,15 +5226,17 @@ def put_analysis_strings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponse: - """Add strings to the analysis + ) -> BaseResponseCreated: + """Requeue Analysis - Add strings to the analysis. Rejects if any string already exists at the given vaddr. + Re-queues an already uploaded analysis :param analysis_id: (required) :type analysis_id: int - :param put_analysis_strings_request: (required) - :type put_analysis_strings_request: PutAnalysisStringsRequest + :param re_analysis_form: (required) + :type re_analysis_form: ReAnalysisForm + :param x_rev_eng_application: + :type x_rev_eng_application: 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 @@ -4414,9 +5259,10 @@ def put_analysis_strings( :return: Returns the result object. """ # noqa: E501 - _param = self._put_analysis_strings_serialize( + _param = self._requeue_analysis_serialize( analysis_id=analysis_id, - put_analysis_strings_request=put_analysis_strings_request, + re_analysis_form=re_analysis_form, + x_rev_eng_application=x_rev_eng_application, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4424,8 +5270,10 @@ def put_analysis_strings( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", + '201': "BaseResponseCreated", '422': "BaseResponse", + '404': "BaseResponse", + '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -4439,10 +5287,11 @@ def put_analysis_strings( @validate_call - def put_analysis_strings_with_http_info( + def requeue_analysis_with_http_info( self, analysis_id: StrictInt, - put_analysis_strings_request: PutAnalysisStringsRequest, + re_analysis_form: ReAnalysisForm, + x_rev_eng_application: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4455,15 +5304,17 @@ def put_analysis_strings_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]: - """Add strings to the analysis + ) -> ApiResponse[BaseResponseCreated]: + """Requeue Analysis - Add strings to the analysis. Rejects if any string already exists at the given vaddr. + Re-queues an already uploaded analysis :param analysis_id: (required) :type analysis_id: int - :param put_analysis_strings_request: (required) - :type put_analysis_strings_request: PutAnalysisStringsRequest + :param re_analysis_form: (required) + :type re_analysis_form: ReAnalysisForm + :param x_rev_eng_application: + :type x_rev_eng_application: 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 @@ -4486,9 +5337,10 @@ def put_analysis_strings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._put_analysis_strings_serialize( + _param = self._requeue_analysis_serialize( analysis_id=analysis_id, - put_analysis_strings_request=put_analysis_strings_request, + re_analysis_form=re_analysis_form, + x_rev_eng_application=x_rev_eng_application, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4496,8 +5348,10 @@ def put_analysis_strings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", + '201': "BaseResponseCreated", '422': "BaseResponse", + '404': "BaseResponse", + '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -4511,10 +5365,11 @@ def put_analysis_strings_with_http_info( @validate_call - def put_analysis_strings_without_preload_content( + def requeue_analysis_without_preload_content( self, analysis_id: StrictInt, - put_analysis_strings_request: PutAnalysisStringsRequest, + re_analysis_form: ReAnalysisForm, + x_rev_eng_application: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4528,14 +5383,16 @@ def put_analysis_strings_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Add strings to the analysis + """Requeue Analysis - Add strings to the analysis. Rejects if any string already exists at the given vaddr. + Re-queues an already uploaded analysis :param analysis_id: (required) :type analysis_id: int - :param put_analysis_strings_request: (required) - :type put_analysis_strings_request: PutAnalysisStringsRequest + :param re_analysis_form: (required) + :type re_analysis_form: ReAnalysisForm + :param x_rev_eng_application: + :type x_rev_eng_application: 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 @@ -4558,9 +5415,10 @@ def put_analysis_strings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._put_analysis_strings_serialize( + _param = self._requeue_analysis_serialize( analysis_id=analysis_id, - put_analysis_strings_request=put_analysis_strings_request, + re_analysis_form=re_analysis_form, + x_rev_eng_application=x_rev_eng_application, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4568,8 +5426,10 @@ def put_analysis_strings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponse", + '201': "BaseResponseCreated", '422': "BaseResponse", + '404': "BaseResponse", + '400': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -4578,10 +5438,11 @@ def put_analysis_strings_without_preload_content( return response_data.response - def _put_analysis_strings_serialize( + def _requeue_analysis_serialize( self, analysis_id, - put_analysis_strings_request, + re_analysis_form, + x_rev_eng_application, _request_auth, _content_type, _headers, @@ -4607,10 +5468,12 @@ def _put_analysis_strings_serialize( _path_params['analysis_id'] = analysis_id # process the query parameters # process the header parameters + if x_rev_eng_application is not None: + _header_params['X-RevEng-Application'] = x_rev_eng_application # process the form parameters # process the body parameter - if put_analysis_strings_request is not None: - _body_params = put_analysis_strings_request + if re_analysis_form is not None: + _body_params = re_analysis_form # set the HTTP header `Accept` @@ -4641,8 +5504,8 @@ def _put_analysis_strings_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/analyses/{analysis_id}/strings', + method='POST', + resource_path='/v2/analyses/{analysis_id}/requeue', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4659,11 +5522,10 @@ def _put_analysis_strings_serialize( @validate_call - def requeue_analysis( + def start_analysis_function_matching( self, - analysis_id: StrictInt, - re_analysis_form: ReAnalysisForm, - x_rev_eng_application: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + start_matching_for_analysis_input_body: StartMatchingForAnalysisInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4676,17 +5538,15 @@ def requeue_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseCreated: - """Requeue Analysis + ) -> StartMatchingOutputBody: + """Start function matching for an analysis - Re-queues an already uploaded analysis + Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param re_analysis_form: (required) - :type re_analysis_form: ReAnalysisForm - :param x_rev_eng_application: - :type x_rev_eng_application: str + :param start_matching_for_analysis_input_body: (required) + :type start_matching_for_analysis_input_body: StartMatchingForAnalysisInputBody :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 @@ -4709,10 +5569,9 @@ def requeue_analysis( :return: Returns the result object. """ # noqa: E501 - _param = self._requeue_analysis_serialize( + _param = self._start_analysis_function_matching_serialize( analysis_id=analysis_id, - re_analysis_form=re_analysis_form, - x_rev_eng_application=x_rev_eng_application, + start_matching_for_analysis_input_body=start_matching_for_analysis_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4720,10 +5579,12 @@ def requeue_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseCreated", - '422': "BaseResponse", - '404': "BaseResponse", - '400': "BaseResponse", + '202': "StartMatchingOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -4737,11 +5598,10 @@ def requeue_analysis( @validate_call - def requeue_analysis_with_http_info( + def start_analysis_function_matching_with_http_info( self, - analysis_id: StrictInt, - re_analysis_form: ReAnalysisForm, - x_rev_eng_application: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + start_matching_for_analysis_input_body: StartMatchingForAnalysisInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4754,17 +5614,15 @@ def requeue_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[BaseResponseCreated]: - """Requeue Analysis + ) -> ApiResponse[StartMatchingOutputBody]: + """Start function matching for an analysis - Re-queues an already uploaded analysis + Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param re_analysis_form: (required) - :type re_analysis_form: ReAnalysisForm - :param x_rev_eng_application: - :type x_rev_eng_application: str + :param start_matching_for_analysis_input_body: (required) + :type start_matching_for_analysis_input_body: StartMatchingForAnalysisInputBody :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 @@ -4787,10 +5645,9 @@ def requeue_analysis_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._requeue_analysis_serialize( + _param = self._start_analysis_function_matching_serialize( analysis_id=analysis_id, - re_analysis_form=re_analysis_form, - x_rev_eng_application=x_rev_eng_application, + start_matching_for_analysis_input_body=start_matching_for_analysis_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4798,10 +5655,12 @@ def requeue_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseCreated", - '422': "BaseResponse", - '404': "BaseResponse", - '400': "BaseResponse", + '202': "StartMatchingOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -4815,11 +5674,10 @@ def requeue_analysis_with_http_info( @validate_call - def requeue_analysis_without_preload_content( + def start_analysis_function_matching_without_preload_content( self, - analysis_id: StrictInt, - re_analysis_form: ReAnalysisForm, - x_rev_eng_application: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + start_matching_for_analysis_input_body: StartMatchingForAnalysisInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4833,16 +5691,14 @@ def requeue_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Requeue Analysis + """Start function matching for an analysis - Re-queues an already uploaded analysis + Dispatches the function-matching workflow against every function in the analysis. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param re_analysis_form: (required) - :type re_analysis_form: ReAnalysisForm - :param x_rev_eng_application: - :type x_rev_eng_application: str + :param start_matching_for_analysis_input_body: (required) + :type start_matching_for_analysis_input_body: StartMatchingForAnalysisInputBody :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 @@ -4865,10 +5721,9 @@ def requeue_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._requeue_analysis_serialize( + _param = self._start_analysis_function_matching_serialize( analysis_id=analysis_id, - re_analysis_form=re_analysis_form, - x_rev_eng_application=x_rev_eng_application, + start_matching_for_analysis_input_body=start_matching_for_analysis_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4876,10 +5731,12 @@ def requeue_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseCreated", - '422': "BaseResponse", - '404': "BaseResponse", - '400': "BaseResponse", + '202': "StartMatchingOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -4888,11 +5745,10 @@ def requeue_analysis_without_preload_content( return response_data.response - def _requeue_analysis_serialize( + def _start_analysis_function_matching_serialize( self, analysis_id, - re_analysis_form, - x_rev_eng_application, + start_matching_for_analysis_input_body, _request_auth, _content_type, _headers, @@ -4918,12 +5774,10 @@ def _requeue_analysis_serialize( _path_params['analysis_id'] = analysis_id # process the query parameters # process the header parameters - if x_rev_eng_application is not None: - _header_params['X-RevEng-Application'] = x_rev_eng_application # process the form parameters # process the body parameter - if re_analysis_form is not None: - _body_params = re_analysis_form + if start_matching_for_analysis_input_body is not None: + _body_params = start_matching_for_analysis_input_body # set the HTTP header `Accept` @@ -4955,7 +5809,7 @@ def _requeue_analysis_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/analyses/{analysis_id}/requeue', + resource_path='/v3/analyses/{analysis_id}/functions/matches', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/analyses_results_metadata_api.py b/revengai/api/analyses_results_metadata_api.py index 8093223..e52e09a 100644 --- a/revengai/api/analyses_results_metadata_api.py +++ b/revengai/api/analyses_results_metadata_api.py @@ -62,7 +62,7 @@ def get_analysis_functions_paginated( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseAnalysisFunctionsList: - """Get functions from analysis + """(Deprecated) Get functions from analysis Returns a paginated list of functions identified during analysis @@ -93,6 +93,7 @@ def get_analysis_functions_paginated( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/functions is deprecated.", DeprecationWarning) _param = self._get_analysis_functions_paginated_serialize( analysis_id=analysis_id, @@ -138,7 +139,7 @@ def get_analysis_functions_paginated_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseAnalysisFunctionsList]: - """Get functions from analysis + """(Deprecated) Get functions from analysis Returns a paginated list of functions identified during analysis @@ -169,6 +170,7 @@ def get_analysis_functions_paginated_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/functions is deprecated.", DeprecationWarning) _param = self._get_analysis_functions_paginated_serialize( analysis_id=analysis_id, @@ -214,7 +216,7 @@ def get_analysis_functions_paginated_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get functions from analysis + """(Deprecated) Get functions from analysis Returns a paginated list of functions identified during analysis @@ -245,6 +247,7 @@ def get_analysis_functions_paginated_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/functions is deprecated.", DeprecationWarning) _param = self._get_analysis_functions_paginated_serialize( analysis_id=analysis_id, diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index f4c7551..0c560a3 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -32,9 +32,18 @@ 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_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse +from revengai.models.call_edges_output_body import CallEdgesOutputBody +from revengai.models.capabilities_output_body import CapabilitiesOutputBody +from revengai.models.disassembly_output_body import DisassemblyOutputBody +from revengai.models.function_details_output_body import FunctionDetailsOutputBody from revengai.models.function_matching_request import FunctionMatchingRequest from revengai.models.function_matching_response import FunctionMatchingResponse +from revengai.models.get_matches_output_body import GetMatchesOutputBody +from revengai.models.get_matches_status_output_body import GetMatchesStatusOutputBody +from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody +from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody +from revengai.models.start_matching_output_body import StartMatchingOutputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -677,7 +686,7 @@ def ai_unstrip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AutoUnstripResponse: - """Performs matching and auto-unstrip for an analysis and its functions + """(Deprecated) Performs matching and auto-unstrip for an analysis and its functions Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system @@ -706,6 +715,7 @@ def ai_unstrip( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/ai-unstrip is deprecated.", DeprecationWarning) _param = self._ai_unstrip_serialize( analysis_id=analysis_id, @@ -749,7 +759,7 @@ def ai_unstrip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AutoUnstripResponse]: - """Performs matching and auto-unstrip for an analysis and its functions + """(Deprecated) Performs matching and auto-unstrip for an analysis and its functions Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system @@ -778,6 +788,7 @@ def ai_unstrip_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/ai-unstrip is deprecated.", DeprecationWarning) _param = self._ai_unstrip_serialize( analysis_id=analysis_id, @@ -821,7 +832,7 @@ def ai_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Performs matching and auto-unstrip for an analysis and its functions + """(Deprecated) Performs matching and auto-unstrip for an analysis and its functions Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function groups for each function that's within the system @@ -850,6 +861,7 @@ def ai_unstrip_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/ai-unstrip is deprecated.", DeprecationWarning) _param = self._ai_unstrip_serialize( analysis_id=analysis_id, @@ -969,7 +981,7 @@ def analysis_function_matching( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FunctionMatchingResponse: - """Perform matching for the functions of an analysis + """(Deprecated) Perform matching for the functions of an analysis Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids @@ -998,6 +1010,7 @@ def analysis_function_matching( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/matches is deprecated.", DeprecationWarning) _param = self._analysis_function_matching_serialize( analysis_id=analysis_id, @@ -1041,7 +1054,7 @@ def analysis_function_matching_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[FunctionMatchingResponse]: - """Perform matching for the functions of an analysis + """(Deprecated) Perform matching for the functions of an analysis Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids @@ -1070,6 +1083,7 @@ def analysis_function_matching_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/matches is deprecated.", DeprecationWarning) _param = self._analysis_function_matching_serialize( analysis_id=analysis_id, @@ -1113,7 +1127,7 @@ def analysis_function_matching_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Perform matching for the functions of an analysis + """(Deprecated) Perform matching for the functions of an analysis Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids @@ -1142,6 +1156,7 @@ def analysis_function_matching_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/matches is deprecated.", DeprecationWarning) _param = self._analysis_function_matching_serialize( analysis_id=analysis_id, @@ -1261,7 +1276,7 @@ def auto_unstrip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AutoUnstripResponse: - """Performs matching and auto-unstrip for an analysis and its functions + """(Deprecated) Performs matching and auto-unstrip for an analysis and its functions Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system @@ -1290,6 +1305,7 @@ def auto_unstrip( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/auto-unstrip is deprecated.", DeprecationWarning) _param = self._auto_unstrip_serialize( analysis_id=analysis_id, @@ -1333,7 +1349,7 @@ def auto_unstrip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AutoUnstripResponse]: - """Performs matching and auto-unstrip for an analysis and its functions + """(Deprecated) Performs matching and auto-unstrip for an analysis and its functions Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system @@ -1362,6 +1378,7 @@ def auto_unstrip_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/auto-unstrip is deprecated.", DeprecationWarning) _param = self._auto_unstrip_serialize( analysis_id=analysis_id, @@ -1405,7 +1422,7 @@ def auto_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Performs matching and auto-unstrip for an analysis and its functions + """(Deprecated) Performs matching and auto-unstrip for an analysis and its functions Takes in the analysis ID, uses the functions ID's from it and settings to find the nearest function for each function that's within the system @@ -1434,6 +1451,7 @@ def auto_unstrip_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/functions/auto-unstrip is deprecated.", DeprecationWarning) _param = self._auto_unstrip_serialize( analysis_id=analysis_id, @@ -1552,7 +1570,7 @@ def batch_function_matching( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FunctionMatchingResponse: - """Perform function matching for an arbitrary batch of functions, binaries or collections + """(Deprecated) Perform function matching for an arbitrary batch of functions, binaries or collections Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system @@ -1579,6 +1597,7 @@ def batch_function_matching( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/functions/matches is deprecated.", DeprecationWarning) _param = self._batch_function_matching_serialize( function_matching_request=function_matching_request, @@ -1620,7 +1639,7 @@ def batch_function_matching_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[FunctionMatchingResponse]: - """Perform function matching for an arbitrary batch of functions, binaries or collections + """(Deprecated) Perform function matching for an arbitrary batch of functions, binaries or collections Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system @@ -1647,6 +1666,7 @@ def batch_function_matching_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/functions/matches is deprecated.", DeprecationWarning) _param = self._batch_function_matching_serialize( function_matching_request=function_matching_request, @@ -1688,7 +1708,7 @@ def batch_function_matching_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Perform function matching for an arbitrary batch of functions, binaries or collections + """(Deprecated) Perform function matching for an arbitrary batch of functions, binaries or collections Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system @@ -1715,6 +1735,7 @@ def batch_function_matching_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/functions/matches is deprecated.", DeprecationWarning) _param = self._batch_function_matching_serialize( function_matching_request=function_matching_request, @@ -1829,7 +1850,7 @@ def cancel_ai_unstrip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AutoUnstripResponse: - """Cancels a running ai-unstrip + """(Deprecated) Cancels a running ai-unstrip Takes in the analysis ID and cancels a running ai-unstrip operation @@ -1856,6 +1877,7 @@ def cancel_ai_unstrip( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel is deprecated.", DeprecationWarning) _param = self._cancel_ai_unstrip_serialize( analysis_id=analysis_id, @@ -1897,7 +1919,7 @@ def cancel_ai_unstrip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AutoUnstripResponse]: - """Cancels a running ai-unstrip + """(Deprecated) Cancels a running ai-unstrip Takes in the analysis ID and cancels a running ai-unstrip operation @@ -1924,6 +1946,7 @@ def cancel_ai_unstrip_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel is deprecated.", DeprecationWarning) _param = self._cancel_ai_unstrip_serialize( analysis_id=analysis_id, @@ -1965,7 +1988,7 @@ def cancel_ai_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Cancels a running ai-unstrip + """(Deprecated) Cancels a running ai-unstrip Takes in the analysis ID and cancels a running ai-unstrip operation @@ -1992,6 +2015,7 @@ def cancel_ai_unstrip_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/functions/ai-unstrip/cancel is deprecated.", DeprecationWarning) _param = self._cancel_ai_unstrip_serialize( analysis_id=analysis_id, @@ -2093,7 +2117,7 @@ def cancel_auto_unstrip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AutoUnstripResponse: - """Cancels a running auto-unstrip + """(Deprecated) Cancels a running auto-unstrip Takes in the analysis ID and cancels a running auto-unstrip operation @@ -2120,6 +2144,7 @@ def cancel_auto_unstrip( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/functions/unstrip/cancel is deprecated.", DeprecationWarning) _param = self._cancel_auto_unstrip_serialize( analysis_id=analysis_id, @@ -2161,7 +2186,7 @@ def cancel_auto_unstrip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AutoUnstripResponse]: - """Cancels a running auto-unstrip + """(Deprecated) Cancels a running auto-unstrip Takes in the analysis ID and cancels a running auto-unstrip operation @@ -2188,6 +2213,7 @@ def cancel_auto_unstrip_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/functions/unstrip/cancel is deprecated.", DeprecationWarning) _param = self._cancel_auto_unstrip_serialize( analysis_id=analysis_id, @@ -2229,7 +2255,7 @@ def cancel_auto_unstrip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Cancels a running auto-unstrip + """(Deprecated) Cancels a running auto-unstrip Takes in the analysis ID and cancels a running auto-unstrip operation @@ -2256,6 +2282,7 @@ def cancel_auto_unstrip_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/functions/unstrip/cancel is deprecated.", DeprecationWarning) _param = self._cancel_auto_unstrip_serialize( analysis_id=analysis_id, @@ -2993,7 +3020,7 @@ def get_function_blocks( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseFunctionBlocksResponse: - """Get disassembly blocks related to the function + """(Deprecated) Get disassembly blocks related to the function Get disassembly blocks related to the function @@ -3020,6 +3047,7 @@ def get_function_blocks( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id}/blocks is deprecated.", DeprecationWarning) _param = self._get_function_blocks_serialize( function_id=function_id, @@ -3062,7 +3090,7 @@ def get_function_blocks_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseFunctionBlocksResponse]: - """Get disassembly blocks related to the function + """(Deprecated) Get disassembly blocks related to the function Get disassembly blocks related to the function @@ -3089,6 +3117,7 @@ def get_function_blocks_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id}/blocks is deprecated.", DeprecationWarning) _param = self._get_function_blocks_serialize( function_id=function_id, @@ -3131,7 +3160,7 @@ def get_function_blocks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get disassembly blocks related to the function + """(Deprecated) Get disassembly blocks related to the function Get disassembly blocks related to the function @@ -3158,6 +3187,7 @@ def get_function_blocks_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id}/blocks is deprecated.", DeprecationWarning) _param = self._get_function_blocks_serialize( function_id=function_id, @@ -3244,9 +3274,9 @@ def _get_function_blocks_serialize( @validate_call - def get_function_callees_callers( + def get_function_blocks_0( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3259,11 +3289,12 @@ def get_function_callees_callers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseCalleesCallerFunctionsResponse: - """Get list of functions that call or are called by the specified function + ) -> 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 - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3287,7 +3318,7 @@ def get_function_callees_callers( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_serialize( + _param = self._get_function_blocks_0_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3296,8 +3327,11 @@ def get_function_callees_callers( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCalleesCallerFunctionsResponse", - '422': "BaseResponse", + '200': "DisassemblyOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3311,9 +3345,9 @@ def get_function_callees_callers( @validate_call - def get_function_callees_callers_with_http_info( + def get_function_blocks_0_with_http_info( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3326,11 +3360,12 @@ def get_function_callees_callers_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[BaseResponseCalleesCallerFunctionsResponse]: - """Get list of functions that call or are called by the specified function + ) -> 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 - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3354,7 +3389,7 @@ def get_function_callees_callers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_serialize( + _param = self._get_function_blocks_0_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3363,8 +3398,11 @@ def get_function_callees_callers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCalleesCallerFunctionsResponse", - '422': "BaseResponse", + '200': "DisassemblyOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3378,9 +3416,9 @@ def get_function_callees_callers_with_http_info( @validate_call - def get_function_callees_callers_without_preload_content( + def get_function_blocks_0_without_preload_content( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3394,10 +3432,11 @@ def get_function_callees_callers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get list of functions that call or are called by the specified function + """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 - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3421,7 +3460,7 @@ def get_function_callees_callers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_callees_callers_serialize( + _param = self._get_function_blocks_0_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3430,8 +3469,11 @@ def get_function_callees_callers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseCalleesCallerFunctionsResponse", - '422': "BaseResponse", + '200': "DisassemblyOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3440,7 +3482,7 @@ def get_function_callees_callers_without_preload_content( return response_data.response - def _get_function_callees_callers_serialize( + def _get_function_blocks_0_serialize( self, function_id, _request_auth, @@ -3488,7 +3530,7 @@ def _get_function_callees_callers_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/callees_callers', + resource_path='/v3/functions/{function_id}/blocks', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3505,9 +3547,9 @@ def _get_function_callees_callers_serialize( @validate_call - def get_function_callees_callers_bulk( + def get_function_callees_callers( self, - function_ids: List[Optional[StrictInt]], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3520,12 +3562,12 @@ def get_function_callees_callers_bulk( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseListCalleesCallerFunctionsResponse: - """Get list of functions that call or are called for a list of functions + ) -> BaseResponseCalleesCallerFunctionsResponse: + """(Deprecated) Get list of functions that call or are called by the specified function - :param function_ids: (required) - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3547,9 +3589,10 @@ def get_function_callees_callers_bulk( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id}/callees_callers is deprecated.", DeprecationWarning) - _param = self._get_function_callees_callers_bulk_serialize( - function_ids=function_ids, + _param = self._get_function_callees_callers_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3557,7 +3600,7 @@ def get_function_callees_callers_bulk( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCalleesCallerFunctionsResponse", + '200': "BaseResponseCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3572,9 +3615,9 @@ def get_function_callees_callers_bulk( @validate_call - def get_function_callees_callers_bulk_with_http_info( + def get_function_callees_callers_with_http_info( self, - function_ids: List[Optional[StrictInt]], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3587,12 +3630,12 @@ def get_function_callees_callers_bulk_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[BaseResponseListCalleesCallerFunctionsResponse]: - """Get list of functions that call or are called for a list of functions + ) -> ApiResponse[BaseResponseCalleesCallerFunctionsResponse]: + """(Deprecated) Get list of functions that call or are called by the specified function - :param function_ids: (required) - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3614,9 +3657,10 @@ def get_function_callees_callers_bulk_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id}/callees_callers is deprecated.", DeprecationWarning) - _param = self._get_function_callees_callers_bulk_serialize( - function_ids=function_ids, + _param = self._get_function_callees_callers_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3624,7 +3668,7 @@ def get_function_callees_callers_bulk_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCalleesCallerFunctionsResponse", + '200': "BaseResponseCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3639,9 +3683,9 @@ def get_function_callees_callers_bulk_with_http_info( @validate_call - def get_function_callees_callers_bulk_without_preload_content( + def get_function_callees_callers_without_preload_content( self, - function_ids: List[Optional[StrictInt]], + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3655,11 +3699,11 @@ def get_function_callees_callers_bulk_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get list of functions that call or are called for a list of functions + """(Deprecated) Get list of functions that call or are called by the specified function - :param function_ids: (required) - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3681,9 +3725,10 @@ def get_function_callees_callers_bulk_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id}/callees_callers is deprecated.", DeprecationWarning) - _param = self._get_function_callees_callers_bulk_serialize( - function_ids=function_ids, + _param = self._get_function_callees_callers_serialize( + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3691,7 +3736,7 @@ def get_function_callees_callers_bulk_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseListCalleesCallerFunctionsResponse", + '200': "BaseResponseCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -3701,9 +3746,9 @@ def get_function_callees_callers_bulk_without_preload_content( return response_data.response - def _get_function_callees_callers_bulk_serialize( + def _get_function_callees_callers_serialize( self, - function_ids, + function_id, _request_auth, _content_type, _headers, @@ -3713,7 +3758,6 @@ def _get_function_callees_callers_bulk_serialize( _host = None _collection_formats: Dict[str, str] = { - 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -3726,11 +3770,9 @@ def _get_function_callees_callers_bulk_serialize( _body_params: Optional[bytes] = None # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters - 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 @@ -3752,7 +3794,7 @@ def _get_function_callees_callers_bulk_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/callees_callers', + resource_path='/v2/functions/{function_id}/callees_callers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3769,9 +3811,9 @@ def _get_function_callees_callers_bulk_serialize( @validate_call - def get_function_capabilities( + def get_function_callees_callers_0( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3784,11 +3826,12 @@ def get_function_capabilities( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionCapabilityResponse: - """Retrieve a functions capabilities + ) -> CallEdgesOutputBody: + """Get callees and callers for a function + Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3812,7 +3855,7 @@ def get_function_capabilities( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_capabilities_serialize( + _param = self._get_function_callees_callers_0_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3821,9 +3864,11 @@ def get_function_capabilities( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionCapabilityResponse", - '422': "BaseResponse", - '404': "BaseResponse", + '200': "CallEdgesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3837,9 +3882,9 @@ def get_function_capabilities( @validate_call - def get_function_capabilities_with_http_info( + def get_function_callees_callers_0_with_http_info( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3852,11 +3897,12 @@ def get_function_capabilities_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[BaseResponseFunctionCapabilityResponse]: - """Retrieve a functions capabilities + ) -> ApiResponse[CallEdgesOutputBody]: + """Get callees and callers for a function + Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3880,7 +3926,7 @@ def get_function_capabilities_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_capabilities_serialize( + _param = self._get_function_callees_callers_0_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3889,9 +3935,11 @@ def get_function_capabilities_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionCapabilityResponse", - '422': "BaseResponse", - '404': "BaseResponse", + '200': "CallEdgesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3905,9 +3953,9 @@ def get_function_capabilities_with_http_info( @validate_call - def get_function_capabilities_without_preload_content( + def get_function_callees_callers_0_without_preload_content( self, - function_id: StrictInt, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3921,10 +3969,11 @@ def get_function_capabilities_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Retrieve a functions capabilities + """Get callees and callers for a function + Returns both the outgoing call edges (callees) and incoming call edges (callers) for a single function. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - :param function_id: (required) + :param function_id: Function ID (required) :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3948,7 +3997,7 @@ def get_function_capabilities_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_capabilities_serialize( + _param = self._get_function_callees_callers_0_serialize( function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, @@ -3957,9 +4006,11 @@ def get_function_capabilities_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionCapabilityResponse", - '422': "BaseResponse", - '404': "BaseResponse", + '200': "CallEdgesOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -3968,7 +4019,7 @@ def get_function_capabilities_without_preload_content( return response_data.response - def _get_function_capabilities_serialize( + def _get_function_callees_callers_0_serialize( self, function_id, _request_auth, @@ -4016,7 +4067,7 @@ def _get_function_capabilities_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/capabilities', + resource_path='/v3/functions/{function_id}/callees-callers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4033,9 +4084,9 @@ def _get_function_capabilities_serialize( @validate_call - def get_function_details( + def get_function_callees_callers_bulk( self, - function_id: StrictInt, + function_ids: List[Optional[StrictInt]], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4048,12 +4099,12 @@ def get_function_details( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionsDetailResponse: - """Get function details + ) -> BaseResponseListCalleesCallerFunctionsResponse: + """(Deprecated) Get list of functions that call or are called for a list of functions - :param function_id: (required) - :type function_id: int + :param function_ids: (required) + :type function_ids: List[Optional[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 @@ -4075,9 +4126,10 @@ def get_function_details( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/callees_callers is deprecated.", DeprecationWarning) - _param = self._get_function_details_serialize( - function_id=function_id, + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4085,7 +4137,7 @@ def get_function_details( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionsDetailResponse", + '200': "BaseResponseListCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -4100,9 +4152,9 @@ def get_function_details( @validate_call - def get_function_details_with_http_info( + def get_function_callees_callers_bulk_with_http_info( self, - function_id: StrictInt, + function_ids: List[Optional[StrictInt]], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4115,12 +4167,12 @@ def get_function_details_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[BaseResponseFunctionsDetailResponse]: - """Get function details + ) -> ApiResponse[BaseResponseListCalleesCallerFunctionsResponse]: + """(Deprecated) Get list of functions that call or are called for a list of functions - :param function_id: (required) - :type function_id: int + :param function_ids: (required) + :type function_ids: List[Optional[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 @@ -4142,9 +4194,10 @@ def get_function_details_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/callees_callers is deprecated.", DeprecationWarning) - _param = self._get_function_details_serialize( - function_id=function_id, + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4152,7 +4205,7 @@ def get_function_details_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionsDetailResponse", + '200': "BaseResponseListCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -4167,9 +4220,9 @@ def get_function_details_with_http_info( @validate_call - def get_function_details_without_preload_content( + def get_function_callees_callers_bulk_without_preload_content( self, - function_id: StrictInt, + function_ids: List[Optional[StrictInt]], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4183,11 +4236,11 @@ def get_function_details_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get function details + """(Deprecated) Get list of functions that call or are called for a list of functions - :param function_id: (required) - :type function_id: int + :param function_ids: (required) + :type function_ids: List[Optional[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 @@ -4209,9 +4262,10 @@ def get_function_details_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/functions/callees_callers is deprecated.", DeprecationWarning) - _param = self._get_function_details_serialize( - function_id=function_id, + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4219,7 +4273,7 @@ def get_function_details_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionsDetailResponse", + '200': "BaseResponseListCalleesCallerFunctionsResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -4229,9 +4283,9 @@ def get_function_details_without_preload_content( return response_data.response - def _get_function_details_serialize( + def _get_function_callees_callers_bulk_serialize( self, - function_id, + function_ids, _request_auth, _content_type, _headers, @@ -4241,6 +4295,7 @@ def _get_function_details_serialize( _host = None _collection_formats: Dict[str, str] = { + 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -4253,9 +4308,11 @@ def _get_function_details_serialize( _body_params: Optional[bytes] = None # process the path parameters - if function_id is not None: - _path_params['function_id'] = function_id # process the query parameters + 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 @@ -4277,7 +4334,7 @@ def _get_function_details_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}', + resource_path='/v2/functions/callees_callers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4294,12 +4351,9 @@ def _get_function_details_serialize( @validate_call - def get_function_strings( + def get_function_capabilities( self, function_id: StrictInt, - page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4312,19 +4366,12 @@ def get_function_strings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionStringsResponse: - """(Deprecated) Get string information found in the function + ) -> BaseResponseFunctionCapabilityResponse: + """(Deprecated) Retrieve a functions capabilities - Get string information found in the function :param function_id: (required) :type function_id: int - :param page: The page number to retrieve. - :type page: int - :param page_size: Number of items per page. - :type page_size: int - :param search: Search is applied to string value - :type search: 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 @@ -4346,13 +4393,10 @@ def get_function_strings( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/functions/{function_id}/strings is deprecated.", DeprecationWarning) + warnings.warn("GET /v2/functions/{function_id}/capabilities is deprecated.", DeprecationWarning) - _param = self._get_function_strings_serialize( + _param = self._get_function_capabilities_serialize( function_id=function_id, - page=page, - page_size=page_size, - search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4360,8 +4404,9 @@ def get_function_strings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionStringsResponse", + '200': "BaseResponseFunctionCapabilityResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -4375,12 +4420,9 @@ def get_function_strings( @validate_call - def get_function_strings_with_http_info( + def get_function_capabilities_with_http_info( self, function_id: StrictInt, - page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4393,19 +4435,12 @@ def get_function_strings_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[BaseResponseFunctionStringsResponse]: - """(Deprecated) Get string information found in the function + ) -> ApiResponse[BaseResponseFunctionCapabilityResponse]: + """(Deprecated) Retrieve a functions capabilities - Get string information found in the function :param function_id: (required) :type function_id: int - :param page: The page number to retrieve. - :type page: int - :param page_size: Number of items per page. - :type page_size: int - :param search: Search is applied to string value - :type search: 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 @@ -4427,13 +4462,10 @@ def get_function_strings_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/functions/{function_id}/strings is deprecated.", DeprecationWarning) + warnings.warn("GET /v2/functions/{function_id}/capabilities is deprecated.", DeprecationWarning) - _param = self._get_function_strings_serialize( + _param = self._get_function_capabilities_serialize( function_id=function_id, - page=page, - page_size=page_size, - search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4441,8 +4473,9 @@ def get_function_strings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionStringsResponse", + '200': "BaseResponseFunctionCapabilityResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -4456,12 +4489,9 @@ def get_function_strings_with_http_info( @validate_call - def get_function_strings_without_preload_content( + def get_function_capabilities_without_preload_content( self, function_id: StrictInt, - page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, - search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4475,18 +4505,11 @@ def get_function_strings_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """(Deprecated) Get string information found in the function + """(Deprecated) Retrieve a functions capabilities - Get string information found in the function :param function_id: (required) :type function_id: int - :param page: The page number to retrieve. - :type page: int - :param page_size: Number of items per page. - :type page_size: int - :param search: Search is applied to string value - :type search: 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 @@ -4508,13 +4531,10 @@ def get_function_strings_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 - warnings.warn("GET /v2/functions/{function_id}/strings is deprecated.", DeprecationWarning) + warnings.warn("GET /v2/functions/{function_id}/capabilities is deprecated.", DeprecationWarning) - _param = self._get_function_strings_serialize( + _param = self._get_function_capabilities_serialize( function_id=function_id, - page=page, - page_size=page_size, - search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4522,8 +4542,9 @@ def get_function_strings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionStringsResponse", + '200': "BaseResponseFunctionCapabilityResponse", '422': "BaseResponse", + '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -4532,12 +4553,9 @@ def get_function_strings_without_preload_content( return response_data.response - def _get_function_strings_serialize( + def _get_function_capabilities_serialize( self, function_id, - page, - page_size, - search, _request_auth, _content_type, _headers, @@ -4562,18 +4580,6 @@ def _get_function_strings_serialize( if function_id is not None: _path_params['function_id'] = function_id # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if search is not None: - - _query_params.append(('search', search)) - # process the header parameters # process the form parameters # process the body parameter @@ -4595,7 +4601,7 @@ def _get_function_strings_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/{function_id}/strings', + resource_path='/v2/functions/{function_id}/capabilities', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4612,12 +4618,9 @@ def _get_function_strings_serialize( @validate_call - def get_function_strings_0( + def get_function_capabilities_0( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, - search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4630,19 +4633,13 @@ def get_function_strings_0( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListFunctionStringsOutputBody: - """List strings for a function. + ) -> CapabilitiesOutputBody: + """Get capabilities for a function - Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **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 page: Page number (1-indexed). - :type page: int - :param page_size: Number of results per page. - :type page_size: int - :param search: Filter by string value (case-insensitive substring match). - :type search: 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 @@ -4665,11 +4662,8 @@ def get_function_strings_0( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_strings_0_serialize( + _param = self._get_function_capabilities_0_serialize( function_id=function_id, - page=page, - page_size=page_size, - search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4677,7 +4671,7 @@ def get_function_strings_0( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListFunctionStringsOutputBody", + '200': "CapabilitiesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4695,12 +4689,9 @@ def get_function_strings_0( @validate_call - def get_function_strings_0_with_http_info( + def get_function_capabilities_0_with_http_info( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, - search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4713,19 +4704,13 @@ def get_function_strings_0_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[ListFunctionStringsOutputBody]: - """List strings for a function. + ) -> ApiResponse[CapabilitiesOutputBody]: + """Get capabilities for a function - Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **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 page: Page number (1-indexed). - :type page: int - :param page_size: Number of results per page. - :type page_size: int - :param search: Filter by string value (case-insensitive substring match). - :type search: 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 @@ -4748,11 +4733,8 @@ def get_function_strings_0_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_strings_0_serialize( + _param = self._get_function_capabilities_0_serialize( function_id=function_id, - page=page, - page_size=page_size, - search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4760,7 +4742,7 @@ def get_function_strings_0_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListFunctionStringsOutputBody", + '200': "CapabilitiesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4778,12 +4760,9 @@ def get_function_strings_0_with_http_info( @validate_call - def get_function_strings_0_without_preload_content( + def get_function_capabilities_0_without_preload_content( self, function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, - search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4797,18 +4776,12 @@ def get_function_strings_0_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List strings for a function. + """Get capabilities for a function - Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the capability findings (CAPA-style behaviour matches) associated with the given function. **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 page: Page number (1-indexed). - :type page: int - :param page_size: Number of results per page. - :type page_size: int - :param search: Filter by string value (case-insensitive substring match). - :type search: 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 @@ -4831,11 +4804,8 @@ def get_function_strings_0_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_strings_0_serialize( + _param = self._get_function_capabilities_0_serialize( function_id=function_id, - page=page, - page_size=page_size, - search=search, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4843,7 +4813,7 @@ def get_function_strings_0_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListFunctionStringsOutputBody", + '200': "CapabilitiesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4856,12 +4826,9 @@ def get_function_strings_0_without_preload_content( return response_data.response - def _get_function_strings_0_serialize( + def _get_function_capabilities_0_serialize( self, function_id, - page, - page_size, - search, _request_auth, _content_type, _headers, @@ -4886,18 +4853,6 @@ def _get_function_strings_0_serialize( if function_id is not None: _path_params['function_id'] = function_id # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if search is not None: - - _query_params.append(('search', search)) - # process the header parameters # process the form parameters # process the body parameter @@ -4919,7 +4874,2619 @@ def _get_function_strings_0_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/functions/{function_id}/strings', + resource_path='/v3/functions/{function_id}/capabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_function_details( + self, + function_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseFunctionsDetailResponse: + """(Deprecated) Get function details + + + :param function_id: (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id} is deprecated.", DeprecationWarning) + + _param = self._get_function_details_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': "BaseResponseFunctionsDetailResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_function_details_with_http_info( + self, + function_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseFunctionsDetailResponse]: + """(Deprecated) Get function details + + + :param function_id: (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id} is deprecated.", DeprecationWarning) + + _param = self._get_function_details_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': "BaseResponseFunctionsDetailResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_function_details_without_preload_content( + self, + function_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Get function details + + + :param function_id: (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /v2/functions/{function_id} is deprecated.", DeprecationWarning) + + _param = self._get_function_details_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': "BaseResponseFunctionsDetailResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_function_details_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/functions/{function_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_function_details_0( + 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, + ) -> FunctionDetailsOutputBody: + """Get function details + + Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_details_0_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': "FunctionDetailsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_function_details_0_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[FunctionDetailsOutputBody]: + """Get function details + + Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_details_0_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': "FunctionDetailsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_function_details_0_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 function details + + Returns metadata for a single function — name, virtual address, size, debug status, binary it belongs to. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_details_0_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': "FunctionDetailsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_function_details_0_serialize( + self, + function_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_function_strings( + self, + function_id: StrictInt, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseFunctionStringsResponse: + """(Deprecated) Get string information found in the function + + Get string information found in the function + + :param function_id: (required) + :type function_id: int + :param page: The page number to retrieve. + :type page: int + :param page_size: Number of items per page. + :type page_size: int + :param search: Search is applied to string value + :type search: 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 + (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 + warnings.warn("GET /v2/functions/{function_id}/strings is deprecated.", DeprecationWarning) + + _param = self._get_function_strings_serialize( + function_id=function_id, + page=page, + page_size=page_size, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseFunctionStringsResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_function_strings_with_http_info( + self, + function_id: StrictInt, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseFunctionStringsResponse]: + """(Deprecated) Get string information found in the function + + Get string information found in the function + + :param function_id: (required) + :type function_id: int + :param page: The page number to retrieve. + :type page: int + :param page_size: Number of items per page. + :type page_size: int + :param search: Search is applied to string value + :type search: 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 + (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 + warnings.warn("GET /v2/functions/{function_id}/strings is deprecated.", DeprecationWarning) + + _param = self._get_function_strings_serialize( + function_id=function_id, + page=page, + page_size=page_size, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseFunctionStringsResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_function_strings_without_preload_content( + self, + function_id: StrictInt, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="The page number to retrieve.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of items per page.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Search is applied to string value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Get string information found in the function + + Get string information found in the function + + :param function_id: (required) + :type function_id: int + :param page: The page number to retrieve. + :type page: int + :param page_size: Number of items per page. + :type page_size: int + :param search: Search is applied to string value + :type search: 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 + (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 + warnings.warn("GET /v2/functions/{function_id}/strings is deprecated.", DeprecationWarning) + + _param = self._get_function_strings_serialize( + function_id=function_id, + page=page, + page_size=page_size, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseFunctionStringsResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_function_strings_serialize( + self, + function_id, + page, + page_size, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/functions/{function_id}/strings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_function_strings_0( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListFunctionStringsOutputBody: + """List strings for a function. + + Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param function_id: Function ID (required) + :type function_id: int + :param page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_strings_0_serialize( + function_id=function_id, + page=page, + page_size=page_size, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFunctionStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_function_strings_0_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListFunctionStringsOutputBody]: + """List strings for a function. + + Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param function_id: Function ID (required) + :type function_id: int + :param page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_strings_0_serialize( + function_id=function_id, + page=page, + page_size=page_size, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFunctionStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_function_strings_0_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List strings for a function. + + Returns the strings discovered in a function. Supports value search and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param function_id: Function ID (required) + :type function_id: int + :param page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_strings_0_serialize( + function_id=function_id, + page=page, + page_size=page_size, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFunctionStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_function_strings_0_serialize( + self, + function_id, + page, + page_size, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/{function_id}/strings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_functions_callees_callers( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=100)]], Field(description="Function IDs to fetch edges for.")], + _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, + ) -> CallEdgesOutputBody: + """Get callees and callers for many functions + + Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole 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 + + :param function_ids: Function IDs to fetch edges for. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_callees_callers_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallEdgesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_functions_callees_callers_with_http_info( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=100)]], Field(description="Function IDs to fetch edges for.")], + _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[CallEdgesOutputBody]: + """Get callees and callers for many functions + + Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole 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 + + :param function_ids: Function IDs to fetch edges for. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_callees_callers_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallEdgesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_functions_callees_callers_without_preload_content( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=100)]], Field(description="Function IDs to fetch edges for.")], + _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 callees and callers for many functions + + Bulk variant — pass `function_ids` as a query parameter (comma-separated or repeated). Caller must have access to every supplied function or the whole 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 + + :param function_ids: Function IDs to fetch edges for. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_callees_callers_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallEdgesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_functions_callees_callers_serialize( + self, + function_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'function_ids': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + 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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/callees-callers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_functions_matches( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + _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, + ) -> GetMatchesOutputBody: + """Get function-matching results for an explicit set of functions + + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_ids: Source function IDs whose matches to fetch. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_matches_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetMatchesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_functions_matches_with_http_info( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + _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[GetMatchesOutputBody]: + """Get function-matching results for an explicit set of functions + + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_ids: Source function IDs whose matches to fetch. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_matches_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetMatchesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_functions_matches_without_preload_content( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + _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 function-matching results for an explicit set of functions + + Returns the matches blob when the matching workflow has completed. While the workflow is in progress this endpoint returns the current status with no matches; use /matches/status to poll progress. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_ids: Source function IDs whose matches to fetch. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_matches_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetMatchesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_functions_matches_serialize( + self, + function_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'function_ids': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + 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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/matches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_functions_matching_status( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + _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, + ) -> GetMatchesStatusOutputBody: + """Get function-matching status for an explicit set of functions + + Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_ids: Source function IDs whose matches to fetch. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_matching_status_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetMatchesStatusOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_functions_matching_status_with_http_info( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + _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[GetMatchesStatusOutputBody]: + """Get function-matching status for an explicit set of functions + + Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_ids: Source function IDs whose matches to fetch. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_matching_status_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetMatchesStatusOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_functions_matching_status_without_preload_content( + self, + function_ids: Annotated[Optional[Annotated[List[StrictInt], Field(min_length=1)]], Field(description="Source function IDs whose matches to fetch.")], + _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 function-matching status for an explicit set of functions + + Returns the matching workflow's current status for the supplied function IDs. Does not include the matches blob — use GET /matches for that. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param function_ids: Source function IDs whose matches to fetch. (required) + :type function_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_functions_matching_status_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetMatchesStatusOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_functions_matching_status_serialize( + self, + function_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'function_ids': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + 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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/matches/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 list_analysis_functions( + 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, + _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, + ) -> ListAnalysisFunctionsOutputBody: + """List functions in an analysis + + Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **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 offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsOutputBody", + '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 list_analysis_functions_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, + _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[ListAnalysisFunctionsOutputBody]: + """List functions in an analysis + + Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **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 offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsOutputBody", + '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 list_analysis_functions_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, + _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: + """List functions in an analysis + + Returns a paginated list of functions belonging to the analysis. `total_count` is the full population size, ignoring pagination. **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 offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsOutputBody", + '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 _list_analysis_functions_serialize( + self, + analysis_id, + offset, + limit, + _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 + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/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 start_functions_matching( + self, + start_matching_for_functions_input_body: StartMatchingForFunctionsInputBody, + _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, + ) -> StartMatchingOutputBody: + """Start function matching for an explicit set of functions + + Dispatches the function-matching workflow against the provided function IDs. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param start_matching_for_functions_input_body: (required) + :type start_matching_for_functions_input_body: StartMatchingForFunctionsInputBody + :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._start_functions_matching_serialize( + start_matching_for_functions_input_body=start_matching_for_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': "StartMatchingOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def start_functions_matching_with_http_info( + self, + start_matching_for_functions_input_body: StartMatchingForFunctionsInputBody, + _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[StartMatchingOutputBody]: + """Start function matching for an explicit set of functions + + Dispatches the function-matching workflow against the provided function IDs. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param start_matching_for_functions_input_body: (required) + :type start_matching_for_functions_input_body: StartMatchingForFunctionsInputBody + :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._start_functions_matching_serialize( + start_matching_for_functions_input_body=start_matching_for_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': "StartMatchingOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def start_functions_matching_without_preload_content( + self, + start_matching_for_functions_input_body: StartMatchingForFunctionsInputBody, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start function matching for an explicit set of functions + + Dispatches the function-matching workflow against the provided function IDs. Returns immediately. Poll the status endpoint for progress; fetch results from the matches endpoint when status=COMPLETED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param start_matching_for_functions_input_body: (required) + :type start_matching_for_functions_input_body: StartMatchingForFunctionsInputBody + :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._start_functions_matching_serialize( + start_matching_for_functions_input_body=start_matching_for_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': "StartMatchingOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_functions_matching_serialize( + self, + start_matching_for_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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if start_matching_for_functions_input_body is not None: + _body_params = start_matching_for_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' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/functions/matches', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api/functions_data_types_api.py b/revengai/api/functions_data_types_api.py index 6a86e21..26cfe38 100644 --- a/revengai/api/functions_data_types_api.py +++ b/revengai/api/functions_data_types_api.py @@ -24,7 +24,10 @@ 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.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -935,7 +938,7 @@ def get_function_data_types( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseFunctionDataTypes: - """Get Function Data Types + """(Deprecated) Get Function Data Types Polling endpoint which returns the current status of function generation and once completed the data type information @@ -964,6 +967,7 @@ def get_function_data_types( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/functions/{function_id}/data_types is deprecated.", DeprecationWarning) _param = self._get_function_data_types_serialize( analysis_id=analysis_id, @@ -1007,7 +1011,7 @@ def get_function_data_types_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseFunctionDataTypes]: - """Get Function Data Types + """(Deprecated) Get Function Data Types Polling endpoint which returns the current status of function generation and once completed the data type information @@ -1036,6 +1040,7 @@ def get_function_data_types_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/functions/{function_id}/data_types is deprecated.", DeprecationWarning) _param = self._get_function_data_types_serialize( analysis_id=analysis_id, @@ -1079,7 +1084,7 @@ 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 Function Data Types + """(Deprecated) Get Function Data Types Polling endpoint which returns the current status of function generation and once completed the data type information @@ -1108,6 +1113,7 @@ def get_function_data_types_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/functions/{function_id}/data_types is deprecated.", DeprecationWarning) _param = self._get_function_data_types_serialize( analysis_id=analysis_id, @@ -1196,6 +1202,601 @@ def _get_function_data_types_serialize( + @validate_call + def get_function_data_types_0( + 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")], + _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, + ) -> DataTypesEntry: + """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 + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_data_types_0_serialize( + analysis_id=analysis_id, + 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': "DataTypesEntry", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_function_data_types_0_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")], + _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[DataTypesEntry]: + """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 + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_data_types_0_serialize( + analysis_id=analysis_id, + 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': "DataTypesEntry", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_function_data_types_0_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")], + _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 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 + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param function_id: Function ID (required) + :type function_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_data_types_0_serialize( + analysis_id=analysis_id, + 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': "DataTypesEntry", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_function_data_types_0_serialize( + self, + analysis_id, + 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 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 + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/functions/{function_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 list_analysis_functions_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, + _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, + ) -> ListAnalysisFunctionsDataTypesOutputBody: + """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 + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_data_types_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsDataTypesOutputBody", + '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 list_analysis_functions_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, + _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[ListAnalysisFunctionsDataTypesOutputBody]: + """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 + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_data_types_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsDataTypesOutputBody", + '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 list_analysis_functions_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, + _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: + """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 + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param offset: Pagination offset. Defaults to 0. + :type offset: int + :param limit: Page size. Defaults to 100. + :type limit: 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._list_analysis_functions_data_types_serialize( + analysis_id=analysis_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysisFunctionsDataTypesOutputBody", + '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 _list_analysis_functions_data_types_serialize( + self, + analysis_id, + offset, + limit, + _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 + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/functions/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 list_function_data_types_for_analysis( self, @@ -1214,7 +1815,7 @@ def list_function_data_types_for_analysis( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseFunctionDataTypesList: - """List Function Data Types + """(Deprecated) List Function Data Types Returns data types for multiple functions with optional function ID filtering @@ -1243,6 +1844,7 @@ 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( analysis_id=analysis_id, @@ -1286,7 +1888,7 @@ def list_function_data_types_for_analysis_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseFunctionDataTypesList]: - """List Function Data Types + """(Deprecated) List Function Data Types Returns data types for multiple functions with optional function ID filtering @@ -1315,6 +1917,7 @@ 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( analysis_id=analysis_id, @@ -1358,7 +1961,7 @@ 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: - """List Function Data Types + """(Deprecated) List Function Data Types Returns data types for multiple functions with optional function ID filtering @@ -1387,6 +1990,7 @@ 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( analysis_id=analysis_id, @@ -1495,7 +2099,7 @@ def list_function_data_types_for_functions( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseFunctionDataTypesList: - """List Function Data Types + """(Deprecated) List Function Data Types Returns data types for multiple function IDs @@ -1522,6 +2126,7 @@ 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( function_ids=function_ids, @@ -1563,7 +2168,7 @@ def list_function_data_types_for_functions_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseFunctionDataTypesList]: - """List Function Data Types + """(Deprecated) List Function Data Types Returns data types for multiple function IDs @@ -1590,6 +2195,7 @@ 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( function_ids=function_ids, @@ -1631,7 +2237,7 @@ 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: - """List Function Data Types + """(Deprecated) List Function Data Types Returns data types for multiple function IDs @@ -1658,6 +2264,7 @@ 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( function_ids=function_ids, @@ -1743,3 +2350,282 @@ def _list_function_data_types_for_functions_serialize( ) + + + @validate_call + def list_functions_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.")], + _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, + ) -> ListFunctionsDataTypesOutputBody: + """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 + + :param function_ids: Function IDs to fetch data-types for. (required) + :type function_ids: List[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._list_functions_data_types_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFunctionsDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_functions_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.")], + _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[ListFunctionsDataTypesOutputBody]: + """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 + + :param function_ids: Function IDs to fetch data-types for. (required) + :type function_ids: List[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._list_functions_data_types_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFunctionsDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_functions_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.")], + _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 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 + + :param function_ids: Function IDs to fetch data-types for. (required) + :type function_ids: List[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._list_functions_data_types_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFunctionsDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_functions_data_types_serialize( + self, + function_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'function_ids': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + 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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions/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 + ) + + diff --git a/revengai/api_client.py b/revengai/api_client.py index 1663cc9..0d16aa6 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.95.1/python' + self.user_agent = 'OpenAPI-Generator/v3.96.2/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 95a9dd1..856ae94 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.95.1\n"\ - "SDK Package Version: v3.95.1".\ + "Version of the API: v3.96.2\n"\ + "SDK Package Version: v3.96.2".\ 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 cc76bba..8a6f93a 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -31,6 +31,7 @@ from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse 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_function_matching_request import AnalysisFunctionMatchingRequest from revengai.models.analysis_functions import AnalysisFunctions @@ -129,6 +130,8 @@ from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities from revengai.models.base_response_xref_response import BaseResponseXrefResponse from revengai.models.basic import Basic +from revengai.models.batch_binary_match_result import BatchBinaryMatchResult +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 @@ -148,11 +151,15 @@ from revengai.models.binary_search_result import BinarySearchResult from revengai.models.binary_task_status import BinaryTaskStatus from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest +from revengai.models.call_edge import CallEdge +from revengai.models.call_edges_output_body import CallEdgesOutputBody from revengai.models.callee_function_info import CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse from revengai.models.caller_function_info import CallerFunctionInfo from revengai.models.capabilities import Capabilities from revengai.models.capabilities_agent_response import CapabilitiesAgentResponse +from revengai.models.capabilities_output_body import CapabilitiesOutputBody +from revengai.models.capability_entry import CapabilityEntry from revengai.models.child_binaries_response import ChildBinariesResponse from revengai.models.code_signature_model import CodeSignatureModel from revengai.models.collection_binaries_update_request import CollectionBinariesUpdateRequest @@ -188,11 +195,13 @@ from revengai.models.create_conversation_request import CreateConversationRequest from revengai.models.create_portal_session_input_body import CreatePortalSessionInputBody from revengai.models.created import Created +from revengai.models.data_types_entry import DataTypesEntry from revengai.models.decomp_failed_event import DecompFailedEvent from revengai.models.decomp_finished_event import DecompFinishedEvent from revengai.models.decompilation_comment_context import DecompilationCommentContext from revengai.models.decompilation_data import DecompilationData from revengai.models.die_match import DieMatch +from revengai.models.disassembly_output_body import DisassemblyOutputBody from revengai.models.dns_query import DnsQuery from revengai.models.drakvuf_file_metadata import DrakvufFileMetadata from revengai.models.dynamic_execution_status import DynamicExecutionStatus @@ -243,16 +252,20 @@ from revengai.models.file_hashes import FileHashes from revengai.models.file_metadata import FileMetadata from revengai.models.filters import Filters +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_details_output_body import FunctionDetailsOutputBody from revengai.models.function_header import FunctionHeader from revengai.models.function_info import FunctionInfo from revengai.models.function_info_func_deps_inner import FunctionInfoFuncDepsInner @@ -270,6 +283,7 @@ from revengai.models.function_search_response import FunctionSearchResponse from revengai.models.function_search_result import FunctionSearchResult 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 @@ -284,6 +298,8 @@ from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody +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 @@ -296,12 +312,16 @@ from revengai.models.import_model import ImportModel from revengai.models.inline_comment import InlineComment from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest +from revengai.models.list_analysis_functions_data_types_output_body import ListAnalysisFunctionsDataTypesOutputBody +from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.models.list_collection_results import ListCollectionResults from revengai.models.list_collections_output_body import ListCollectionsOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody +from revengai.models.list_functions_data_types_output_body import ListFunctionsDataTypesOutputBody from revengai.models.logs import Logs from revengai.models.mitre_technique import MITRETechnique +from revengai.models.match_filters import MatchFilters from revengai.models.matched_function import MatchedFunction from revengai.models.matched_function_suggestion import MatchedFunctionSuggestion from revengai.models.memdump_entry import MemdumpEntry @@ -388,6 +408,10 @@ 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_input import StatusInput from revengai.models.status_output import StatusOutput diff --git a/revengai/models/add_callee_input_body.py b/revengai/models/add_callee_input_body.py index 354c90c..3da2f89 100644 --- a/revengai/models/add_callee_input_body.py +++ b/revengai/models/add_callee_input_body.py @@ -27,7 +27,7 @@ class AddCalleeInputBody(BaseModel): AddCalleeInputBody """ # noqa: E501 callee_function_id: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Internal callee function ID; 0 means not provided") - callee_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="Callee name (for external calls)") + callee_name: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Callee name (for external calls)") callee_vaddr: StrictInt = Field(description="Virtual address of the callee") is_external: StrictBool = Field(description="Whether the callee is outside the binary") thunked_vaddr: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Thunked virtual address") diff --git a/revengai/models/analysis_function_entry.py b/revengai/models/analysis_function_entry.py new file mode 100644 index 0000000..5568a14 --- /dev/null +++ b/revengai/models/analysis_function_entry.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisFunctionEntry(BaseModel): + """ + AnalysisFunctionEntry + """ # noqa: E501 + binary_id: StrictInt + debug: StrictBool + function_id: StrictInt + function_name: StrictStr + function_size: StrictInt + function_vaddr: StrictInt + mangled_name: Optional[StrictStr] = None + source_binary_id: Optional[StrictInt] = None + source_type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binary_id", "debug", "function_id", "function_name", "function_size", "function_vaddr", "mangled_name", "source_binary_id", "source_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnalysisFunctionEntry 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 mangled_name (nullable) is None + # and model_fields_set contains the field + if self.mangled_name is None and "mangled_name" in self.model_fields_set: + _dict['mangled_name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisFunctionEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binary_id": obj.get("binary_id"), + "debug": obj.get("debug"), + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "function_size": obj.get("function_size"), + "function_vaddr": obj.get("function_vaddr"), + "mangled_name": obj.get("mangled_name"), + "source_binary_id": obj.get("source_binary_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_binary_match_result.py b/revengai/models/batch_binary_match_result.py new file mode 100644 index 0000000..a87684a --- /dev/null +++ b/revengai/models/batch_binary_match_result.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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BatchBinaryMatchResult(BaseModel): + """ + BatchBinaryMatchResult + """ # noqa: E501 + binary_id: StrictInt = Field(description="Target binary") + error_message: Optional[StrictStr] = Field(default=None, description="Error description when status=FAILED.") + matched_function_count: StrictInt = Field(description="Number of source functions that received at least one candidate match. Only meaningful when status=COMPLETED.") + status: StrictStr = Field(description="Per-binary workflow status") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binary_id", "error_message", "matched_function_count", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + 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( + 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 BatchBinaryMatchResult 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 BatchBinaryMatchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binary_id": obj.get("binary_id"), + "error_message": obj.get("error_message"), + "matched_function_count": obj.get("matched_function_count"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_matching_output_body.py b/revengai/models/batch_matching_output_body.py new file mode 100644 index 0000000..60af530 --- /dev/null +++ b/revengai/models/batch_matching_output_body.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 revengai.models.batch_binary_match_result import BatchBinaryMatchResult +from typing import Optional, Set +from typing_extensions import Self + +class BatchMatchingOutputBody(BaseModel): + """ + BatchMatchingOutputBody + """ # noqa: E501 + per_binary: Optional[List[BatchBinaryMatchResult]] = Field(description="Per-binary status (order matches the request).") + status: StrictStr = Field(description="Aggregate status across the batch: COMPLETED when every binary is completed, FAILED if any failed, RUNNING/PENDING otherwise.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["per_binary", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + 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( + 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 BatchMatchingOutputBody 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 per_binary (list) + _items = [] + if self.per_binary: + for _item_per_binary in self.per_binary: + if _item_per_binary: + _items.append(_item_per_binary.to_dict()) + _dict['per_binary'] = _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 per_binary (nullable) is None + # and model_fields_set contains the field + if self.per_binary is None and "per_binary" in self.model_fields_set: + _dict['per_binary'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchMatchingOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "per_binary": [BatchBinaryMatchResult.from_dict(_item) for _item in obj["per_binary"]] if obj.get("per_binary") is not None else None, + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_rename_item.py b/revengai/models/batch_rename_item.py index 2abf120..8abbe45 100644 --- a/revengai/models/batch_rename_item.py +++ b/revengai/models/batch_rename_item.py @@ -27,8 +27,8 @@ class BatchRenameItem(BaseModel): BatchRenameItem """ # noqa: E501 function_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Function ID to rename") - new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="New mangled function name") - new_name: Annotated[str, Field(min_length=1, strict=True, max_length=512)] = Field(description="New function name") + new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="New mangled function name") + new_name: Annotated[str, Field(min_length=1, strict=True, max_length=1024)] = Field(description="New function name") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["function_id", "new_mangled_name", "new_name"] diff --git a/revengai/models/call_edge.py b/revengai/models/call_edge.py new file mode 100644 index 0000000..984f60a --- /dev/null +++ b/revengai/models/call_edge.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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CallEdge(BaseModel): + """ + CallEdge + """ # noqa: E501 + callee_function_id: Optional[StrictInt] = None + callee_name: Optional[StrictStr] = None + callee_vaddr: StrictInt + caller_function_id: StrictInt + caller_name: Optional[StrictStr] = None + caller_vaddr: StrictInt = Field(description="Entry vaddr of the caller function (joined from function_t).") + is_external: StrictBool + thunked_vaddr: Optional[StrictInt] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["callee_function_id", "callee_name", "callee_vaddr", "caller_function_id", "caller_name", "caller_vaddr", "is_external", "thunked_vaddr"] + + 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 CallEdge 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 CallEdge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callee_function_id": obj.get("callee_function_id"), + "callee_name": obj.get("callee_name"), + "callee_vaddr": obj.get("callee_vaddr"), + "caller_function_id": obj.get("caller_function_id"), + "caller_name": obj.get("caller_name"), + "caller_vaddr": obj.get("caller_vaddr"), + "is_external": obj.get("is_external"), + "thunked_vaddr": obj.get("thunked_vaddr") + }) + # 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/call_edges_output_body.py b/revengai/models/call_edges_output_body.py new file mode 100644 index 0000000..9d6ca20 --- /dev/null +++ b/revengai/models/call_edges_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 +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_call_edges import FunctionCallEdges +from typing import Optional, Set +from typing_extensions import Self + +class CallEdgesOutputBody(BaseModel): + """ + CallEdgesOutputBody + """ # noqa: E501 + edges: Optional[List[FunctionCallEdges]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["edges"] + + 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 CallEdgesOutputBody 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 edges (list) + _items = [] + if self.edges: + for _item_edges in self.edges: + if _item_edges: + _items.append(_item_edges.to_dict()) + _dict['edges'] = _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 edges (nullable) is None + # and model_fields_set contains the field + if self.edges is None and "edges" in self.model_fields_set: + _dict['edges'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CallEdgesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "edges": [FunctionCallEdges.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") 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/capabilities_output_body.py b/revengai/models/capabilities_output_body.py new file mode 100644 index 0000000..7eb2bf4 --- /dev/null +++ b/revengai/models/capabilities_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 +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.capability_entry import CapabilityEntry +from typing import Optional, Set +from typing_extensions import Self + +class CapabilitiesOutputBody(BaseModel): + """ + CapabilitiesOutputBody + """ # noqa: E501 + capabilities: Optional[List[CapabilityEntry]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["capabilities"] + + 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 CapabilitiesOutputBody 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 capabilities (list) + _items = [] + if self.capabilities: + for _item_capabilities in self.capabilities: + if _item_capabilities: + _items.append(_item_capabilities.to_dict()) + _dict['capabilities'] = _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 capabilities (nullable) is None + # and model_fields_set contains the field + if self.capabilities is None and "capabilities" in self.model_fields_set: + _dict['capabilities'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapabilitiesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capabilities": [CapabilityEntry.from_dict(_item) for _item in obj["capabilities"]] if obj.get("capabilities") 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/capability_entry.py b/revengai/models/capability_entry.py new file mode 100644 index 0000000..dd282f9 --- /dev/null +++ b/revengai/models/capability_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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CapabilityEntry(BaseModel): + """ + CapabilityEntry + """ # noqa: E501 + capability: StrictStr + description: StrictStr + function_id: StrictInt + function_name: StrictStr + type: StrictStr + vaddr: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["capability", "description", "function_id", "function_name", "type", "vaddr"] + + 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 CapabilityEntry 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 CapabilityEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capability": obj.get("capability"), + "description": obj.get("description"), + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "type": obj.get("type"), + "vaddr": obj.get("vaddr") + }) + # 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_types_entry.py b/revengai/models/data_types_entry.py new file mode 100644 index 0000000..aeb1336 --- /dev/null +++ b/revengai/models/data_types_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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_info import FunctionInfo +from typing import Optional, Set +from typing_extensions import Self + +class DataTypesEntry(BaseModel): + """ + DataTypesEntry + """ # noqa: E501 + data_types: Optional[FunctionInfo] = None + function_id: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "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 DataTypesEntry 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 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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DataTypesEntry 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": FunctionInfo.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, + "function_id": obj.get("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/disassembly_output_body.py b/revengai/models/disassembly_output_body.py new file mode 100644 index 0000000..5ceeb66 --- /dev/null +++ b/revengai/models/disassembly_output_body.py @@ -0,0 +1,129 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DisassemblyOutputBody(BaseModel): + """ + DisassemblyOutputBody + """ # noqa: E501 + basic_blocks: Optional[Any] = None + function_id: StrictInt + 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"] + + 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 DisassemblyOutputBody 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 basic_blocks (nullable) is None + # and model_fields_set contains the field + if self.basic_blocks is None and "basic_blocks" in self.model_fields_set: + _dict['basic_blocks'] = 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: + _dict['local_variables'] = None + + # set to None if params (nullable) is None + # and model_fields_set contains the field + if self.params is None and "params" in self.model_fields_set: + _dict['params'] = None + + # set to None if return_type (nullable) is None + # and model_fields_set contains the field + if self.return_type is None and "return_type" in self.model_fields_set: + _dict['return_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DisassemblyOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "basic_blocks": obj.get("basic_blocks"), + "function_id": obj.get("function_id"), + "local_variables": obj.get("local_variables"), + "params": obj.get("params"), + "return_type": obj.get("return_type"), + "returns": obj.get("returns") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/error_body.py b/revengai/models/error_body.py index caf95ed..6b627eb 100644 --- a/revengai/models/error_body.py +++ b/revengai/models/error_body.py @@ -36,8 +36,8 @@ class ErrorBody(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in set(['ACCESS_DENIED', 'AGENT_BUDGET_EXCEEDED', 'AGENT_DEFINITION_NOT_FOUND', 'AGENT_INVALID_STARTING_INPUT', 'AGENT_MEMORY_INVALID_SCOPE', 'AGENT_MEMORY_NOT_FOUND', 'AGENT_MEMORY_VERSION_CONFLICT', 'AGENT_NO_PENDING_QUESTION', 'AGENT_RUN_NOT_FOUND', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'GROUP_HAS_MEMBERS', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_INVITE_CODE', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REPORT_RENDER_FAILED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND', 'unknown_default_open_api']): - raise ValueError("must be one of enum values ('ACCESS_DENIED', 'AGENT_BUDGET_EXCEEDED', 'AGENT_DEFINITION_NOT_FOUND', 'AGENT_INVALID_STARTING_INPUT', 'AGENT_MEMORY_INVALID_SCOPE', 'AGENT_MEMORY_NOT_FOUND', 'AGENT_MEMORY_VERSION_CONFLICT', 'AGENT_NO_PENDING_QUESTION', 'AGENT_RUN_NOT_FOUND', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'GROUP_HAS_MEMBERS', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_INVITE_CODE', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REPORT_RENDER_FAILED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND', 'unknown_default_open_api')") + if value not in set(['ACCESS_DENIED', 'AGENT_BUDGET_EXCEEDED', 'AGENT_DEFINITION_NOT_FOUND', 'AGENT_INVALID_STARTING_INPUT', 'AGENT_MEMORY_INVALID_SCOPE', 'AGENT_MEMORY_NOT_FOUND', 'AGENT_MEMORY_VERSION_CONFLICT', 'AGENT_NO_PENDING_QUESTION', 'AGENT_RUN_NOT_FOUND', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CLIENT_CLOSED_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'GROUP_HAS_MEMBERS', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_INVITE_CODE', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REPORT_RENDER_FAILED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('ACCESS_DENIED', 'AGENT_BUDGET_EXCEEDED', 'AGENT_DEFINITION_NOT_FOUND', 'AGENT_INVALID_STARTING_INPUT', 'AGENT_MEMORY_INVALID_SCOPE', 'AGENT_MEMORY_NOT_FOUND', 'AGENT_MEMORY_VERSION_CONFLICT', 'AGENT_NO_PENDING_QUESTION', 'AGENT_RUN_NOT_FOUND', 'ALREADY_EXISTS', 'ANALYSIS_NOT_READY', 'BAD_REQUEST', 'CLIENT_CLOSED_REQUEST', 'CONFLICT', 'CONVERSATION_NOT_FOUND', 'DOMAIN_ALREADY_CLAIMED', 'DOMAIN_VERIFICATION_PENDING', 'DYNAMIC_EXECUTION_INCOMPLETE', 'EMAIL_NOT_VERIFIED', 'EXTERNAL_USER', 'FORBIDDEN', 'GATEWAY_TIMEOUT', 'GROUP_HAS_MEMBERS', 'INSUFFICIENT_CREDITS', 'INTERNAL_ERROR', 'INTERNAL_ISSUER', 'INVALID_CONVERSATION_ID', 'INVALID_CREDENTIALS', 'INVALID_INVITE_CODE', 'INVALID_RESET_CODE', 'LAST_ORG_OWNER', 'LINKED_TO_ORG', 'METHOD_NOT_ALLOWED', 'NOT_ACCEPTABLE', 'NOT_FOUND', 'NO_ACTIVE_RUN', 'NO_PENDING_CONFIRMATION', 'OIDC_DISCOVERY_FAILED', 'PASSWORD_RESET_REQUIRED', 'PAYMENT_REQUIRED', 'REPORT_RENDER_FAILED', 'REQUEST_ENTITY_TOO_LARGE', 'RUN_ALREADY_ACTIVE', 'SELF_DELETION_NOT_ALLOWED', 'SERVICE_UNAVAILABLE', 'TOKEN_EXPIRED', 'TOKEN_REUSED', 'TOO_MANY_REQUESTS', 'UNAUTHORIZED', 'UNSUPPORTED_MEDIA_TYPE', 'VALIDATION_FAILED', 'VERIFICATION_EXPIRED', 'VERIFICATION_NOT_FOUND', 'unknown_default_open_api')") return value model_config = ConfigDict( diff --git a/revengai/models/function_argument.py b/revengai/models/function_argument.py new file mode 100644 index 0000000..d5da28e --- /dev/null +++ b/revengai/models/function_argument.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FunctionArgument(BaseModel): + """ + FunctionArgument + """ # noqa: E501 + last_change: Optional[StrictStr] = None + name: Optional[StrictStr] + offset: StrictInt + scope: Optional[StrictStr] = None + size: StrictInt + type: Optional[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["last_change", "name", "offset", "scope", "size", "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 FunctionArgument 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 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 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 scope (nullable) is None + # and model_fields_set contains the field + if self.scope is None and "scope" in self.model_fields_set: + _dict['scope'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionArgument 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"), + "scope": obj.get("scope"), + "size": obj.get("size"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_call_edges.py b/revengai/models/function_call_edges.py new file mode 100644 index 0000000..c300eec --- /dev/null +++ b/revengai/models/function_call_edges.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.call_edge import CallEdge +from typing import Optional, Set +from typing_extensions import Self + +class FunctionCallEdges(BaseModel): + """ + FunctionCallEdges + """ # noqa: E501 + callees: Optional[List[CallEdge]] + callers: Optional[List[CallEdge]] + function_id: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["callees", "callers", "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 FunctionCallEdges 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 callees (list) + _items = [] + if self.callees: + for _item_callees in self.callees: + if _item_callees: + _items.append(_item_callees.to_dict()) + _dict['callees'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in callers (list) + _items = [] + if self.callers: + for _item_callers in self.callers: + if _item_callers: + _items.append(_item_callers.to_dict()) + _dict['callers'] = _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 callees (nullable) is None + # and model_fields_set contains the field + if self.callees is None and "callees" in self.model_fields_set: + _dict['callees'] = None + + # set to None if callers (nullable) is None + # and model_fields_set contains the field + if self.callers is None and "callers" in self.model_fields_set: + _dict['callers'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionCallEdges from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callees": [CallEdge.from_dict(_item) for _item in obj["callees"]] if obj.get("callees") is not None else None, + "callers": [CallEdge.from_dict(_item) for _item in obj["callers"]] if obj.get("callers") is not None else None, + "function_id": obj.get("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/function_dependency.py b/revengai/models/function_dependency.py new file mode 100644 index 0000000..f396d55 --- /dev/null +++ b/revengai/models/function_dependency.py @@ -0,0 +1,133 @@ +# 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 FunctionDependency(BaseModel): + """ + FunctionDependency + """ # 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: Optional[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).") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["addr", "artifact_type", "last_change", "members", "name", "scope", "size", "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 FunctionDependency 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 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 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 + + # 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 scope (nullable) is None + # and model_fields_set contains the field + if self.scope is None and "scope" in self.model_fields_set: + _dict['scope'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionDependency from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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"), + "name": obj.get("name"), + "scope": obj.get("scope"), + "size": obj.get("size"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_details_output_body.py b/revengai/models/function_details_output_body.py new file mode 100644 index 0000000..e9f78e3 --- /dev/null +++ b/revengai/models/function_details_output_body.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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FunctionDetailsOutputBody(BaseModel): + """ + FunctionDetailsOutputBody + """ # noqa: E501 + binary_id: StrictInt + creation: datetime + debug: StrictBool + function_id: StrictInt + function_name: StrictStr + function_size: StrictInt + function_vaddr: StrictInt + mangled_name: Optional[StrictStr] = None + source_function_id: Optional[StrictInt] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binary_id", "creation", "debug", "function_id", "function_name", "function_size", "function_vaddr", "mangled_name", "source_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 FunctionDetailsOutputBody 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 FunctionDetailsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binary_id": obj.get("binary_id"), + "creation": obj.get("creation"), + "debug": obj.get("debug"), + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "function_size": obj.get("function_size"), + "function_vaddr": obj.get("function_vaddr"), + "mangled_name": obj.get("mangled_name"), + "source_function_id": obj.get("source_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/function_stack_variable.py b/revengai/models/function_stack_variable.py new file mode 100644 index 0000000..dbfe824 --- /dev/null +++ b/revengai/models/function_stack_variable.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FunctionStackVariable(BaseModel): + """ + FunctionStackVariable + """ # noqa: E501 + addr: StrictInt + last_change: Optional[StrictStr] = None + name: Optional[StrictStr] + offset: StrictInt + scope: Optional[StrictStr] = None + size: StrictInt + type: Optional[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["addr", "last_change", "name", "offset", "scope", "size", "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 FunctionStackVariable 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 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 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 scope (nullable) is None + # and model_fields_set contains the field + if self.scope is None and "scope" in self.model_fields_set: + _dict['scope'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionStackVariable from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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") + }) + # 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_matches_output_body.py b/revengai/models/get_matches_output_body.py new file mode 100644 index 0000000..83dfc06 --- /dev/null +++ b/revengai/models/get_matches_output_body.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 revengai.models.function_match import FunctionMatch +from typing import Optional, Set +from typing_extensions import Self + +class GetMatchesOutputBody(BaseModel): + """ + GetMatchesOutputBody + """ # noqa: E501 + matches: Optional[List[FunctionMatch]] = Field(default=None, description="Per-source-function matches. Populated when status=COMPLETED; empty otherwise.") + status: StrictStr = Field(description="Current workflow status") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["matches", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + 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( + 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 GetMatchesOutputBody 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 matches (list) + _items = [] + if self.matches: + for _item_matches in self.matches: + if _item_matches: + _items.append(_item_matches.to_dict()) + _dict['matches'] = _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 matches (nullable) is None + # and model_fields_set contains the field + if self.matches is None and "matches" in self.model_fields_set: + _dict['matches'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetMatchesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "matches": [FunctionMatch.from_dict(_item) for _item in obj["matches"]] if obj.get("matches") is not None else None, + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/get_matches_status_output_body.py b/revengai/models/get_matches_status_output_body.py new file mode 100644 index 0000000..aa0dde3 --- /dev/null +++ b/revengai/models/get_matches_status_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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.progress_message import ProgressMessage +from typing import Optional, Set +from typing_extensions import Self + +class GetMatchesStatusOutputBody(BaseModel): + """ + GetMatchesStatusOutputBody + """ # noqa: E501 + messages: Optional[List[ProgressMessage]] = Field(description="Log messages emitted during execution") + status: StrictStr = Field(description="Current workflow status") + step: StrictStr = Field(description="Name of the current step") + step_index: StrictInt = Field(description="Zero-based index of the current step") + steps_total: StrictInt = Field(description="Total number of steps in the workflow") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["messages", "status", "step", "step_index", "steps_total"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED', '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( + 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 GetMatchesStatusOutputBody 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 messages (list) + _items = [] + if self.messages: + for _item_messages in self.messages: + if _item_messages: + _items.append(_item_messages.to_dict()) + _dict['messages'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if messages (nullable) is None + # and model_fields_set contains the field + if self.messages is None and "messages" in self.model_fields_set: + _dict['messages'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetMatchesStatusOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "messages": [ProgressMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None, + "status": obj.get("status"), + "step": obj.get("step"), + "step_index": obj.get("step_index"), + "steps_total": obj.get("steps_total") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/list_analysis_functions_data_types_output_body.py b/revengai/models/list_analysis_functions_data_types_output_body.py new file mode 100644 index 0000000..3c36453 --- /dev/null +++ b/revengai/models/list_analysis_functions_data_types_output_body.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_types_entry import DataTypesEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListAnalysisFunctionsDataTypesOutputBody(BaseModel): + """ + ListAnalysisFunctionsDataTypesOutputBody + """ # noqa: E501 + items: Optional[List[DataTypesEntry]] + total_count: StrictInt = Field(description="Total functions in the analysis, ignoring pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["items", "total_count"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListAnalysisFunctionsDataTypesOutputBody 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 + + # 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 ListAnalysisFunctionsDataTypesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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, + "total_count": obj.get("total_count") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/list_analysis_functions_output_body.py b/revengai/models/list_analysis_functions_output_body.py new file mode 100644 index 0000000..fbd41c4 --- /dev/null +++ b/revengai/models/list_analysis_functions_output_body.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.analysis_function_entry import AnalysisFunctionEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListAnalysisFunctionsOutputBody(BaseModel): + """ + ListAnalysisFunctionsOutputBody + """ # noqa: E501 + functions: Optional[List[AnalysisFunctionEntry]] + total_count: StrictInt = Field(description="Total functions in the analysis, ignoring pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["functions", "total_count"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListAnalysisFunctionsOutputBody 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 functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if functions (nullable) is None + # and model_fields_set contains the field + if self.functions is None and "functions" in self.model_fields_set: + _dict['functions'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListAnalysisFunctionsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [AnalysisFunctionEntry.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "total_count": obj.get("total_count") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/list_functions_data_types_output_body.py b/revengai/models/list_functions_data_types_output_body.py new file mode 100644 index 0000000..8e5b57e --- /dev/null +++ b/revengai/models/list_functions_data_types_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 +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.data_types_entry import DataTypesEntry +from typing import Optional, Set +from typing_extensions import Self + +class ListFunctionsDataTypesOutputBody(BaseModel): + """ + ListFunctionsDataTypesOutputBody + """ # noqa: E501 + items: Optional[List[DataTypesEntry]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["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 ListFunctionsDataTypesOutputBody 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 + + # 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 ListFunctionsDataTypesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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 + }) + # 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 new file mode 100644 index 0000000..1ce6432 --- /dev/null +++ b/revengai/models/match_filters.py @@ -0,0 +1,132 @@ +# 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 MatchFilters(BaseModel): + """ + MatchFilters + """ # noqa: E501 + binary_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to these binary IDs.") + 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.") + function_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to these function IDs.") + 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]] = ["binary_ids", "collection_ids", "debug_types", "function_ids", "user_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 MatchFilters 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 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: + _dict['binary_ids'] = None + + # set to None if collection_ids (nullable) is None + # and model_fields_set contains the field + if self.collection_ids is None and "collection_ids" in self.model_fields_set: + _dict['collection_ids'] = None + + # set to None if debug_types (nullable) is None + # and model_fields_set contains the field + if self.debug_types is None and "debug_types" in self.model_fields_set: + _dict['debug_types'] = None + + # set to None if function_ids (nullable) is None + # and model_fields_set contains the field + if self.function_ids is None and "function_ids" in self.model_fields_set: + _dict['function_ids'] = 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: + _dict['user_ids'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchFilters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binary_ids": obj.get("binary_ids"), + "collection_ids": obj.get("collection_ids"), + "debug_types": obj.get("debug_types"), + "function_ids": obj.get("function_ids"), + "user_ids": obj.get("user_ids") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/rename_input_body.py b/revengai/models/rename_input_body.py index 67e9a72..3a820c7 100644 --- a/revengai/models/rename_input_body.py +++ b/revengai/models/rename_input_body.py @@ -26,8 +26,8 @@ class RenameInputBody(BaseModel): """ RenameInputBody """ # noqa: E501 - new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(default=None, description="New mangled function name") - new_name: Annotated[str, Field(min_length=1, strict=True, max_length=512)] = Field(description="New function name") + new_mangled_name: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="New mangled function name") + new_name: Annotated[str, Field(min_length=1, strict=True, max_length=1024)] = Field(description="New function name") preserve_ai_decompilation: Optional[StrictBool] = Field(default=None, description="Keep the cached AI decompilation, summary and inline comments. Set when the new name comes from the model's own prediction (e.g. Transfer Name) so existing AI output is not discarded and regenerated.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["new_mangled_name", "new_name", "preserve_ai_decompilation"] diff --git a/revengai/models/start_batch_matching_input_body.py b/revengai/models/start_batch_matching_input_body.py new file mode 100644 index 0000000..7ca717f --- /dev/null +++ b/revengai/models/start_batch_matching_input_body.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 +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class StartBatchMatchingInputBody(BaseModel): + """ + StartBatchMatchingInputBody + """ # noqa: E501 + binary_ids: Optional[Annotated[List[StrictInt], Field(min_length=1)]] = Field(description="Binary IDs to match the analysis against, one workflow per binary.") + debug_types: Optional[List[Optional[StrictStr]]] = Field(default=None, description="Restrict matches to candidates with these debug source types. Defaults to [\"SYSTEM\"].") + min_similarity: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Similarity floor as a percentage. Defaults to 90.") + results_per_function: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Max matches returned per source function. Defaults to 1.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binary_ids", "debug_types", "min_similarity", "results_per_function"] + + 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 StartBatchMatchingInputBody 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 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: + _dict['binary_ids'] = None + + # set to None if debug_types (nullable) is None + # and model_fields_set contains the field + if self.debug_types is None and "debug_types" in self.model_fields_set: + _dict['debug_types'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StartBatchMatchingInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binary_ids": obj.get("binary_ids"), + "debug_types": obj.get("debug_types"), + "min_similarity": obj.get("min_similarity"), + "results_per_function": obj.get("results_per_function") + }) + # 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/start_matching_for_analysis_input_body.py b/revengai/models/start_matching_for_analysis_input_body.py new file mode 100644 index 0000000..cb98e22 --- /dev/null +++ b/revengai/models/start_matching_for_analysis_input_body.py @@ -0,0 +1,108 @@ +# 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, Union +from typing_extensions import Annotated +from revengai.models.match_filters import MatchFilters +from typing import Optional, Set +from typing_extensions import Self + +class StartMatchingForAnalysisInputBody(BaseModel): + """ + StartMatchingForAnalysisInputBody + """ # noqa: E501 + filters: Optional[MatchFilters] = Field(default=None, description="Narrow the candidate pool.") + min_similarity: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Similarity floor as a percentage. Defaults to 90.") + results_per_function: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Max matches returned per source function. Defaults to 1.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["filters", "min_similarity", "results_per_function"] + + 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 StartMatchingForAnalysisInputBody 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 filters + if self.filters: + _dict['filters'] = self.filters.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 StartMatchingForAnalysisInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": MatchFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None, + "min_similarity": obj.get("min_similarity"), + "results_per_function": obj.get("results_per_function") + }) + # 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/start_matching_for_functions_input_body.py b/revengai/models/start_matching_for_functions_input_body.py new file mode 100644 index 0000000..9fc1936 --- /dev/null +++ b/revengai/models/start_matching_for_functions_input_body.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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from revengai.models.match_filters import MatchFilters +from typing import Optional, Set +from typing_extensions import Self + +class StartMatchingForFunctionsInputBody(BaseModel): + """ + StartMatchingForFunctionsInputBody + """ # noqa: E501 + filters: Optional[MatchFilters] = Field(default=None, description="Narrow the candidate pool.") + function_ids: Optional[Annotated[List[StrictInt], Field(min_length=1)]] = Field(description="Source function IDs to match against the rest of the corpus.") + min_similarity: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Similarity floor as a percentage. Defaults to 90.") + results_per_function: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Max matches returned per source function. Defaults to 1.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["filters", "function_ids", "min_similarity", "results_per_function"] + + 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 StartMatchingForFunctionsInputBody 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 filters + if self.filters: + _dict['filters'] = self.filters.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 function_ids (nullable) is None + # and model_fields_set contains the field + if self.function_ids is None and "function_ids" in self.model_fields_set: + _dict['function_ids'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StartMatchingForFunctionsInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": MatchFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None, + "function_ids": obj.get("function_ids"), + "min_similarity": obj.get("min_similarity"), + "results_per_function": obj.get("results_per_function") + }) + # 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/start_matching_output_body.py b/revengai/models/start_matching_output_body.py new file mode 100644 index 0000000..3d5b18c --- /dev/null +++ b/revengai/models/start_matching_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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.progress_message import ProgressMessage +from typing import Optional, Set +from typing_extensions import Self + +class StartMatchingOutputBody(BaseModel): + """ + StartMatchingOutputBody + """ # noqa: E501 + messages: Optional[List[ProgressMessage]] = Field(description="Log messages emitted during execution") + status: StrictStr = Field(description="Current workflow status") + step: StrictStr = Field(description="Name of the current step") + step_index: StrictInt = Field(description="Zero-based index of the current step") + steps_total: StrictInt = Field(description="Total number of steps in the workflow") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["messages", "status", "step", "step_index", "steps_total"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UNINITIALISED', 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED', '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( + 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 StartMatchingOutputBody 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 messages (list) + _items = [] + if self.messages: + for _item_messages in self.messages: + if _item_messages: + _items.append(_item_messages.to_dict()) + _dict['messages'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if messages (nullable) is None + # and model_fields_set contains the field + if self.messages is None and "messages" in self.model_fields_set: + _dict['messages'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StartMatchingOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "messages": [ProgressMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None, + "status": obj.get("status"), + "step": obj.get("step"), + "step_index": obj.get("step_index"), + "steps_total": obj.get("steps_total") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + +