diff --git a/.sdk-version b/.sdk-version index 4fc4729..18ef788 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v4.54.0 +v4.60.1 diff --git a/README.md b/README.md index e080712..328893b 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *AgentApi* | [**v3_upsert_binary_agent_feedback**](docs/AgentApi.md#v3_upsert_binary_agent_feedback) | **PUT** /v3/analyses/{analysis_id}/agents/{agent}/feedback | Record feedback on an agent's output. *AnalysesBulkActionsApi* | [**bulk_add_analysis_tags**](docs/AnalysesBulkActionsApi.md#bulk_add_analysis_tags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags *AnalysesBulkActionsApi* | [**bulk_delete_analyses**](docs/AnalysesBulkActionsApi.md#bulk_delete_analyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses +*AnalysesBulkActionsApi* | [**v3_batch_add_analysis_tags**](docs/AnalysesBulkActionsApi.md#v3_batch_add_analysis_tags) | **POST** /v3/analyses:batchAddTags | Add tags to multiple analyses. *AnalysesBulkActionsApi* | [**v3_batch_delete_analyses**](docs/AnalysesBulkActionsApi.md#v3_batch_delete_analyses) | **POST** /v3/analyses:batchDelete | Delete multiple analyses. *AnalysesCommentsApi* | [**create_analysis_comment**](docs/AnalysesCommentsApi.md#create_analysis_comment) | **POST** /v2/analyses/{analysis_id}/comments | Create a comment for this analysis *AnalysesCommentsApi* | [**delete_analysis_comment**](docs/AnalysesCommentsApi.md#delete_analysis_comment) | **DELETE** /v2/analyses/{analysis_id}/comments/{comment_id} | Delete a comment @@ -141,13 +142,17 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**v3_list_example_analyses**](docs/AnalysesCoreApi.md#v3_list_example_analyses) | **GET** /v3/analyses/examples | List example analyses *AnalysesCoreApi* | [**v3_lookup_analysis_by_binary_id**](docs/AnalysesCoreApi.md#v3_lookup_analysis_by_binary_id) | **GET** /v3/analyses/lookup/{binary_id} | Look up the most recent analysis for a binary. *AnalysesCoreApi* | [**v3_queue_binary_export**](docs/AnalysesCoreApi.md#v3_queue_binary_export) | **POST** /v3/analyses/{analysis_id}/binary-export | Queue a binary export +*AnalysesCoreApi* | [**v3_search_tags**](docs/AnalysesCoreApi.md#v3_search_tags) | **GET** /v3/tags | Search tags *AnalysesCoreApi* | [**v3_update_analysis**](docs/AnalysesCoreApi.md#v3_update_analysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. +*AnalysesCoreApi* | [**v3_update_analysis_tags**](docs/AnalysesCoreApi.md#v3_update_analysis_tags) | **PATCH** /v3/analyses/{analysis_id}/tags | Replace an analysis' tags. *AnalysesCoreApi* | [**v3_upgrade_analysis_model**](docs/AnalysesCoreApi.md#v3_upgrade_analysis_model) | **POST** /v3/analyses/{analysis_id}/upgrade-model | Re-analyse on the latest model *AnalysesResultsMetadataApi* | [**get_analysis_functions_paginated**](docs/AnalysesResultsMetadataApi.md#get_analysis_functions_paginated) | **GET** /v2/analyses/{analysis_id}/functions | Get functions from analysis *AnalysesResultsMetadataApi* | [**get_capabilities**](docs/AnalysesResultsMetadataApi.md#get_capabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis *AnalysesResultsMetadataApi* | [**get_functions_list**](docs/AnalysesResultsMetadataApi.md#get_functions_list) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis *AnalysesResultsMetadataApi* | [**get_tags**](docs/AnalysesResultsMetadataApi.md#get_tags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score +*AnalysesResultsMetadataApi* | [**v3_get_analysis_xref**](docs/AnalysesResultsMetadataApi.md#v3_get_analysis_xref) | **GET** /v3/analyses/{analysis_id}/xrefs/{vaddr} | Look up xrefs by virtual address. *AnalysesResultsMetadataApi* | [**v3_list_analysis_capabilities**](docs/AnalysesResultsMetadataApi.md#v3_list_analysis_capabilities) | **GET** /v3/analyses/{analysis_id}/capabilities | List the capabilities found in an analysis. +*AnalysesResultsMetadataApi* | [**v3_list_analysis_tags**](docs/AnalysesResultsMetadataApi.md#v3_list_analysis_tags) | **GET** /v3/analyses/{analysis_id}/tags | List the tags on an analysis. *AnalysesXRefsApi* | [**get_xref_by_vaddr**](docs/AnalysesXRefsApi.md#get_xref_by_vaddr) | **GET** /v2/analyses/{analysis_id}/xrefs/{vaddr} | [Beta] Look up xrefs by virtual address *AuthenticationUsersApi* | [**get_user**](docs/AuthenticationUsersApi.md#get_user) | **GET** /v2/users/{user_id} | Get a user's public information *AuthenticationUsersApi* | [**get_user_activity**](docs/AuthenticationUsersApi.md#get_user_activity) | **GET** /v2/users/activity | Get auth user activity @@ -162,9 +167,12 @@ Class | Method | HTTP request | Description *BinariesApi* | [**get_binary_externals**](docs/BinariesApi.md#get_binary_externals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary *BinariesApi* | [**get_binary_related_status**](docs/BinariesApi.md#get_binary_related_status) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary *BinariesApi* | [**get_related_binaries**](docs/BinariesApi.md#get_related_binaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. +*BinariesApi* | [**v3_download_binary_zipped**](docs/BinariesApi.md#v3_download_binary_zipped) | **GET** /v3/binaries/{binary_id}/download-zipped | Download a binary as a password-protected zip. *BinariesApi* | [**v3_get_binary_die_info**](docs/BinariesApi.md#v3_get_binary_die_info) | **GET** /v3/binaries/{binary_id}/die-info | Get Detect It Easy matches for a binary. +*BinariesApi* | [**v3_get_binary_externals**](docs/BinariesApi.md#v3_get_binary_externals) | **GET** /v3/binaries/{binary_id}/externals | Get third-party threat-intel lookups for a binary. *BinariesApi* | [**v3_get_binary_related**](docs/BinariesApi.md#v3_get_binary_related) | **GET** /v3/binaries/{binary_id}/related | Get the binaries related to this one by unpacking. *BinariesApi* | [**v3_get_binary_related_status**](docs/BinariesApi.md#v3_get_binary_related_status) | **GET** /v3/binaries/{binary_id}/related/status | Get the archive-unpacking status for a binary. +*BinariesApi* | [**v3_search_binaries**](docs/BinariesApi.md#v3_search_binaries) | **GET** /v3/binaries | Search binaries *BinariesApi* | [**v3_upload_file**](docs/BinariesApi.md#v3_upload_file) | **POST** /v3/upload | Upload a file. *CollectionsApi* | [**create_collection**](docs/CollectionsApi.md#create_collection) | **POST** /v2/collections | Creates new collection information *CollectionsApi* | [**delete_collection**](docs/CollectionsApi.md#delete_collection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection @@ -220,6 +228,7 @@ Class | Method | HTTP request | Description *FunctionsAIDecompilationApi* | [**regenerate_ai_decompilation_summary**](docs/FunctionsAIDecompilationApi.md#regenerate_ai_decompilation_summary) | **POST** /v3/functions/{function_id}/ai-decompilation/summary | Regenerate AI decompilation summary *FunctionsAIDecompilationApi* | [**stream_ai_decompilation**](docs/FunctionsAIDecompilationApi.md#stream_ai_decompilation) | **GET** /v3/functions/{function_id}/ai-decompilation/events | Stream live AI decompilation output (SSE) *FunctionsAIDecompilationApi* | [**upsert_ai_decompilation_rating**](docs/FunctionsAIDecompilationApi.md#upsert_ai_decompilation_rating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation +*FunctionsAIDecompilationApi* | [**v3_accept_ai_decompilation_type_suggestions**](docs/FunctionsAIDecompilationApi.md#v3_accept_ai_decompilation_type_suggestions) | **POST** /v3/functions/{function_id}/ai-decompilation/type-suggestions/accept | Accept AI decompilation type suggestions *FunctionsAIDecompilationApi* | [**v3_get_ai_decompilation_line_attributions**](docs/FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_line_attributions) | **GET** /v3/functions/{function_id}/ai-decompilation/line-attributions | Get AI decompilation line attributions *FunctionsAIDecompilationApi* | [**v3_get_ai_decompilation_tokens**](docs/FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_tokens) | **GET** /v3/functions/{function_id}/ai-decompilation/tokens | Get AI decompilation tokens and user overrides *FunctionsAIDecompilationApi* | [**v3_get_ai_decompilation_type_suggestions**](docs/FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_type_suggestions) | **GET** /v3/functions/{function_id}/ai-decompilation/type-suggestions | Get AI decompilation type suggestions @@ -248,6 +257,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**list_imported_functions**](docs/FunctionsCoreApi.md#list_imported_functions) | **GET** /v3/analyses/{analysis_id}/imported-functions | List imported functions in an analysis *FunctionsCoreApi* | [**start_functions_matching**](docs/FunctionsCoreApi.md#start_functions_matching) | **POST** /v3/functions/matches | Start function matching for an explicit set of functions *FunctionsCoreApi* | [**v3_canonicalize_function_names**](docs/FunctionsCoreApi.md#v3_canonicalize_function_names) | **POST** /v3/functions/canonical-names | Canonicalize a batch of function names +*FunctionsCoreApi* | [**v3_search_functions**](docs/FunctionsCoreApi.md#v3_search_functions) | **GET** /v3/functions | Search 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 @@ -271,6 +281,9 @@ Class | Method | HTTP request | Description ## Documentation For Models - [APIError](docs/APIError.md) + - [AcceptTypeSuggestionsInputBody](docs/AcceptTypeSuggestionsInputBody.md) + - [AcceptTypeSuggestionsOutputBody](docs/AcceptTypeSuggestionsOutputBody.md) + - [AcceptedType](docs/AcceptedType.md) - [AddCalleeInputBody](docs/AddCalleeInputBody.md) - [AddCollectionBinariesInputBody](docs/AddCollectionBinariesInputBody.md) - [AddIssuerDomainInputBody](docs/AddIssuerDomainInputBody.md) @@ -279,7 +292,9 @@ Class | Method | HTTP request | Description - [AddUserStringInputBody](docs/AddUserStringInputBody.md) - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) + - [AgentWorkflowUsageOutputBody](docs/AgentWorkflowUsageOutputBody.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) + - [AnalyseCapabilitiesBody](docs/AnalyseCapabilitiesBody.md) - [AnalysisAccessBody](docs/AnalysisAccessBody.md) - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) @@ -315,9 +330,11 @@ Class | Method | HTTP request | Description - [AnalysisStringsStatusResponse](docs/AnalysisStringsStatusResponse.md) - [AnalysisTagBody](docs/AnalysisTagBody.md) - [AnalysisTags](docs/AnalysisTags.md) + - [AnalysisTagsOutputBody](docs/AnalysisTagsOutputBody.md) - [AnalysisUpdateRequest](docs/AnalysisUpdateRequest.md) - [AnalysisUpdateTagsRequest](docs/AnalysisUpdateTagsRequest.md) - [AnalysisUpdateTagsResponse](docs/AnalysisUpdateTagsResponse.md) + - [AnalysisXrefOutputBody](docs/AnalysisXrefOutputBody.md) - [ApiCall](docs/ApiCall.md) - [ApiCombinationEvidence](docs/ApiCombinationEvidence.md) - [AppApiRestV2AgentSchemaCapability](docs/AppApiRestV2AgentSchemaCapability.md) @@ -414,11 +431,16 @@ Class | Method | HTTP request | Description - [BinaryDetailsResponse](docs/BinaryDetailsResponse.md) - [BinaryExportMetadata](docs/BinaryExportMetadata.md) - [BinaryExportResult](docs/BinaryExportResult.md) + - [BinaryExternalsBody](docs/BinaryExternalsBody.md) - [BinaryExternalsResponse](docs/BinaryExternalsResponse.md) - [BinarySearchResponse](docs/BinarySearchResponse.md) - [BinarySearchResult](docs/BinarySearchResult.md) + - [BinarySearchResultBody](docs/BinarySearchResultBody.md) - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - [BitfieldDataType](docs/BitfieldDataType.md) + - [BulkAddTagsInputBody](docs/BulkAddTagsInputBody.md) + - [BulkAddTagsOutputBody](docs/BulkAddTagsOutputBody.md) + - [BulkAddTagsResultBody](docs/BulkAddTagsResultBody.md) - [BulkCreateUserResult](docs/BulkCreateUserResult.md) - [BulkCreateUsersOutputBody](docs/BulkCreateUsersOutputBody.md) - [BulkDeleteAnalysesInputBody](docs/BulkDeleteAnalysesInputBody.md) @@ -496,6 +518,8 @@ Class | Method | HTTP request | Description - [CreateStructDataType](docs/CreateStructDataType.md) - [CreateTeamInputBody](docs/CreateTeamInputBody.md) - [CreateTypedefDataType](docs/CreateTypedefDataType.md) + - [CreateURLRequest](docs/CreateURLRequest.md) + - [CreateURLResponse](docs/CreateURLResponse.md) - [CreateUnionDataType](docs/CreateUnionDataType.md) - [CreateUnknownDataType](docs/CreateUnknownDataType.md) - [CreateUserInputBody](docs/CreateUserInputBody.md) @@ -508,6 +532,9 @@ Class | Method | HTTP request | Description - [CryptoFinding](docs/CryptoFinding.md) - [CryptoScanMetadata](docs/CryptoScanMetadata.md) - [CryptoScanResult](docs/CryptoScanResult.md) + - [CryptoVerification](docs/CryptoVerification.md) + - [DailyAnalysesCountOutputBody](docs/DailyAnalysesCountOutputBody.md) + - [DailyCountBody](docs/DailyCountBody.md) - [DataTypeEntry](docs/DataTypeEntry.md) - [DataTypeEnumValueEntry](docs/DataTypeEnumValueEntry.md) - [DataTypeFunctionEntry](docs/DataTypeFunctionEntry.md) @@ -581,6 +608,7 @@ Class | Method | HTTP request | Description - [ExecutionFinding](docs/ExecutionFinding.md) - [ExecutionScanMetadata](docs/ExecutionScanMetadata.md) - [ExecutionScanResult](docs/ExecutionScanResult.md) + - [ExecutionVerification](docs/ExecutionVerification.md) - [ExportModel](docs/ExportModel.md) - [ExternalResponse](docs/ExternalResponse.md) - [ExtractedBinary](docs/ExtractedBinary.md) @@ -599,6 +627,7 @@ Class | Method | HTTP request | Description - [FilesystemFinding](docs/FilesystemFinding.md) - [FilesystemScanMetadata](docs/FilesystemScanMetadata.md) - [FilesystemScanResult](docs/FilesystemScanResult.md) + - [FilesystemVerification](docs/FilesystemVerification.md) - [Filters](docs/Filters.md) - [Finding](docs/Finding.md) - [FindingEvidenceInner](docs/FindingEvidenceInner.md) @@ -621,6 +650,7 @@ Class | Method | HTTP request | Description - [FunctionRenameMap](docs/FunctionRenameMap.md) - [FunctionSearchResponse](docs/FunctionSearchResponse.md) - [FunctionSearchResult](docs/FunctionSearchResult.md) + - [FunctionSearchResultBody](docs/FunctionSearchResultBody.md) - [FunctionSignatureBody](docs/FunctionSignatureBody.md) - [FunctionSignatureEntry](docs/FunctionSignatureEntry.md) - [FunctionSignatureVersion](docs/FunctionSignatureVersion.md) @@ -640,6 +670,7 @@ Class | Method | HTTP request | Description - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAnalysisLogsOutputBody](docs/GetAnalysisLogsOutputBody.md) - [GetAnalysisStringsStatusOutputBody](docs/GetAnalysisStringsStatusOutputBody.md) + - [GetBinaryExternalsOutputBody](docs/GetBinaryExternalsOutputBody.md) - [GetCollectionOutputBody](docs/GetCollectionOutputBody.md) - [GetConfigOutputBody](docs/GetConfigOutputBody.md) - [GetDataTypeHistoryBody](docs/GetDataTypeHistoryBody.md) @@ -721,6 +752,7 @@ Class | Method | HTTP request | Description - [NetworkingFinding](docs/NetworkingFinding.md) - [NetworkingScanMetadata](docs/NetworkingScanMetadata.md) - [NetworkingScanResult](docs/NetworkingScanResult.md) + - [NetworkingVerification](docs/NetworkingVerification.md) - [OIDCCallbackInputBody](docs/OIDCCallbackInputBody.md) - [OperationBinaryExportMetadataBinaryExportResult](docs/OperationBinaryExportMetadataBinaryExportResult.md) - [OperationCreateMetadataCreateResult](docs/OperationCreateMetadataCreateResult.md) @@ -792,6 +824,7 @@ Class | Method | HTTP request | Description - [RenameOutputBody](docs/RenameOutputBody.md) - [RenameUnnamedFunctionsResult](docs/RenameUnnamedFunctionsResult.md) - [RenderedToken](docs/RenderedToken.md) + - [ReportAnalysisBody](docs/ReportAnalysisBody.md) - [ReportAnalysisResponse](docs/ReportAnalysisResponse.md) - [ReportEvent](docs/ReportEvent.md) - [ReportInfo](docs/ReportInfo.md) @@ -813,6 +846,9 @@ Class | Method | HTTP request | Description - [ScrapeThirdPartyConfig](docs/ScrapeThirdPartyConfig.md) - [ScreenshotEntry](docs/ScreenshotEntry.md) - [ScreenshotsIndex](docs/ScreenshotsIndex.md) + - [SearchBinariesOutputBody](docs/SearchBinariesOutputBody.md) + - [SearchFunctionsOutputBody](docs/SearchFunctionsOutputBody.md) + - [SearchTagsOutputBody](docs/SearchTagsOutputBody.md) - [SecretsAgentResponse](docs/SecretsAgentResponse.md) - [SectionModel](docs/SectionModel.md) - [SecurityFinding](docs/SecurityFinding.md) @@ -831,6 +867,7 @@ Class | Method | HTTP request | Description - [SingleCodeSignatureModel](docs/SingleCodeSignatureModel.md) - [SinglePDBEntryModel](docs/SinglePDBEntryModel.md) - [SingleSectionModel](docs/SingleSectionModel.md) + - [SoftwareTypeCountsBody](docs/SoftwareTypeCountsBody.md) - [SourceDeltaEvent](docs/SourceDeltaEvent.md) - [SourceResetEvent](docs/SourceResetEvent.md) - [SseEventContextCompactedData](docs/SseEventContextCompactedData.md) @@ -885,6 +922,7 @@ Class | Method | HTTP request | Description - [TagResponse](docs/TagResponse.md) - [TagSearchResponse](docs/TagSearchResponse.md) - [TagSearchResult](docs/TagSearchResult.md) + - [TagSearchResultBody](docs/TagSearchResultBody.md) - [TaskResponse](docs/TaskResponse.md) - [TaskStatus](docs/TaskStatus.md) - [TaskStatusResponse](docs/TaskStatusResponse.md) @@ -935,6 +973,7 @@ Class | Method | HTTP request | Description - [UpdatePointerDataType](docs/UpdatePointerDataType.md) - [UpdateProfileInputBody](docs/UpdateProfileInputBody.md) - [UpdateStructDataType](docs/UpdateStructDataType.md) + - [UpdateTagsInputBody](docs/UpdateTagsInputBody.md) - [UpdateTeamInputBody](docs/UpdateTeamInputBody.md) - [UpdateTypedefDataType](docs/UpdateTypedefDataType.md) - [UpdateUnionDataType](docs/UpdateUnionDataType.md) @@ -955,8 +994,12 @@ Class | Method | HTTP request | Description - [UserIdentity](docs/UserIdentity.md) - [UserProfile](docs/UserProfile.md) - [WarningEvent](docs/WarningEvent.md) + - [WorkflowDayBody](docs/WorkflowDayBody.md) - [WorkflowProgress](docs/WorkflowProgress.md) - [Workspace](docs/Workspace.md) + - [XrefFromBody](docs/XrefFromBody.md) - [XrefFromResponse](docs/XrefFromResponse.md) + - [XrefIntoBody](docs/XrefIntoBody.md) - [XrefResponse](docs/XrefResponse.md) + - [XrefSegmentBody](docs/XrefSegmentBody.md) - [XrefToResponse](docs/XrefToResponse.md) diff --git a/docs/AcceptTypeSuggestionsInputBody.md b/docs/AcceptTypeSuggestionsInputBody.md new file mode 100644 index 0000000..442b67b --- /dev/null +++ b/docs/AcceptTypeSuggestionsInputBody.md @@ -0,0 +1,29 @@ +# AcceptTypeSuggestionsInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keys** | **List[str]** | Keys of the suggestions to store, as the type suggestions endpoint returns them. A key repeated in one request is stored once. | + +## Example + +```python +from revengai.models.accept_type_suggestions_input_body import AcceptTypeSuggestionsInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AcceptTypeSuggestionsInputBody from a JSON string +accept_type_suggestions_input_body_instance = AcceptTypeSuggestionsInputBody.from_json(json) +# print the JSON string representation of the object +print(AcceptTypeSuggestionsInputBody.to_json()) + +# convert the object into a dict +accept_type_suggestions_input_body_dict = accept_type_suggestions_input_body_instance.to_dict() +# create an instance of AcceptTypeSuggestionsInputBody from a dict +accept_type_suggestions_input_body_from_dict = AcceptTypeSuggestionsInputBody.from_dict(accept_type_suggestions_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/AcceptTypeSuggestionsOutputBody.md b/docs/AcceptTypeSuggestionsOutputBody.md new file mode 100644 index 0000000..e63f713 --- /dev/null +++ b/docs/AcceptTypeSuggestionsOutputBody.md @@ -0,0 +1,30 @@ +# AcceptTypeSuggestionsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accepted** | [**List[AcceptedType]**](AcceptedType.md) | One entry per requested suggestion, in request order. | +**data_types** | [**List[DataTypeEntry]**](DataTypeEntry.md) | The type each requested suggestion resolved to, plus every type minted to satisfy one, ordered by data_type_id. | + +## Example + +```python +from revengai.models.accept_type_suggestions_output_body import AcceptTypeSuggestionsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AcceptTypeSuggestionsOutputBody from a JSON string +accept_type_suggestions_output_body_instance = AcceptTypeSuggestionsOutputBody.from_json(json) +# print the JSON string representation of the object +print(AcceptTypeSuggestionsOutputBody.to_json()) + +# convert the object into a dict +accept_type_suggestions_output_body_dict = accept_type_suggestions_output_body_instance.to_dict() +# create an instance of AcceptTypeSuggestionsOutputBody from a dict +accept_type_suggestions_output_body_from_dict = AcceptTypeSuggestionsOutputBody.from_dict(accept_type_suggestions_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/AcceptedType.md b/docs/AcceptedType.md new file mode 100644 index 0000000..075b638 --- /dev/null +++ b/docs/AcceptedType.md @@ -0,0 +1,32 @@ +# AcceptedType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **bool** | False when the analysis already held a type under this name and kind, which this request resolved to rather than replaced. | +**data_type_id** | **int** | The data type the suggestion is now stored as. | +**key** | **str** | The suggestion this entry answers. | +**skipped_members** | **int** | Members left out of the stored type because no offset or width was established for them. | + +## Example + +```python +from revengai.models.accepted_type import AcceptedType + +# TODO update the JSON string below +json = "{}" +# create an instance of AcceptedType from a JSON string +accepted_type_instance = AcceptedType.from_json(json) +# print the JSON string representation of the object +print(AcceptedType.to_json()) + +# convert the object into a dict +accepted_type_dict = accepted_type_instance.to_dict() +# create an instance of AcceptedType from a dict +accepted_type_from_dict = AcceptedType.from_dict(accepted_type_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AgentWorkflowUsageOutputBody.md b/docs/AgentWorkflowUsageOutputBody.md new file mode 100644 index 0000000..042b127 --- /dev/null +++ b/docs/AgentWorkflowUsageOutputBody.md @@ -0,0 +1,29 @@ +# AgentWorkflowUsageOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report** | [**List[WorkflowDayBody]**](WorkflowDayBody.md) | One entry per day in the requested window, oldest first | + +## Example + +```python +from revengai.models.agent_workflow_usage_output_body import AgentWorkflowUsageOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentWorkflowUsageOutputBody from a JSON string +agent_workflow_usage_output_body_instance = AgentWorkflowUsageOutputBody.from_json(json) +# print the JSON string representation of the object +print(AgentWorkflowUsageOutputBody.to_json()) + +# convert the object into a dict +agent_workflow_usage_output_body_dict = agent_workflow_usage_output_body_instance.to_dict() +# create an instance of AgentWorkflowUsageOutputBody from a dict +agent_workflow_usage_output_body_from_dict = AgentWorkflowUsageOutputBody.from_dict(agent_workflow_usage_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/AnalyseCapabilitiesBody.md b/docs/AnalyseCapabilitiesBody.md new file mode 100644 index 0000000..04b31be --- /dev/null +++ b/docs/AnalyseCapabilitiesBody.md @@ -0,0 +1,29 @@ +# AnalyseCapabilitiesBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**completed** | **int** | ANALYSE_CAPABILITIES agent tasks completed that day | + +## Example + +```python +from revengai.models.analyse_capabilities_body import AnalyseCapabilitiesBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalyseCapabilitiesBody from a JSON string +analyse_capabilities_body_instance = AnalyseCapabilitiesBody.from_json(json) +# print the JSON string representation of the object +print(AnalyseCapabilitiesBody.to_json()) + +# convert the object into a dict +analyse_capabilities_body_dict = analyse_capabilities_body_instance.to_dict() +# create an instance of AnalyseCapabilitiesBody from a dict +analyse_capabilities_body_from_dict = AnalyseCapabilitiesBody.from_dict(analyse_capabilities_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/AnalysesBulkActionsApi.md b/docs/AnalysesBulkActionsApi.md index 95c4cf9..0ee667f 100644 --- a/docs/AnalysesBulkActionsApi.md +++ b/docs/AnalysesBulkActionsApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**bulk_add_analysis_tags**](AnalysesBulkActionsApi.md#bulk_add_analysis_tags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags [**bulk_delete_analyses**](AnalysesBulkActionsApi.md#bulk_delete_analyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses +[**v3_batch_add_analysis_tags**](AnalysesBulkActionsApi.md#v3_batch_add_analysis_tags) | **POST** /v3/analyses:batchAddTags | Add tags to multiple analyses. [**v3_batch_delete_analyses**](AnalysesBulkActionsApi.md#v3_batch_delete_analyses) | **POST** /v3/analyses:batchDelete | Delete multiple analyses. @@ -185,6 +186,100 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_batch_add_analysis_tags** +> BulkAddTagsOutputBody v3_batch_add_analysis_tags(bulk_add_tags_input_body) + +Add tags to multiple analyses. + +Adds tags (origin RevEng) to every given analysis' binary. The caller must own every analysis, or none are changed. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.bulk_add_tags_input_body import BulkAddTagsInputBody +from revengai.models.bulk_add_tags_output_body import BulkAddTagsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesBulkActionsApi(api_client) + bulk_add_tags_input_body = revengai.BulkAddTagsInputBody() # BulkAddTagsInputBody | + + try: + # Add tags to multiple analyses. + api_response = api_instance.v3_batch_add_analysis_tags(bulk_add_tags_input_body) + print("The response of AnalysesBulkActionsApi->v3_batch_add_analysis_tags:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesBulkActionsApi->v3_batch_add_analysis_tags: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bulk_add_tags_input_body** | [**BulkAddTagsInputBody**](BulkAddTagsInputBody.md)| | + +### Return type + +[**BulkAddTagsOutputBody**](BulkAddTagsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_batch_delete_analyses** > v3_batch_delete_analyses(bulk_delete_analyses_input_body) diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index ab2b5c8..2381aea 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -42,7 +42,9 @@ Method | HTTP request | Description [**v3_list_example_analyses**](AnalysesCoreApi.md#v3_list_example_analyses) | **GET** /v3/analyses/examples | List example analyses [**v3_lookup_analysis_by_binary_id**](AnalysesCoreApi.md#v3_lookup_analysis_by_binary_id) | **GET** /v3/analyses/lookup/{binary_id} | Look up the most recent analysis for a binary. [**v3_queue_binary_export**](AnalysesCoreApi.md#v3_queue_binary_export) | **POST** /v3/analyses/{analysis_id}/binary-export | Queue a binary export +[**v3_search_tags**](AnalysesCoreApi.md#v3_search_tags) | **GET** /v3/tags | Search tags [**v3_update_analysis**](AnalysesCoreApi.md#v3_update_analysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. +[**v3_update_analysis_tags**](AnalysesCoreApi.md#v3_update_analysis_tags) | **PATCH** /v3/analyses/{analysis_id}/tags | Replace an analysis' tags. [**v3_upgrade_analysis_model**](AnalysesCoreApi.md#v3_upgrade_analysis_model) | **POST** /v3/analyses/{analysis_id}/upgrade-model | Re-analyse on the latest model @@ -3575,6 +3577,100 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_search_tags** +> SearchTagsOutputBody v3_search_tags(partial_name=partial_name, limit=limit, offset=offset) + +Search tags + +Searches for tags by name. partial_name is required and must be at least 3 characters. + +**Error codes:** +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.search_tags_output_body import SearchTagsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + partial_name = 'partial_name_example' # str | Partial or full tag name to search for, at least 3 characters (optional) + limit = 10 # int | Maximum results to return (optional) (default to 10) + offset = 0 # int | Number of results to skip (optional) (default to 0) + + try: + # Search tags + api_response = api_instance.v3_search_tags(partial_name=partial_name, limit=limit, offset=offset) + print("The response of AnalysesCoreApi->v3_search_tags:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_search_tags: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **partial_name** | **str**| Partial or full tag name to search for, at least 3 characters | [optional] + **limit** | **int**| Maximum results to return | [optional] [default to 10] + **offset** | **int**| Number of results to skip | [optional] [default to 0] + +### Return type + +[**SearchTagsOutputBody**](SearchTagsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_update_analysis** > AnalysisDetailOutputBody v3_update_analysis(analysis_id, update_analysis_input_body) @@ -3673,6 +3769,102 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_update_analysis_tags** +> AnalysisTagsOutputBody v3_update_analysis_tags(analysis_id, update_tags_input_body) + +Replace an analysis' tags. + +Replaces the analysis' binary's user tags (origin RevEng) with the given set. A tag recorded under any other origin, such as a heuristic detection sharing a name with a user tag, is left in place even when its name is absent from the request. Only the owner may call it. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody +from revengai.models.update_tags_input_body import UpdateTagsInputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + update_tags_input_body = revengai.UpdateTagsInputBody() # UpdateTagsInputBody | + + try: + # Replace an analysis' tags. + api_response = api_instance.v3_update_analysis_tags(analysis_id, update_tags_input_body) + print("The response of AnalysesCoreApi->v3_update_analysis_tags:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_update_analysis_tags: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **update_tags_input_body** | [**UpdateTagsInputBody**](UpdateTagsInputBody.md)| | + +### Return type + +[**AnalysisTagsOutputBody**](AnalysisTagsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_upgrade_analysis_model** > UpgradeAnalysisModelOutputBody v3_upgrade_analysis_model(analysis_id) diff --git a/docs/AnalysesResultsMetadataApi.md b/docs/AnalysesResultsMetadataApi.md index f8382aa..3b2d96b 100644 --- a/docs/AnalysesResultsMetadataApi.md +++ b/docs/AnalysesResultsMetadataApi.md @@ -8,7 +8,9 @@ Method | HTTP request | Description [**get_capabilities**](AnalysesResultsMetadataApi.md#get_capabilities) | **GET** /v2/analyses/{analysis_id}/capabilities | Gets the capabilities from the analysis [**get_functions_list**](AnalysesResultsMetadataApi.md#get_functions_list) | **GET** /v2/analyses/{analysis_id}/functions/list | Gets functions from analysis [**get_tags**](AnalysesResultsMetadataApi.md#get_tags) | **GET** /v2/analyses/{analysis_id}/tags | Get function tags with maliciousness score +[**v3_get_analysis_xref**](AnalysesResultsMetadataApi.md#v3_get_analysis_xref) | **GET** /v3/analyses/{analysis_id}/xrefs/{vaddr} | Look up xrefs by virtual address. [**v3_list_analysis_capabilities**](AnalysesResultsMetadataApi.md#v3_list_analysis_capabilities) | **GET** /v3/analyses/{analysis_id}/capabilities | List the capabilities found in an analysis. +[**v3_list_analysis_tags**](AnalysesResultsMetadataApi.md#v3_list_analysis_tags) | **GET** /v3/analyses/{analysis_id}/tags | List the tags on an analysis. # **get_analysis_functions_paginated** @@ -367,6 +369,101 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_get_analysis_xref** +> AnalysisXrefOutputBody v3_get_analysis_xref(analysis_id, vaddr) + +Look up xrefs by virtual address. + +Returns every cross-reference into and out of a virtual address, read from the analysis' cache. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.analysis_xref_output_body import AnalysisXrefOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesResultsMetadataApi(api_client) + analysis_id = 56 # int | Analysis ID + vaddr = 56 # int | Virtual address to match against xrefs + + try: + # Look up xrefs by virtual address. + api_response = api_instance.v3_get_analysis_xref(analysis_id, vaddr) + print("The response of AnalysesResultsMetadataApi->v3_get_analysis_xref:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesResultsMetadataApi->v3_get_analysis_xref: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **vaddr** | **int**| Virtual address to match against xrefs | + +### Return type + +[**AnalysisXrefOutputBody**](AnalysisXrefOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_list_analysis_capabilities** > AnalysisCapabilitiesOutputBody v3_list_analysis_capabilities(analysis_id) @@ -460,3 +557,96 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_list_analysis_tags** +> AnalysisTagsOutputBody v3_list_analysis_tags(analysis_id) + +List the tags on an analysis. + +Returns every tag on the analysis' binary, of any origin. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesResultsMetadataApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # List the tags on an analysis. + api_response = api_instance.v3_list_analysis_tags(analysis_id) + print("The response of AnalysesResultsMetadataApi->v3_list_analysis_tags:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesResultsMetadataApi->v3_list_analysis_tags: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**AnalysisTagsOutputBody**](AnalysisTagsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AnalysisTagsOutputBody.md b/docs/AnalysisTagsOutputBody.md new file mode 100644 index 0000000..525def4 --- /dev/null +++ b/docs/AnalysisTagsOutputBody.md @@ -0,0 +1,29 @@ +# AnalysisTagsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | [**List[AnalysisTagBody]**](AnalysisTagBody.md) | Every tag on the analysis' binary, of any origin | + +## Example + +```python +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisTagsOutputBody from a JSON string +analysis_tags_output_body_instance = AnalysisTagsOutputBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisTagsOutputBody.to_json()) + +# convert the object into a dict +analysis_tags_output_body_dict = analysis_tags_output_body_instance.to_dict() +# create an instance of AnalysisTagsOutputBody from a dict +analysis_tags_output_body_from_dict = AnalysisTagsOutputBody.from_dict(analysis_tags_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/AnalysisXrefOutputBody.md b/docs/AnalysisXrefOutputBody.md new file mode 100644 index 0000000..7552b8f --- /dev/null +++ b/docs/AnalysisXrefOutputBody.md @@ -0,0 +1,30 @@ +# AnalysisXrefOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**xref_from_list** | [**List[XrefFromBody]**](XrefFromBody.md) | Xrefs that originate at the queried vaddr, one per target address | +**xref_to_list** | [**List[XrefIntoBody]**](XrefIntoBody.md) | Xrefs that target the queried vaddr, one per referencing address | + +## Example + +```python +from revengai.models.analysis_xref_output_body import AnalysisXrefOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisXrefOutputBody from a JSON string +analysis_xref_output_body_instance = AnalysisXrefOutputBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisXrefOutputBody.to_json()) + +# convert the object into a dict +analysis_xref_output_body_dict = analysis_xref_output_body_instance.to_dict() +# create an instance of AnalysisXrefOutputBody from a dict +analysis_xref_output_body_from_dict = AnalysisXrefOutputBody.from_dict(analysis_xref_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/BinariesApi.md b/docs/BinariesApi.md index 92e59b8..7ee6dcc 100644 --- a/docs/BinariesApi.md +++ b/docs/BinariesApi.md @@ -14,9 +14,12 @@ Method | HTTP request | Description [**get_binary_externals**](BinariesApi.md#get_binary_externals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary [**get_binary_related_status**](BinariesApi.md#get_binary_related_status) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary [**get_related_binaries**](BinariesApi.md#get_related_binaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. +[**v3_download_binary_zipped**](BinariesApi.md#v3_download_binary_zipped) | **GET** /v3/binaries/{binary_id}/download-zipped | Download a binary as a password-protected zip. [**v3_get_binary_die_info**](BinariesApi.md#v3_get_binary_die_info) | **GET** /v3/binaries/{binary_id}/die-info | Get Detect It Easy matches for a binary. +[**v3_get_binary_externals**](BinariesApi.md#v3_get_binary_externals) | **GET** /v3/binaries/{binary_id}/externals | Get third-party threat-intel lookups for a binary. [**v3_get_binary_related**](BinariesApi.md#v3_get_binary_related) | **GET** /v3/binaries/{binary_id}/related | Get the binaries related to this one by unpacking. [**v3_get_binary_related_status**](BinariesApi.md#v3_get_binary_related_status) | **GET** /v3/binaries/{binary_id}/related/status | Get the archive-unpacking status for a binary. +[**v3_search_binaries**](BinariesApi.md#v3_search_binaries) | **GET** /v3/binaries | Search binaries [**v3_upload_file**](BinariesApi.md#v3_upload_file) | **POST** /v3/upload | Upload a file. @@ -878,6 +881,96 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_download_binary_zipped** +> v3_download_binary_zipped(binary_id) + +Download a binary as a password-protected zip. + +Streams the binary's uploaded file back as a zip archive, encrypted with a fixed password (`infected`) that deters antivirus scanning in transit rather than protecting confidentiality. Only the binary's owner, or an admin/superadmin, may download it; an internally-managed account's binary can only be downloaded by a superadmin. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.BinariesApi(api_client) + binary_id = 56 # int | Binary ID + + try: + # Download a binary as a password-protected zip. + api_instance.v3_download_binary_zipped(binary_id) + except Exception as e: + print("Exception when calling BinariesApi->v3_download_binary_zipped: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| Binary ID | + +### Return type + +void (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_get_binary_die_info** > GetDieInfoOutputBody v3_get_binary_die_info(binary_id) @@ -971,6 +1064,99 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_get_binary_externals** +> GetBinaryExternalsOutputBody v3_get_binary_externals(binary_id) + +Get third-party threat-intel lookups for a binary. + +Returns VirusTotal and MalwareBazaar lookup results for the binary's content hash. `externals` is null until at least one lookup has run. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_binary_externals_output_body import GetBinaryExternalsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.BinariesApi(api_client) + binary_id = 56 # int | Binary ID + + try: + # Get third-party threat-intel lookups for a binary. + api_response = api_instance.v3_get_binary_externals(binary_id) + print("The response of BinariesApi->v3_get_binary_externals:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->v3_get_binary_externals: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| Binary ID | + +### Return type + +[**GetBinaryExternalsOutputBody**](GetBinaryExternalsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_get_binary_related** > GetRelatedBinariesOutputBody v3_get_binary_related(binary_id) @@ -1157,6 +1343,112 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_search_binaries** +> SearchBinariesOutputBody v3_search_binaries(partial_name=partial_name, partial_sha256=partial_sha256, tags=tags, model_name=model_name, user_files_only=user_files_only, exclude_binary_id=exclude_binary_id, user_ids=user_ids, limit=limit, offset=offset) + +Search binaries + +Searches for binaries visible to the caller. At least one of partial_name, partial_sha256, tags, or model_name must be provided. + +**Error codes:** +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.search_binaries_output_body import SearchBinariesOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.BinariesApi(api_client) + partial_name = 'partial_name_example' # str | Partial or full binary name to search for (optional) + partial_sha256 = 'partial_sha256_example' # str | Partial or full SHA-256 hash to search for (optional) + tags = ['tags_example'] # List[Optional[str]] | Restrict results to binaries carrying at least one of these tags (optional) + model_name = 'model_name_example' # str | Restrict results to binaries analysed with this model (optional) + user_files_only = False # bool | Restrict results to files the caller uploaded themself (optional) (default to False) + exclude_binary_id = 56 # int | A binary ID to exclude from the results (optional) + user_ids = [56] # List[int] | Restrict results to binaries owned by one of these user IDs (optional) + limit = 10 # int | Maximum results to return (optional) (default to 10) + offset = 0 # int | Number of results to skip (optional) (default to 0) + + try: + # Search binaries + api_response = api_instance.v3_search_binaries(partial_name=partial_name, partial_sha256=partial_sha256, tags=tags, model_name=model_name, user_files_only=user_files_only, exclude_binary_id=exclude_binary_id, user_ids=user_ids, limit=limit, offset=offset) + print("The response of BinariesApi->v3_search_binaries:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->v3_search_binaries: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **partial_name** | **str**| Partial or full binary name to search for | [optional] + **partial_sha256** | **str**| Partial or full SHA-256 hash to search for | [optional] + **tags** | [**List[Optional[str]]**](str.md)| Restrict results to binaries carrying at least one of these tags | [optional] + **model_name** | **str**| Restrict results to binaries analysed with this model | [optional] + **user_files_only** | **bool**| Restrict results to files the caller uploaded themself | [optional] [default to False] + **exclude_binary_id** | **int**| A binary ID to exclude from the results | [optional] + **user_ids** | [**List[int]**](int.md)| Restrict results to binaries owned by one of these user IDs | [optional] + **limit** | **int**| Maximum results to return | [optional] [default to 10] + **offset** | **int**| Number of results to skip | [optional] [default to 0] + +### Return type + +[**SearchBinariesOutputBody**](SearchBinariesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_upload_file** > UploadOutputBody v3_upload_file(file, upload_file_type, force_overwrite=force_overwrite) diff --git a/docs/BinaryExternalsBody.md b/docs/BinaryExternalsBody.md new file mode 100644 index 0000000..c86de58 --- /dev/null +++ b/docs/BinaryExternalsBody.md @@ -0,0 +1,33 @@ +# BinaryExternalsBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mb** | **object** | | +**mb_last_updated** | **datetime** | When the MalwareBazaar lookup last ran, null if never looked up | +**sha_256_hash** | **str** | SHA-256 hash the lookups were keyed by | +**vt** | **object** | | +**vt_last_updated** | **datetime** | When the VirusTotal lookup last ran | + +## Example + +```python +from revengai.models.binary_externals_body import BinaryExternalsBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BinaryExternalsBody from a JSON string +binary_externals_body_instance = BinaryExternalsBody.from_json(json) +# print the JSON string representation of the object +print(BinaryExternalsBody.to_json()) + +# convert the object into a dict +binary_externals_body_dict = binary_externals_body_instance.to_dict() +# create an instance of BinaryExternalsBody from a dict +binary_externals_body_from_dict = BinaryExternalsBody.from_dict(binary_externals_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/BinarySearchResultBody.md b/docs/BinarySearchResultBody.md new file mode 100644 index 0000000..763ffe7 --- /dev/null +++ b/docs/BinarySearchResultBody.md @@ -0,0 +1,37 @@ +# BinarySearchResultBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | | +**binary_id** | **int** | | +**binary_name** | **str** | | +**created_at** | **datetime** | | +**model_id** | **int** | | +**model_name** | **str** | | +**owned_by** | **str** | | +**sha_256_hash** | **str** | | +**tags** | **List[str]** | | + +## Example + +```python +from revengai.models.binary_search_result_body import BinarySearchResultBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BinarySearchResultBody from a JSON string +binary_search_result_body_instance = BinarySearchResultBody.from_json(json) +# print the JSON string representation of the object +print(BinarySearchResultBody.to_json()) + +# convert the object into a dict +binary_search_result_body_dict = binary_search_result_body_instance.to_dict() +# create an instance of BinarySearchResultBody from a dict +binary_search_result_body_from_dict = BinarySearchResultBody.from_dict(binary_search_result_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/BulkAddTagsInputBody.md b/docs/BulkAddTagsInputBody.md new file mode 100644 index 0000000..2024d7a --- /dev/null +++ b/docs/BulkAddTagsInputBody.md @@ -0,0 +1,30 @@ +# BulkAddTagsInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_ids** | **List[int]** | IDs of the analyses to tag. The caller must own every one, or none are changed | +**tags** | **List[str]** | Tags to add. A binary that already carries a tag, under any origin, is left as-is for that name | + +## Example + +```python +from revengai.models.bulk_add_tags_input_body import BulkAddTagsInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BulkAddTagsInputBody from a JSON string +bulk_add_tags_input_body_instance = BulkAddTagsInputBody.from_json(json) +# print the JSON string representation of the object +print(BulkAddTagsInputBody.to_json()) + +# convert the object into a dict +bulk_add_tags_input_body_dict = bulk_add_tags_input_body_instance.to_dict() +# create an instance of BulkAddTagsInputBody from a dict +bulk_add_tags_input_body_from_dict = BulkAddTagsInputBody.from_dict(bulk_add_tags_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/BulkAddTagsOutputBody.md b/docs/BulkAddTagsOutputBody.md new file mode 100644 index 0000000..901eef2 --- /dev/null +++ b/docs/BulkAddTagsOutputBody.md @@ -0,0 +1,29 @@ +# BulkAddTagsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[BulkAddTagsResultBody]**](BulkAddTagsResultBody.md) | One entry per requested analysis, in the order they were given | + +## Example + +```python +from revengai.models.bulk_add_tags_output_body import BulkAddTagsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BulkAddTagsOutputBody from a JSON string +bulk_add_tags_output_body_instance = BulkAddTagsOutputBody.from_json(json) +# print the JSON string representation of the object +print(BulkAddTagsOutputBody.to_json()) + +# convert the object into a dict +bulk_add_tags_output_body_dict = bulk_add_tags_output_body_instance.to_dict() +# create an instance of BulkAddTagsOutputBody from a dict +bulk_add_tags_output_body_from_dict = BulkAddTagsOutputBody.from_dict(bulk_add_tags_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/BulkAddTagsResultBody.md b/docs/BulkAddTagsResultBody.md new file mode 100644 index 0000000..ef81a83 --- /dev/null +++ b/docs/BulkAddTagsResultBody.md @@ -0,0 +1,30 @@ +# BulkAddTagsResultBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**added_tags** | **List[str]** | Tags actually added; empty when the binary already carried every requested name | +**analysis_id** | **int** | ID of the analysis | + +## Example + +```python +from revengai.models.bulk_add_tags_result_body import BulkAddTagsResultBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BulkAddTagsResultBody from a JSON string +bulk_add_tags_result_body_instance = BulkAddTagsResultBody.from_json(json) +# print the JSON string representation of the object +print(BulkAddTagsResultBody.to_json()) + +# convert the object into a dict +bulk_add_tags_result_body_dict = bulk_add_tags_result_body_instance.to_dict() +# create an instance of BulkAddTagsResultBody from a dict +bulk_add_tags_result_body_from_dict = BulkAddTagsResultBody.from_dict(bulk_add_tags_result_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/CollectionsApi.md b/docs/CollectionsApi.md index 6642c12..ebf2ee8 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -1036,11 +1036,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **v3_list_collections** -> ListCollectionsOutputBody v3_list_collections(search_term=search_term, filters=filters, limit=limit, offset=offset, order_by=order_by, order=order) +> ListCollectionsOutputBody v3_list_collections(search_term=search_term, binary_name=binary_name, binary_sha256=binary_sha256, tags=tags, user_ids=user_ids, filters=filters, limit=limit, offset=offset, order_by=order_by, order=order) List collections. -Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. +Lists collections accessible to the authenticated user. Supports search by collection name, contained binary name/SHA-256, tags, owner, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed @@ -1082,7 +1082,11 @@ configuration = revengai.Configuration( with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.CollectionsApi(api_client) - search_term = 'search_term_example' # str | (optional) + search_term = 'search_term_example' # str | Partial or full collection name to search for (optional) + binary_name = 'binary_name_example' # str | Only return Collections containing a Binary whose name contains this (optional) + binary_sha256 = 'binary_sha256_example' # str | Only return Collections containing a Binary whose SHA-256 hash contains this (optional) + tags = ['tags_example'] # List[Optional[str]] | Only return Collections carrying at least one of these Tags (optional) + user_ids = [56] # List[int] | Restrict results to Collections owned by one of these user IDs (optional) filters = ['filters_example'] # List[str] | (optional) limit = 20 # int | (optional) (default to 20) offset = 0 # int | (optional) (default to 0) @@ -1091,7 +1095,7 @@ with revengai.ApiClient(configuration) as api_client: try: # List collections. - api_response = api_instance.v3_list_collections(search_term=search_term, filters=filters, limit=limit, offset=offset, order_by=order_by, order=order) + api_response = api_instance.v3_list_collections(search_term=search_term, binary_name=binary_name, binary_sha256=binary_sha256, tags=tags, user_ids=user_ids, filters=filters, limit=limit, offset=offset, order_by=order_by, order=order) print("The response of CollectionsApi->v3_list_collections:\n") pprint(api_response) except Exception as e: @@ -1105,7 +1109,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **search_term** | **str**| | [optional] + **search_term** | **str**| Partial or full collection name to search for | [optional] + **binary_name** | **str**| Only return Collections containing a Binary whose name contains this | [optional] + **binary_sha256** | **str**| Only return Collections containing a Binary whose SHA-256 hash contains this | [optional] + **tags** | [**List[Optional[str]]**](str.md)| Only return Collections carrying at least one of these Tags | [optional] + **user_ids** | [**List[int]**](int.md)| Restrict results to Collections owned by one of these user IDs | [optional] **filters** | [**List[str]**](str.md)| | [optional] **limit** | **int**| | [optional] [default to 20] **offset** | **int**| | [optional] [default to 0] diff --git a/docs/CreateURLRequest.md b/docs/CreateURLRequest.md new file mode 100644 index 0000000..14fc629 --- /dev/null +++ b/docs/CreateURLRequest.md @@ -0,0 +1,30 @@ +# CreateURLRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_scope** | **str** | | [optional] [default to 'PRIVATE'] +**url** | **str** | | + +## Example + +```python +from revengai.models.create_url_request import CreateURLRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateURLRequest from a JSON string +create_url_request_instance = CreateURLRequest.from_json(json) +# print the JSON string representation of the object +print(CreateURLRequest.to_json()) + +# convert the object into a dict +create_url_request_dict = create_url_request_instance.to_dict() +# create an instance of CreateURLRequest from a dict +create_url_request_from_dict = CreateURLRequest.from_dict(create_url_request_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/CreateURLResponse.md b/docs/CreateURLResponse.md new file mode 100644 index 0000000..382cbc9 --- /dev/null +++ b/docs/CreateURLResponse.md @@ -0,0 +1,31 @@ +# CreateURLResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | | +**binary_id** | **int** | | +**sha_256_hash** | **str** | | + +## Example + +```python +from revengai.models.create_url_response import CreateURLResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateURLResponse from a JSON string +create_url_response_instance = CreateURLResponse.from_json(json) +# print the JSON string representation of the object +print(CreateURLResponse.to_json()) + +# convert the object into a dict +create_url_response_dict = create_url_response_instance.to_dict() +# create an instance of CreateURLResponse from a dict +create_url_response_from_dict = CreateURLResponse.from_dict(create_url_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserInputBody.md b/docs/CreateUserInputBody.md index cfc60a1..d95a072 100644 --- a/docs/CreateUserInputBody.md +++ b/docs/CreateUserInputBody.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **last_name** | **str** | Last name | [optional] **password** | **str** | Initial password | **role** | **str** | User role (defaults to USER) | [optional] +**team_id** | **int** | Existing team to add the user to, which also becomes their default team | [optional] **tier** | **str** | User tier (defaults to ENTHUSIAST) | [optional] **time_zone** | **str** | IANA time zone | [optional] **username** | **str** | Username | diff --git a/docs/CryptoFinding.md b/docs/CryptoFinding.md index b4e2988..0ac7d65 100644 --- a/docs/CryptoFinding.md +++ b/docs/CryptoFinding.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **function_name** | **str** | Name of the function the finding was reported in | **function_size** | **int** | Size of the function in bytes | **libraries** | **List[str]** | Distinct crypto libraries evidenced by this function | +**verification** | [**CryptoVerification**](CryptoVerification.md) | LLM verdict checking this finding against its decompilation. Present only when the run verified this finding. | [optional] ## Example diff --git a/docs/CryptoVerification.md b/docs/CryptoVerification.md new file mode 100644 index 0000000..13aa71a --- /dev/null +++ b/docs/CryptoVerification.md @@ -0,0 +1,31 @@ +# CryptoVerification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**confidence** | **str** | LLM's confidence in the verdict. Absent when verified is null. | [optional] +**reasoning** | **str** | LLM's explanation for the verdict, or the reason verification could not be completed | +**verified** | **bool** | Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped | + +## Example + +```python +from revengai.models.crypto_verification import CryptoVerification + +# TODO update the JSON string below +json = "{}" +# create an instance of CryptoVerification from a JSON string +crypto_verification_instance = CryptoVerification.from_json(json) +# print the JSON string representation of the object +print(CryptoVerification.to_json()) + +# convert the object into a dict +crypto_verification_dict = crypto_verification_instance.to_dict() +# create an instance of CryptoVerification from a dict +crypto_verification_from_dict = CryptoVerification.from_dict(crypto_verification_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/DailyAnalysesCountOutputBody.md b/docs/DailyAnalysesCountOutputBody.md new file mode 100644 index 0000000..6f9d05b --- /dev/null +++ b/docs/DailyAnalysesCountOutputBody.md @@ -0,0 +1,29 @@ +# DailyAnalysesCountOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**daily_counts** | [**List[DailyCountBody]**](DailyCountBody.md) | One entry per day of the last 31 days, oldest first | + +## Example + +```python +from revengai.models.daily_analyses_count_output_body import DailyAnalysesCountOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of DailyAnalysesCountOutputBody from a JSON string +daily_analyses_count_output_body_instance = DailyAnalysesCountOutputBody.from_json(json) +# print the JSON string representation of the object +print(DailyAnalysesCountOutputBody.to_json()) + +# convert the object into a dict +daily_analyses_count_output_body_dict = daily_analyses_count_output_body_instance.to_dict() +# create an instance of DailyAnalysesCountOutputBody from a dict +daily_analyses_count_output_body_from_dict = DailyAnalysesCountOutputBody.from_dict(daily_analyses_count_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/DailyCountBody.md b/docs/DailyCountBody.md new file mode 100644 index 0000000..7c187c8 --- /dev/null +++ b/docs/DailyCountBody.md @@ -0,0 +1,30 @@ +# DailyCountBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | Analyses the user created that day | +**day** | **datetime** | Day this count covers, at midnight UTC | + +## Example + +```python +from revengai.models.daily_count_body import DailyCountBody + +# TODO update the JSON string below +json = "{}" +# create an instance of DailyCountBody from a JSON string +daily_count_body_instance = DailyCountBody.from_json(json) +# print the JSON string representation of the object +print(DailyCountBody.to_json()) + +# convert the object into a dict +daily_count_body_dict = daily_count_body_instance.to_dict() +# create an instance of DailyCountBody from a dict +daily_count_body_from_dict = DailyCountBody.from_dict(daily_count_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/ExecutionFinding.md b/docs/ExecutionFinding.md index 4e2f3a6..2d6b3f6 100644 --- a/docs/ExecutionFinding.md +++ b/docs/ExecutionFinding.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **function_name** | **str** | Name of the function the finding was reported in | **function_size** | **int** | Size of the function in bytes | **sources** | **List[str]** | Distinct execution sources evidenced by this function | +**verification** | [**ExecutionVerification**](ExecutionVerification.md) | LLM verdict checking this finding against its decompilation. Present only when the run verified this finding. | [optional] ## Example diff --git a/docs/ExecutionVerification.md b/docs/ExecutionVerification.md new file mode 100644 index 0000000..6ca0336 --- /dev/null +++ b/docs/ExecutionVerification.md @@ -0,0 +1,31 @@ +# ExecutionVerification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**confidence** | **str** | LLM's confidence in the verdict. Absent when verified is null. | [optional] +**reasoning** | **str** | LLM's explanation for the verdict, or the reason verification could not be completed | +**verified** | **bool** | Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped | + +## Example + +```python +from revengai.models.execution_verification import ExecutionVerification + +# TODO update the JSON string below +json = "{}" +# create an instance of ExecutionVerification from a JSON string +execution_verification_instance = ExecutionVerification.from_json(json) +# print the JSON string representation of the object +print(ExecutionVerification.to_json()) + +# convert the object into a dict +execution_verification_dict = execution_verification_instance.to_dict() +# create an instance of ExecutionVerification from a dict +execution_verification_from_dict = ExecutionVerification.from_dict(execution_verification_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/FilesystemFinding.md b/docs/FilesystemFinding.md index 0d83263..47e1f77 100644 --- a/docs/FilesystemFinding.md +++ b/docs/FilesystemFinding.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **function_size** | **int** | Size of the function in bytes | **modifies** | **bool** | Whether this function evidences modifying the filesystem rather than only observing it | **sources** | **List[str]** | Distinct filesystem sources evidenced by this function | +**verification** | [**FilesystemVerification**](FilesystemVerification.md) | LLM verdict checking this finding against its decompilation. Present only when the run verified this finding. | [optional] ## Example diff --git a/docs/FilesystemVerification.md b/docs/FilesystemVerification.md new file mode 100644 index 0000000..76cbba5 --- /dev/null +++ b/docs/FilesystemVerification.md @@ -0,0 +1,31 @@ +# FilesystemVerification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**confidence** | **str** | LLM's confidence in the verdict. Absent when verified is null. | [optional] +**reasoning** | **str** | LLM's explanation for the verdict, or the reason verification could not be completed | +**verified** | **bool** | Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped | + +## Example + +```python +from revengai.models.filesystem_verification import FilesystemVerification + +# TODO update the JSON string below +json = "{}" +# create an instance of FilesystemVerification from a JSON string +filesystem_verification_instance = FilesystemVerification.from_json(json) +# print the JSON string representation of the object +print(FilesystemVerification.to_json()) + +# convert the object into a dict +filesystem_verification_dict = filesystem_verification_instance.to_dict() +# create an instance of FilesystemVerification from a dict +filesystem_verification_from_dict = FilesystemVerification.from_dict(filesystem_verification_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/FunctionSearchResultBody.md b/docs/FunctionSearchResultBody.md new file mode 100644 index 0000000..0bae350 --- /dev/null +++ b/docs/FunctionSearchResultBody.md @@ -0,0 +1,35 @@ +# FunctionSearchResultBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_name** | **str** | | +**created_at** | **datetime** | | +**function_id** | **int** | | +**function_name** | **str** | | +**model_id** | **int** | | +**model_name** | **str** | | +**owned_by** | **str** | | + +## Example + +```python +from revengai.models.function_search_result_body import FunctionSearchResultBody + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionSearchResultBody from a JSON string +function_search_result_body_instance = FunctionSearchResultBody.from_json(json) +# print the JSON string representation of the object +print(FunctionSearchResultBody.to_json()) + +# convert the object into a dict +function_search_result_body_dict = function_search_result_body_instance.to_dict() +# create an instance of FunctionSearchResultBody from a dict +function_search_result_body_from_dict = FunctionSearchResultBody.from_dict(function_search_result_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/FunctionsAIDecompilationApi.md b/docs/FunctionsAIDecompilationApi.md index e42c6a2..3838a6d 100644 --- a/docs/FunctionsAIDecompilationApi.md +++ b/docs/FunctionsAIDecompilationApi.md @@ -18,6 +18,7 @@ Method | HTTP request | Description [**regenerate_ai_decompilation_summary**](FunctionsAIDecompilationApi.md#regenerate_ai_decompilation_summary) | **POST** /v3/functions/{function_id}/ai-decompilation/summary | Regenerate AI decompilation summary [**stream_ai_decompilation**](FunctionsAIDecompilationApi.md#stream_ai_decompilation) | **GET** /v3/functions/{function_id}/ai-decompilation/events | Stream live AI decompilation output (SSE) [**upsert_ai_decompilation_rating**](FunctionsAIDecompilationApi.md#upsert_ai_decompilation_rating) | **PATCH** /v2/functions/{function_id}/ai-decompilation/rating | Upsert rating for AI decompilation +[**v3_accept_ai_decompilation_type_suggestions**](FunctionsAIDecompilationApi.md#v3_accept_ai_decompilation_type_suggestions) | **POST** /v3/functions/{function_id}/ai-decompilation/type-suggestions/accept | Accept AI decompilation type suggestions [**v3_get_ai_decompilation_line_attributions**](FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_line_attributions) | **GET** /v3/functions/{function_id}/ai-decompilation/line-attributions | Get AI decompilation line attributions [**v3_get_ai_decompilation_tokens**](FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_tokens) | **GET** /v3/functions/{function_id}/ai-decompilation/tokens | Get AI decompilation tokens and user overrides [**v3_get_ai_decompilation_type_suggestions**](FunctionsAIDecompilationApi.md#v3_get_ai_decompilation_type_suggestions) | **GET** /v3/functions/{function_id}/ai-decompilation/type-suggestions | Get AI decompilation type suggestions @@ -1330,6 +1331,112 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_accept_ai_decompilation_type_suggestions** +> AcceptTypeSuggestionsOutputBody v3_accept_ai_decompilation_type_suggestions(function_id, accept_type_suggestions_input_body) + +Accept AI decompilation type suggestions + +Stores the named type suggestions as data types of this function's analysis, with a `source_type` of `AI_DECOMP` and this function as their `source_function_id`. + +Each suggestion is stored as the type suggestions endpoint renders it: a `STRUCT` where members were placed, a `TYPEDEF` where the suggestion is a name for a scalar, and an `UNKNOWN` type where nothing gave it a shape. A member with no offset or width is left out and counted in `skipped_members`. A type expression a member names is matched against the analysis by name alone and created where nothing matches: `char *` creates a `char` `BASE` type and a `POINTER` type pointing at it, reusing either where the analysis already holds it. A member naming another suggestion accepted by the same request resolves to it. Only a trailing `*` is taken apart, so a name like `int &` stands for one type. + +No size is stored: the widths a suggestion carries are lower bounds rather than the type's own. A suggestion the analysis already holds a type of that name and kind for resolves to it, so repeating a request stores nothing further. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request +- `409` [`CONFLICT`](/errors/CONFLICT) — Conflict +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed +- `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.accept_type_suggestions_input_body import AcceptTypeSuggestionsInputBody +from revengai.models.accept_type_suggestions_output_body import AcceptTypeSuggestionsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsAIDecompilationApi(api_client) + function_id = 56 # int | Function ID + accept_type_suggestions_input_body = revengai.AcceptTypeSuggestionsInputBody() # AcceptTypeSuggestionsInputBody | + + try: + # Accept AI decompilation type suggestions + api_response = api_instance.v3_accept_ai_decompilation_type_suggestions(function_id, accept_type_suggestions_input_body) + print("The response of FunctionsAIDecompilationApi->v3_accept_ai_decompilation_type_suggestions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsAIDecompilationApi->v3_accept_ai_decompilation_type_suggestions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_id** | **int**| Function ID | + **accept_type_suggestions_input_body** | [**AcceptTypeSuggestionsInputBody**](AcceptTypeSuggestionsInputBody.md)| | + +### Return type + +[**AcceptTypeSuggestionsOutputBody**](AcceptTypeSuggestionsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **v3_get_ai_decompilation_line_attributions** > LineAttributionsData v3_get_ai_decompilation_line_attributions(function_id) diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 46552eb..648307a 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -28,6 +28,7 @@ Method | HTTP request | Description [**list_imported_functions**](FunctionsCoreApi.md#list_imported_functions) | **GET** /v3/analyses/{analysis_id}/imported-functions | List imported 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 [**v3_canonicalize_function_names**](FunctionsCoreApi.md#v3_canonicalize_function_names) | **POST** /v3/functions/canonical-names | Canonicalize a batch of function names +[**v3_search_functions**](FunctionsCoreApi.md#v3_search_functions) | **GET** /v3/functions | Search functions # **add_function_callee** @@ -2256,3 +2257,99 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_search_functions** +> SearchFunctionsOutputBody v3_search_functions(partial_name=partial_name, model_name=model_name, limit=limit, offset=offset) + +Search functions + +Searches for functions visible to the caller. At least one of partial_name or model_name must be provided. + +**Error codes:** +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.search_functions_output_body import SearchFunctionsOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + partial_name = 'partial_name_example' # str | Partial or full function name to search for (optional) + model_name = 'model_name_example' # str | Restrict results to functions analysed with this model (optional) + limit = 10 # int | Maximum results to return (optional) (default to 10) + offset = 0 # int | Number of results to skip (optional) (default to 0) + + try: + # Search functions + api_response = api_instance.v3_search_functions(partial_name=partial_name, model_name=model_name, limit=limit, offset=offset) + print("The response of FunctionsCoreApi->v3_search_functions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->v3_search_functions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **partial_name** | **str**| Partial or full function name to search for | [optional] + **model_name** | **str**| Restrict results to functions analysed with this model | [optional] + **limit** | **int**| Maximum results to return | [optional] [default to 10] + **offset** | **int**| Number of results to skip | [optional] [default to 0] + +### Return type + +[**SearchFunctionsOutputBody**](SearchFunctionsOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**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/GetBinaryExternalsOutputBody.md b/docs/GetBinaryExternalsOutputBody.md new file mode 100644 index 0000000..748d1ff --- /dev/null +++ b/docs/GetBinaryExternalsOutputBody.md @@ -0,0 +1,30 @@ +# GetBinaryExternalsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary_id** | **int** | | +**externals** | [**BinaryExternalsBody**](BinaryExternalsBody.md) | Null until at least one external lookup has run for this binary's content hash | + +## Example + +```python +from revengai.models.get_binary_externals_output_body import GetBinaryExternalsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of GetBinaryExternalsOutputBody from a JSON string +get_binary_externals_output_body_instance = GetBinaryExternalsOutputBody.from_json(json) +# print the JSON string representation of the object +print(GetBinaryExternalsOutputBody.to_json()) + +# convert the object into a dict +get_binary_externals_output_body_dict = get_binary_externals_output_body_instance.to_dict() +# create an instance of GetBinaryExternalsOutputBody from a dict +get_binary_externals_output_body_from_dict = GetBinaryExternalsOutputBody.from_dict(get_binary_externals_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/GetTokensResponse.md b/docs/GetTokensResponse.md index 26b39c8..22f6c56 100644 --- a/docs/GetTokensResponse.md +++ b/docs/GetTokensResponse.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **ai_decomp** | **str** | Tokenised AI-decompilation. Includes generated comments. Empty until a run has succeeded. | **analysis_id** | **int** | Analysis the function belongs to. Scopes every data_type_id below. | **placeholder_to_rendered_token** | [**Dict[str, RenderedToken]**](RenderedToken.md) | Each placeholder token mapped to the value the server would render in its place, and the record it refers to. Null until a run has succeeded. | -**placeholder_to_user_override** | [**Dict[str, Token]**](Token.md) | The caller's own overrides, keyed by token. Null until a run has succeeded. | +**placeholder_to_user_override** | [**Dict[str, Token]**](Token.md) | The overrides on this function, keyed by token, each carrying who chose it. Null until a run has succeeded. | ## Example diff --git a/docs/NetworkingFinding.md b/docs/NetworkingFinding.md index c5d35bb..33d6443 100644 --- a/docs/NetworkingFinding.md +++ b/docs/NetworkingFinding.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **network_calls** | [**List[NetworkingCall]**](NetworkingCall.md) | Matches against names this function calls | [optional] **remote** | **bool** | Whether this function evidences remote communication rather than only supporting it | **sources** | **List[str]** | Distinct networking sources evidenced by this function | +**verification** | [**NetworkingVerification**](NetworkingVerification.md) | LLM verdict checking this finding against its decompilation. Present only when the run verified this finding. | [optional] ## Example diff --git a/docs/NetworkingVerification.md b/docs/NetworkingVerification.md new file mode 100644 index 0000000..212ac82 --- /dev/null +++ b/docs/NetworkingVerification.md @@ -0,0 +1,31 @@ +# NetworkingVerification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**confidence** | **str** | LLM's confidence in the verdict. Absent when verified is null. | [optional] +**reasoning** | **str** | LLM's explanation for the verdict, or the reason verification could not be completed | +**verified** | **bool** | Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped | + +## Example + +```python +from revengai.models.networking_verification import NetworkingVerification + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkingVerification from a JSON string +networking_verification_instance = NetworkingVerification.from_json(json) +# print the JSON string representation of the object +print(NetworkingVerification.to_json()) + +# convert the object into a dict +networking_verification_dict = networking_verification_instance.to_dict() +# create an instance of NetworkingVerification from a dict +networking_verification_from_dict = NetworkingVerification.from_dict(networking_verification_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/ReportAnalysisBody.md b/docs/ReportAnalysisBody.md new file mode 100644 index 0000000..3ce7a69 --- /dev/null +++ b/docs/ReportAnalysisBody.md @@ -0,0 +1,30 @@ +# ReportAnalysisBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**completed** | **int** | REPORT_ANALYSIS agent tasks completed that day | +**software_types** | [**SoftwareTypeCountsBody**](SoftwareTypeCountsBody.md) | Breakdown of completed reports by the software type the agent classified | + +## Example + +```python +from revengai.models.report_analysis_body import ReportAnalysisBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ReportAnalysisBody from a JSON string +report_analysis_body_instance = ReportAnalysisBody.from_json(json) +# print the JSON string representation of the object +print(ReportAnalysisBody.to_json()) + +# convert the object into a dict +report_analysis_body_dict = report_analysis_body_instance.to_dict() +# create an instance of ReportAnalysisBody from a dict +report_analysis_body_from_dict = ReportAnalysisBody.from_dict(report_analysis_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/SearchBinariesOutputBody.md b/docs/SearchBinariesOutputBody.md new file mode 100644 index 0000000..27c2b5b --- /dev/null +++ b/docs/SearchBinariesOutputBody.md @@ -0,0 +1,32 @@ +# SearchBinariesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_next_page** | **bool** | | +**page_number** | **int** | | +**page_size** | **int** | | +**results** | [**List[BinarySearchResultBody]**](BinarySearchResultBody.md) | | + +## Example + +```python +from revengai.models.search_binaries_output_body import SearchBinariesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchBinariesOutputBody from a JSON string +search_binaries_output_body_instance = SearchBinariesOutputBody.from_json(json) +# print the JSON string representation of the object +print(SearchBinariesOutputBody.to_json()) + +# convert the object into a dict +search_binaries_output_body_dict = search_binaries_output_body_instance.to_dict() +# create an instance of SearchBinariesOutputBody from a dict +search_binaries_output_body_from_dict = SearchBinariesOutputBody.from_dict(search_binaries_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/SearchFunctionsOutputBody.md b/docs/SearchFunctionsOutputBody.md new file mode 100644 index 0000000..bf902a7 --- /dev/null +++ b/docs/SearchFunctionsOutputBody.md @@ -0,0 +1,32 @@ +# SearchFunctionsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_next_page** | **bool** | | +**page_number** | **int** | | +**page_size** | **int** | | +**results** | [**List[FunctionSearchResultBody]**](FunctionSearchResultBody.md) | | + +## Example + +```python +from revengai.models.search_functions_output_body import SearchFunctionsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchFunctionsOutputBody from a JSON string +search_functions_output_body_instance = SearchFunctionsOutputBody.from_json(json) +# print the JSON string representation of the object +print(SearchFunctionsOutputBody.to_json()) + +# convert the object into a dict +search_functions_output_body_dict = search_functions_output_body_instance.to_dict() +# create an instance of SearchFunctionsOutputBody from a dict +search_functions_output_body_from_dict = SearchFunctionsOutputBody.from_dict(search_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/SearchTagsOutputBody.md b/docs/SearchTagsOutputBody.md new file mode 100644 index 0000000..1ef1cba --- /dev/null +++ b/docs/SearchTagsOutputBody.md @@ -0,0 +1,32 @@ +# SearchTagsOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_next_page** | **bool** | | +**page_number** | **int** | | +**page_size** | **int** | | +**results** | [**List[TagSearchResultBody]**](TagSearchResultBody.md) | | + +## Example + +```python +from revengai.models.search_tags_output_body import SearchTagsOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchTagsOutputBody from a JSON string +search_tags_output_body_instance = SearchTagsOutputBody.from_json(json) +# print the JSON string representation of the object +print(SearchTagsOutputBody.to_json()) + +# convert the object into a dict +search_tags_output_body_dict = search_tags_output_body_instance.to_dict() +# create an instance of SearchTagsOutputBody from a dict +search_tags_output_body_from_dict = SearchTagsOutputBody.from_dict(search_tags_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/SoftwareTypeCountsBody.md b/docs/SoftwareTypeCountsBody.md new file mode 100644 index 0000000..7085c01 --- /dev/null +++ b/docs/SoftwareTypeCountsBody.md @@ -0,0 +1,33 @@ +# SoftwareTypeCountsBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**benign** | **int** | Reports classifying the software as benign | +**legitimate** | **int** | Reports classifying the software as legitimate | +**legitimate_software_backdoor** | **int** | Reports classifying the software as a legitimate backdoor | +**malicious** | **int** | Reports classifying the software as malicious | +**potentially_unwanted_application** | **int** | Reports classifying the software as a potentially unwanted application | + +## Example + +```python +from revengai.models.software_type_counts_body import SoftwareTypeCountsBody + +# TODO update the JSON string below +json = "{}" +# create an instance of SoftwareTypeCountsBody from a JSON string +software_type_counts_body_instance = SoftwareTypeCountsBody.from_json(json) +# print the JSON string representation of the object +print(SoftwareTypeCountsBody.to_json()) + +# convert the object into a dict +software_type_counts_body_dict = software_type_counts_body_instance.to_dict() +# create an instance of SoftwareTypeCountsBody from a dict +software_type_counts_body_from_dict = SoftwareTypeCountsBody.from_dict(software_type_counts_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/TagSearchResultBody.md b/docs/TagSearchResultBody.md new file mode 100644 index 0000000..dd88c65 --- /dev/null +++ b/docs/TagSearchResultBody.md @@ -0,0 +1,30 @@ +# TagSearchResultBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tag** | **str** | | +**tag_id** | **int** | | + +## Example + +```python +from revengai.models.tag_search_result_body import TagSearchResultBody + +# TODO update the JSON string below +json = "{}" +# create an instance of TagSearchResultBody from a JSON string +tag_search_result_body_instance = TagSearchResultBody.from_json(json) +# print the JSON string representation of the object +print(TagSearchResultBody.to_json()) + +# convert the object into a dict +tag_search_result_body_dict = tag_search_result_body_instance.to_dict() +# create an instance of TagSearchResultBody from a dict +tag_search_result_body_from_dict = TagSearchResultBody.from_dict(tag_search_result_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/Token.md b/docs/Token.md index 26af7e1..401b1a9 100644 --- a/docs/Token.md +++ b/docs/Token.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**source** | **str** | Who chose this override. Response only; ignored in a request. | [optional] **value** | **str** | Name the token resolves to. An empty string in a request removes the override. | ## Example diff --git a/docs/UpdateTagsInputBody.md b/docs/UpdateTagsInputBody.md new file mode 100644 index 0000000..7431118 --- /dev/null +++ b/docs/UpdateTagsInputBody.md @@ -0,0 +1,29 @@ +# UpdateTagsInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | **List[str]** | The complete set of user tags the analysis' binary should carry after this call | + +## Example + +```python +from revengai.models.update_tags_input_body import UpdateTagsInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateTagsInputBody from a JSON string +update_tags_input_body_instance = UpdateTagsInputBody.from_json(json) +# print the JSON string representation of the object +print(UpdateTagsInputBody.to_json()) + +# convert the object into a dict +update_tags_input_body_dict = update_tags_input_body_instance.to_dict() +# create an instance of UpdateTagsInputBody from a dict +update_tags_input_body_from_dict = UpdateTagsInputBody.from_dict(update_tags_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/UpsertOverridesData.md b/docs/UpsertOverridesData.md index 7174d0f..fbdf6d7 100644 --- a/docs/UpsertOverridesData.md +++ b/docs/UpsertOverridesData.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**placeholder_to_user_override** | [**Dict[str, Token]**](Token.md) | Every override on the function after applying this request, keyed by placeholder token. | +**placeholder_to_user_override** | [**Dict[str, Token]**](Token.md) | Every override on the function after applying this request, keyed by placeholder token, each carrying who chose it. | ## Example diff --git a/docs/WorkflowDayBody.md b/docs/WorkflowDayBody.md new file mode 100644 index 0000000..0a5f521 --- /dev/null +++ b/docs/WorkflowDayBody.md @@ -0,0 +1,31 @@ +# WorkflowDayBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analyse_capabilities** | [**AnalyseCapabilitiesBody**](AnalyseCapabilitiesBody.md) | ANALYSE_CAPABILITIES agent-task stats for the day | +**var_date** | **str** | Day this entry covers | +**report_analysis** | [**ReportAnalysisBody**](ReportAnalysisBody.md) | REPORT_ANALYSIS agent-task stats for the day | + +## Example + +```python +from revengai.models.workflow_day_body import WorkflowDayBody + +# TODO update the JSON string below +json = "{}" +# create an instance of WorkflowDayBody from a JSON string +workflow_day_body_instance = WorkflowDayBody.from_json(json) +# print the JSON string representation of the object +print(WorkflowDayBody.to_json()) + +# convert the object into a dict +workflow_day_body_dict = workflow_day_body_instance.to_dict() +# create an instance of WorkflowDayBody from a dict +workflow_day_body_from_dict = WorkflowDayBody.from_dict(workflow_day_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/XrefFromBody.md b/docs/XrefFromBody.md new file mode 100644 index 0000000..926d22c --- /dev/null +++ b/docs/XrefFromBody.md @@ -0,0 +1,37 @@ +# XrefFromBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_call** | **bool** | True when the xref is a call instruction | +**is_data** | **bool** | True when the xref targets data rather than code | +**is_scalar** | **bool** | True when the xref is a scalar constant | +**is_string** | **bool** | True when the xref targets a string | +**orig_str_encoding** | **str** | String encoding, set only when is_string is true | [optional] +**raw_data** | **str** | Raw bytes at the xref target, when captured | [optional] +**segment** | [**XrefSegmentBody**](XrefSegmentBody.md) | Memory segment the xref target sits in | [optional] +**value** | **str** | The xref's resolved value, when the sequencer could determine one | [optional] +**xref_to** | **int** | Address the reference targets | + +## Example + +```python +from revengai.models.xref_from_body import XrefFromBody + +# TODO update the JSON string below +json = "{}" +# create an instance of XrefFromBody from a JSON string +xref_from_body_instance = XrefFromBody.from_json(json) +# print the JSON string representation of the object +print(XrefFromBody.to_json()) + +# convert the object into a dict +xref_from_body_dict = xref_from_body_instance.to_dict() +# create an instance of XrefFromBody from a dict +xref_from_body_from_dict = XrefFromBody.from_dict(xref_from_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/XrefIntoBody.md b/docs/XrefIntoBody.md new file mode 100644 index 0000000..b664944 --- /dev/null +++ b/docs/XrefIntoBody.md @@ -0,0 +1,37 @@ +# XrefIntoBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_call** | **bool** | True when the xref is a call instruction | +**is_data** | **bool** | True when the xref targets data rather than code | +**is_scalar** | **bool** | True when the xref is a scalar constant | +**is_string** | **bool** | True when the xref targets a string | +**orig_str_encoding** | **str** | String encoding, set only when is_string is true | [optional] +**raw_data** | **str** | Raw bytes at the xref target, when captured | [optional] +**segment** | [**XrefSegmentBody**](XrefSegmentBody.md) | Memory segment the xref target sits in | [optional] +**value** | **str** | The xref's resolved value, when the sequencer could determine one | [optional] +**xref_from** | **int** | Address the reference originates from | + +## Example + +```python +from revengai.models.xref_into_body import XrefIntoBody + +# TODO update the JSON string below +json = "{}" +# create an instance of XrefIntoBody from a JSON string +xref_into_body_instance = XrefIntoBody.from_json(json) +# print the JSON string representation of the object +print(XrefIntoBody.to_json()) + +# convert the object into a dict +xref_into_body_dict = xref_into_body_instance.to_dict() +# create an instance of XrefIntoBody from a dict +xref_into_body_from_dict = XrefIntoBody.from_dict(xref_into_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/XrefSegmentBody.md b/docs/XrefSegmentBody.md new file mode 100644 index 0000000..9be5d1c --- /dev/null +++ b/docs/XrefSegmentBody.md @@ -0,0 +1,35 @@ +# XrefSegmentBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**end** | **int** | End address of the segment, inclusive | +**var_exec** | **bool** | True when the segment is executable | +**kind** | **str** | Coarse classification of the segment | +**name** | **str** | Segment name | +**read** | **bool** | True when the segment is readable | +**start** | **int** | Start address of the segment | +**write** | **bool** | True when the segment is writable | + +## Example + +```python +from revengai.models.xref_segment_body import XrefSegmentBody + +# TODO update the JSON string below +json = "{}" +# create an instance of XrefSegmentBody from a JSON string +xref_segment_body_instance = XrefSegmentBody.from_json(json) +# print the JSON string representation of the object +print(XrefSegmentBody.to_json()) + +# convert the object into a dict +xref_segment_body_dict = xref_segment_body_instance.to_dict() +# create an instance of XrefSegmentBody from a dict +xref_segment_body_from_dict = XrefSegmentBody.from_dict(xref_segment_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 e37ea7a..0822269 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v4.54.0" +__version__ = "v4.60.1" # Define package exports __all__ = [ @@ -47,6 +47,9 @@ "ApiAttributeError", "ApiException", "APIError", + "AcceptTypeSuggestionsInputBody", + "AcceptTypeSuggestionsOutputBody", + "AcceptedType", "AddCalleeInputBody", "AddCollectionBinariesInputBody", "AddIssuerDomainInputBody", @@ -55,7 +58,9 @@ "AddUserStringInputBody", "AddUserStringToFunctionInputBody", "AdditionalDetailsStatusResponse", + "AgentWorkflowUsageOutputBody", "AiDecompilationRating", + "AnalyseCapabilitiesBody", "AnalysisAccessBody", "AnalysisAccessInfo", "AnalysisBasicInfoOutputBody", @@ -91,9 +96,11 @@ "AnalysisStringsStatusResponse", "AnalysisTagBody", "AnalysisTags", + "AnalysisTagsOutputBody", "AnalysisUpdateRequest", "AnalysisUpdateTagsRequest", "AnalysisUpdateTagsResponse", + "AnalysisXrefOutputBody", "ApiCall", "ApiCombinationEvidence", "AppApiRestV2AgentSchemaCapability", @@ -190,11 +197,16 @@ "BinaryDetailsResponse", "BinaryExportMetadata", "BinaryExportResult", + "BinaryExternalsBody", "BinaryExternalsResponse", "BinarySearchResponse", "BinarySearchResult", + "BinarySearchResultBody", "BinaryTaskStatus", "BitfieldDataType", + "BulkAddTagsInputBody", + "BulkAddTagsOutputBody", + "BulkAddTagsResultBody", "BulkCreateUserResult", "BulkCreateUsersOutputBody", "BulkDeleteAnalysesInputBody", @@ -272,6 +284,8 @@ "CreateStructDataType", "CreateTeamInputBody", "CreateTypedefDataType", + "CreateURLRequest", + "CreateURLResponse", "CreateUnionDataType", "CreateUnknownDataType", "CreateUserInputBody", @@ -284,6 +298,9 @@ "CryptoFinding", "CryptoScanMetadata", "CryptoScanResult", + "CryptoVerification", + "DailyAnalysesCountOutputBody", + "DailyCountBody", "DataTypeEntry", "DataTypeEnumValueEntry", "DataTypeFunctionEntry", @@ -357,6 +374,7 @@ "ExecutionFinding", "ExecutionScanMetadata", "ExecutionScanResult", + "ExecutionVerification", "ExportModel", "ExternalResponse", "ExtractedBinary", @@ -375,6 +393,7 @@ "FilesystemFinding", "FilesystemScanMetadata", "FilesystemScanResult", + "FilesystemVerification", "Filters", "Finding", "FindingEvidenceInner", @@ -397,6 +416,7 @@ "FunctionRenameMap", "FunctionSearchResponse", "FunctionSearchResult", + "FunctionSearchResultBody", "FunctionSignatureBody", "FunctionSignatureEntry", "FunctionSignatureVersion", @@ -416,6 +436,7 @@ "GetAiDecompilationRatingResponse", "GetAnalysisLogsOutputBody", "GetAnalysisStringsStatusOutputBody", + "GetBinaryExternalsOutputBody", "GetCollectionOutputBody", "GetConfigOutputBody", "GetDataTypeHistoryBody", @@ -497,6 +518,7 @@ "NetworkingFinding", "NetworkingScanMetadata", "NetworkingScanResult", + "NetworkingVerification", "OIDCCallbackInputBody", "OperationBinaryExportMetadataBinaryExportResult", "OperationCreateMetadataCreateResult", @@ -568,6 +590,7 @@ "RenameOutputBody", "RenameUnnamedFunctionsResult", "RenderedToken", + "ReportAnalysisBody", "ReportAnalysisResponse", "ReportEvent", "ReportInfo", @@ -589,6 +612,9 @@ "ScrapeThirdPartyConfig", "ScreenshotEntry", "ScreenshotsIndex", + "SearchBinariesOutputBody", + "SearchFunctionsOutputBody", + "SearchTagsOutputBody", "SecretsAgentResponse", "SectionModel", "SecurityFinding", @@ -607,6 +633,7 @@ "SingleCodeSignatureModel", "SinglePDBEntryModel", "SingleSectionModel", + "SoftwareTypeCountsBody", "SourceDeltaEvent", "SourceResetEvent", "SseEventContextCompactedData", @@ -661,6 +688,7 @@ "TagResponse", "TagSearchResponse", "TagSearchResult", + "TagSearchResultBody", "TaskResponse", "TaskStatus", "TaskStatusResponse", @@ -711,6 +739,7 @@ "UpdatePointerDataType", "UpdateProfileInputBody", "UpdateStructDataType", + "UpdateTagsInputBody", "UpdateTeamInputBody", "UpdateTypedefDataType", "UpdateUnionDataType", @@ -731,10 +760,14 @@ "UserIdentity", "UserProfile", "WarningEvent", + "WorkflowDayBody", "WorkflowProgress", "Workspace", + "XrefFromBody", "XrefFromResponse", + "XrefIntoBody", "XrefResponse", + "XrefSegmentBody", "XrefToResponse", ] @@ -773,6 +806,9 @@ # import models into sdk package from revengai.models.api_error import APIError as APIError +from revengai.models.accept_type_suggestions_input_body import AcceptTypeSuggestionsInputBody as AcceptTypeSuggestionsInputBody +from revengai.models.accept_type_suggestions_output_body import AcceptTypeSuggestionsOutputBody as AcceptTypeSuggestionsOutputBody +from revengai.models.accepted_type import AcceptedType as AcceptedType from revengai.models.add_callee_input_body import AddCalleeInputBody as AddCalleeInputBody from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody as AddCollectionBinariesInputBody from revengai.models.add_issuer_domain_input_body import AddIssuerDomainInputBody as AddIssuerDomainInputBody @@ -781,7 +817,9 @@ from revengai.models.add_user_string_input_body import AddUserStringInputBody as AddUserStringInputBody from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody as AddUserStringToFunctionInputBody from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse as AdditionalDetailsStatusResponse +from revengai.models.agent_workflow_usage_output_body import AgentWorkflowUsageOutputBody as AgentWorkflowUsageOutputBody from revengai.models.ai_decompilation_rating import AiDecompilationRating as AiDecompilationRating +from revengai.models.analyse_capabilities_body import AnalyseCapabilitiesBody as AnalyseCapabilitiesBody from revengai.models.analysis_access_body import AnalysisAccessBody as AnalysisAccessBody from revengai.models.analysis_access_info import AnalysisAccessInfo as AnalysisAccessInfo from revengai.models.analysis_basic_info_output_body import AnalysisBasicInfoOutputBody as AnalysisBasicInfoOutputBody @@ -817,9 +855,11 @@ from revengai.models.analysis_strings_status_response import AnalysisStringsStatusResponse as AnalysisStringsStatusResponse from revengai.models.analysis_tag_body import AnalysisTagBody as AnalysisTagBody from revengai.models.analysis_tags import AnalysisTags as AnalysisTags +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody as AnalysisTagsOutputBody from revengai.models.analysis_update_request import AnalysisUpdateRequest as AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest as AnalysisUpdateTagsRequest from revengai.models.analysis_update_tags_response import AnalysisUpdateTagsResponse as AnalysisUpdateTagsResponse +from revengai.models.analysis_xref_output_body import AnalysisXrefOutputBody as AnalysisXrefOutputBody from revengai.models.api_call import ApiCall as ApiCall from revengai.models.api_combination_evidence import ApiCombinationEvidence as ApiCombinationEvidence from revengai.models.app_api_rest_v2_agent_schema_capability import AppApiRestV2AgentSchemaCapability as AppApiRestV2AgentSchemaCapability @@ -916,11 +956,16 @@ from revengai.models.binary_details_response import BinaryDetailsResponse as BinaryDetailsResponse from revengai.models.binary_export_metadata import BinaryExportMetadata as BinaryExportMetadata from revengai.models.binary_export_result import BinaryExportResult as BinaryExportResult +from revengai.models.binary_externals_body import BinaryExternalsBody as BinaryExternalsBody from revengai.models.binary_externals_response import BinaryExternalsResponse as BinaryExternalsResponse from revengai.models.binary_search_response import BinarySearchResponse as BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult as BinarySearchResult +from revengai.models.binary_search_result_body import BinarySearchResultBody as BinarySearchResultBody from revengai.models.binary_task_status import BinaryTaskStatus as BinaryTaskStatus from revengai.models.bitfield_data_type import BitfieldDataType as BitfieldDataType +from revengai.models.bulk_add_tags_input_body import BulkAddTagsInputBody as BulkAddTagsInputBody +from revengai.models.bulk_add_tags_output_body import BulkAddTagsOutputBody as BulkAddTagsOutputBody +from revengai.models.bulk_add_tags_result_body import BulkAddTagsResultBody as BulkAddTagsResultBody from revengai.models.bulk_create_user_result import BulkCreateUserResult as BulkCreateUserResult from revengai.models.bulk_create_users_output_body import BulkCreateUsersOutputBody as BulkCreateUsersOutputBody from revengai.models.bulk_delete_analyses_input_body import BulkDeleteAnalysesInputBody as BulkDeleteAnalysesInputBody @@ -998,6 +1043,8 @@ from revengai.models.create_struct_data_type import CreateStructDataType as CreateStructDataType from revengai.models.create_team_input_body import CreateTeamInputBody as CreateTeamInputBody from revengai.models.create_typedef_data_type import CreateTypedefDataType as CreateTypedefDataType +from revengai.models.create_url_request import CreateURLRequest as CreateURLRequest +from revengai.models.create_url_response import CreateURLResponse as CreateURLResponse from revengai.models.create_union_data_type import CreateUnionDataType as CreateUnionDataType from revengai.models.create_unknown_data_type import CreateUnknownDataType as CreateUnknownDataType from revengai.models.create_user_input_body import CreateUserInputBody as CreateUserInputBody @@ -1010,6 +1057,9 @@ from revengai.models.crypto_finding import CryptoFinding as CryptoFinding from revengai.models.crypto_scan_metadata import CryptoScanMetadata as CryptoScanMetadata from revengai.models.crypto_scan_result import CryptoScanResult as CryptoScanResult +from revengai.models.crypto_verification import CryptoVerification as CryptoVerification +from revengai.models.daily_analyses_count_output_body import DailyAnalysesCountOutputBody as DailyAnalysesCountOutputBody +from revengai.models.daily_count_body import DailyCountBody as DailyCountBody from revengai.models.data_type_entry import DataTypeEntry as DataTypeEntry from revengai.models.data_type_enum_value_entry import DataTypeEnumValueEntry as DataTypeEnumValueEntry from revengai.models.data_type_function_entry import DataTypeFunctionEntry as DataTypeFunctionEntry @@ -1083,6 +1133,7 @@ from revengai.models.execution_finding import ExecutionFinding as ExecutionFinding from revengai.models.execution_scan_metadata import ExecutionScanMetadata as ExecutionScanMetadata from revengai.models.execution_scan_result import ExecutionScanResult as ExecutionScanResult +from revengai.models.execution_verification import ExecutionVerification as ExecutionVerification from revengai.models.export_model import ExportModel as ExportModel from revengai.models.external_response import ExternalResponse as ExternalResponse from revengai.models.extracted_binary import ExtractedBinary as ExtractedBinary @@ -1101,6 +1152,7 @@ from revengai.models.filesystem_finding import FilesystemFinding as FilesystemFinding from revengai.models.filesystem_scan_metadata import FilesystemScanMetadata as FilesystemScanMetadata from revengai.models.filesystem_scan_result import FilesystemScanResult as FilesystemScanResult +from revengai.models.filesystem_verification import FilesystemVerification as FilesystemVerification from revengai.models.filters import Filters as Filters from revengai.models.finding import Finding as Finding from revengai.models.finding_evidence_inner import FindingEvidenceInner as FindingEvidenceInner @@ -1123,6 +1175,7 @@ from revengai.models.function_rename_map import FunctionRenameMap as FunctionRenameMap from revengai.models.function_search_response import FunctionSearchResponse as FunctionSearchResponse from revengai.models.function_search_result import FunctionSearchResult as FunctionSearchResult +from revengai.models.function_search_result_body import FunctionSearchResultBody as FunctionSearchResultBody from revengai.models.function_signature_body import FunctionSignatureBody as FunctionSignatureBody from revengai.models.function_signature_entry import FunctionSignatureEntry as FunctionSignatureEntry from revengai.models.function_signature_version import FunctionSignatureVersion as FunctionSignatureVersion @@ -1142,6 +1195,7 @@ from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse as GetAiDecompilationRatingResponse from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody as GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody as GetAnalysisStringsStatusOutputBody +from revengai.models.get_binary_externals_output_body import GetBinaryExternalsOutputBody as GetBinaryExternalsOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody as GetCollectionOutputBody from revengai.models.get_config_output_body import GetConfigOutputBody as GetConfigOutputBody from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody as GetDataTypeHistoryBody @@ -1223,6 +1277,7 @@ from revengai.models.networking_finding import NetworkingFinding as NetworkingFinding from revengai.models.networking_scan_metadata import NetworkingScanMetadata as NetworkingScanMetadata from revengai.models.networking_scan_result import NetworkingScanResult as NetworkingScanResult +from revengai.models.networking_verification import NetworkingVerification as NetworkingVerification from revengai.models.oidc_callback_input_body import OIDCCallbackInputBody as OIDCCallbackInputBody from revengai.models.operation_binary_export_metadata_binary_export_result import OperationBinaryExportMetadataBinaryExportResult as OperationBinaryExportMetadataBinaryExportResult from revengai.models.operation_create_metadata_create_result import OperationCreateMetadataCreateResult as OperationCreateMetadataCreateResult @@ -1294,6 +1349,7 @@ from revengai.models.rename_output_body import RenameOutputBody as RenameOutputBody from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult as RenameUnnamedFunctionsResult from revengai.models.rendered_token import RenderedToken as RenderedToken +from revengai.models.report_analysis_body import ReportAnalysisBody as ReportAnalysisBody from revengai.models.report_analysis_response import ReportAnalysisResponse as ReportAnalysisResponse from revengai.models.report_event import ReportEvent as ReportEvent from revengai.models.report_info import ReportInfo as ReportInfo @@ -1315,6 +1371,9 @@ from revengai.models.scrape_third_party_config import ScrapeThirdPartyConfig as ScrapeThirdPartyConfig from revengai.models.screenshot_entry import ScreenshotEntry as ScreenshotEntry from revengai.models.screenshots_index import ScreenshotsIndex as ScreenshotsIndex +from revengai.models.search_binaries_output_body import SearchBinariesOutputBody as SearchBinariesOutputBody +from revengai.models.search_functions_output_body import SearchFunctionsOutputBody as SearchFunctionsOutputBody +from revengai.models.search_tags_output_body import SearchTagsOutputBody as SearchTagsOutputBody from revengai.models.secrets_agent_response import SecretsAgentResponse as SecretsAgentResponse from revengai.models.section_model import SectionModel as SectionModel from revengai.models.security_finding import SecurityFinding as SecurityFinding @@ -1333,6 +1392,7 @@ from revengai.models.single_code_signature_model import SingleCodeSignatureModel as SingleCodeSignatureModel from revengai.models.single_pdb_entry_model import SinglePDBEntryModel as SinglePDBEntryModel from revengai.models.single_section_model import SingleSectionModel as SingleSectionModel +from revengai.models.software_type_counts_body import SoftwareTypeCountsBody as SoftwareTypeCountsBody from revengai.models.source_delta_event import SourceDeltaEvent as SourceDeltaEvent from revengai.models.source_reset_event import SourceResetEvent as SourceResetEvent from revengai.models.sse_event_context_compacted_data import SseEventContextCompactedData as SseEventContextCompactedData @@ -1387,6 +1447,7 @@ from revengai.models.tag_response import TagResponse as TagResponse from revengai.models.tag_search_response import TagSearchResponse as TagSearchResponse from revengai.models.tag_search_result import TagSearchResult as TagSearchResult +from revengai.models.tag_search_result_body import TagSearchResultBody as TagSearchResultBody from revengai.models.task_response import TaskResponse as TaskResponse from revengai.models.task_status import TaskStatus as TaskStatus from revengai.models.task_status_response import TaskStatusResponse as TaskStatusResponse @@ -1437,6 +1498,7 @@ from revengai.models.update_pointer_data_type import UpdatePointerDataType as UpdatePointerDataType from revengai.models.update_profile_input_body import UpdateProfileInputBody as UpdateProfileInputBody from revengai.models.update_struct_data_type import UpdateStructDataType as UpdateStructDataType +from revengai.models.update_tags_input_body import UpdateTagsInputBody as UpdateTagsInputBody from revengai.models.update_team_input_body import UpdateTeamInputBody as UpdateTeamInputBody from revengai.models.update_typedef_data_type import UpdateTypedefDataType as UpdateTypedefDataType from revengai.models.update_union_data_type import UpdateUnionDataType as UpdateUnionDataType @@ -1457,9 +1519,13 @@ from revengai.models.user_identity import UserIdentity as UserIdentity from revengai.models.user_profile import UserProfile as UserProfile from revengai.models.warning_event import WarningEvent as WarningEvent +from revengai.models.workflow_day_body import WorkflowDayBody as WorkflowDayBody from revengai.models.workflow_progress import WorkflowProgress as WorkflowProgress from revengai.models.workspace import Workspace as Workspace +from revengai.models.xref_from_body import XrefFromBody as XrefFromBody from revengai.models.xref_from_response import XrefFromResponse as XrefFromResponse +from revengai.models.xref_into_body import XrefIntoBody as XrefIntoBody from revengai.models.xref_response import XrefResponse as XrefResponse +from revengai.models.xref_segment_body import XrefSegmentBody as XrefSegmentBody from revengai.models.xref_to_response import XrefToResponse as XrefToResponse diff --git a/revengai/api/analyses_bulk_actions_api.py b/revengai/api/analyses_bulk_actions_api.py index fde5c77..02dbf2a 100644 --- a/revengai/api/analyses_bulk_actions_api.py +++ b/revengai/api/analyses_bulk_actions_api.py @@ -18,6 +18,8 @@ from revengai.models.analysis_bulk_add_tags_request import AnalysisBulkAddTagsRequest from revengai.models.base_response_analysis_bulk_add_tags_response import BaseResponseAnalysisBulkAddTagsResponse from revengai.models.base_response_dict import BaseResponseDict +from revengai.models.bulk_add_tags_input_body import BulkAddTagsInputBody +from revengai.models.bulk_add_tags_output_body import BulkAddTagsOutputBody from revengai.models.bulk_delete_analyses_input_body import BulkDeleteAnalysesInputBody from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest @@ -334,7 +336,7 @@ def bulk_delete_analyses( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseDict: - """Bulk Delete Analyses + """(Deprecated) Bulk Delete Analyses Deletes multiple analyses. User must be the owner of all analyses. @@ -361,6 +363,7 @@ def bulk_delete_analyses( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/delete is deprecated.", DeprecationWarning) _param = self._bulk_delete_analyses_serialize( bulk_delete_analyses_request=bulk_delete_analyses_request, @@ -404,7 +407,7 @@ def bulk_delete_analyses_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseDict]: - """Bulk Delete Analyses + """(Deprecated) Bulk Delete Analyses Deletes multiple analyses. User must be the owner of all analyses. @@ -431,6 +434,7 @@ def bulk_delete_analyses_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/delete is deprecated.", DeprecationWarning) _param = self._bulk_delete_analyses_serialize( bulk_delete_analyses_request=bulk_delete_analyses_request, @@ -474,7 +478,7 @@ def bulk_delete_analyses_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Bulk Delete Analyses + """(Deprecated) Bulk Delete Analyses Deletes multiple analyses. User must be the owner of all analyses. @@ -501,6 +505,7 @@ def bulk_delete_analyses_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/delete is deprecated.", DeprecationWarning) _param = self._bulk_delete_analyses_serialize( bulk_delete_analyses_request=bulk_delete_analyses_request, @@ -601,6 +606,293 @@ def _bulk_delete_analyses_serialize( + @validate_call + def v3_batch_add_analysis_tags( + self, + bulk_add_tags_input_body: BulkAddTagsInputBody, + _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, + ) -> BulkAddTagsOutputBody: + """Add tags to multiple analyses. + + Adds tags (origin RevEng) to every given analysis' binary. The caller must own every analysis, or none are changed. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param bulk_add_tags_input_body: (required) + :type bulk_add_tags_input_body: BulkAddTagsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_batch_add_analysis_tags_serialize( + bulk_add_tags_input_body=bulk_add_tags_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkAddTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_batch_add_analysis_tags_with_http_info( + self, + bulk_add_tags_input_body: BulkAddTagsInputBody, + _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[BulkAddTagsOutputBody]: + """Add tags to multiple analyses. + + Adds tags (origin RevEng) to every given analysis' binary. The caller must own every analysis, or none are changed. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param bulk_add_tags_input_body: (required) + :type bulk_add_tags_input_body: BulkAddTagsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_batch_add_analysis_tags_serialize( + bulk_add_tags_input_body=bulk_add_tags_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkAddTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_batch_add_analysis_tags_without_preload_content( + self, + bulk_add_tags_input_body: BulkAddTagsInputBody, + _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: + """Add tags to multiple analyses. + + Adds tags (origin RevEng) to every given analysis' binary. The caller must own every analysis, or none are changed. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param bulk_add_tags_input_body: (required) + :type bulk_add_tags_input_body: BulkAddTagsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_batch_add_analysis_tags_serialize( + bulk_add_tags_input_body=bulk_add_tags_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkAddTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_batch_add_analysis_tags_serialize( + self, + bulk_add_tags_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 bulk_add_tags_input_body is not None: + _body_params = bulk_add_tags_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/analyses:batchAddTags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_batch_delete_analyses( self, diff --git a/revengai/api/analyses_comments_api.py b/revengai/api/analyses_comments_api.py index fa81c73..c245ffc 100644 --- a/revengai/api/analyses_comments_api.py +++ b/revengai/api/analyses_comments_api.py @@ -59,7 +59,7 @@ def create_analysis_comment( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseCommentResponse: - """Create a comment for this analysis + """(Deprecated) Create a comment for this analysis Creates a comment associated with a specified analysis). @@ -88,6 +88,7 @@ def create_analysis_comment( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/comments is deprecated.", DeprecationWarning) _param = self._create_analysis_comment_serialize( analysis_id=analysis_id, @@ -132,7 +133,7 @@ def create_analysis_comment_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseCommentResponse]: - """Create a comment for this analysis + """(Deprecated) Create a comment for this analysis Creates a comment associated with a specified analysis). @@ -161,6 +162,7 @@ def create_analysis_comment_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/comments is deprecated.", DeprecationWarning) _param = self._create_analysis_comment_serialize( analysis_id=analysis_id, @@ -205,7 +207,7 @@ def create_analysis_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a comment for this analysis + """(Deprecated) Create a comment for this analysis Creates a comment associated with a specified analysis). @@ -234,6 +236,7 @@ def create_analysis_comment_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /v2/analyses/{analysis_id}/comments is deprecated.", DeprecationWarning) _param = self._create_analysis_comment_serialize( analysis_id=analysis_id, @@ -355,7 +358,7 @@ def delete_analysis_comment( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseBool: - """Delete a comment + """(Deprecated) Delete a comment Deletes an existing comment. Users can only delete their own comments. @@ -384,6 +387,7 @@ def delete_analysis_comment( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/comments/{comment_id} is deprecated.", DeprecationWarning) _param = self._delete_analysis_comment_serialize( comment_id=comment_id, @@ -429,7 +433,7 @@ def delete_analysis_comment_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseBool]: - """Delete a comment + """(Deprecated) Delete a comment Deletes an existing comment. Users can only delete their own comments. @@ -458,6 +462,7 @@ def delete_analysis_comment_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/comments/{comment_id} is deprecated.", DeprecationWarning) _param = self._delete_analysis_comment_serialize( comment_id=comment_id, @@ -503,7 +508,7 @@ def delete_analysis_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a comment + """(Deprecated) Delete a comment Deletes an existing comment. Users can only delete their own comments. @@ -532,6 +537,7 @@ def delete_analysis_comment_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id}/comments/{comment_id} is deprecated.", DeprecationWarning) _param = self._delete_analysis_comment_serialize( comment_id=comment_id, @@ -640,7 +646,7 @@ def get_analysis_comments( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseListCommentResponse: - """Get comments for this analysis + """(Deprecated) Get comments for this analysis Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. @@ -667,6 +673,7 @@ def get_analysis_comments( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/comments is deprecated.", DeprecationWarning) _param = self._get_analysis_comments_serialize( analysis_id=analysis_id, @@ -708,7 +715,7 @@ def get_analysis_comments_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseListCommentResponse]: - """Get comments for this analysis + """(Deprecated) Get comments for this analysis Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. @@ -735,6 +742,7 @@ def get_analysis_comments_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/comments is deprecated.", DeprecationWarning) _param = self._get_analysis_comments_serialize( analysis_id=analysis_id, @@ -776,7 +784,7 @@ def get_analysis_comments_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get comments for this analysis + """(Deprecated) Get comments for this analysis Retrieves all comments created for a specific analysis. Only returns comments for resources the requesting user has access to. @@ -803,6 +811,7 @@ def get_analysis_comments_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/comments is deprecated.", DeprecationWarning) _param = self._get_analysis_comments_serialize( analysis_id=analysis_id, @@ -907,7 +916,7 @@ def update_analysis_comment( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseCommentResponse: - """Update a comment + """(Deprecated) Update a comment Updates the content of an existing comment. Users can only update their own comments. @@ -938,6 +947,7 @@ def update_analysis_comment( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/{analysis_id}/comments/{comment_id} is deprecated.", DeprecationWarning) _param = self._update_analysis_comment_serialize( comment_id=comment_id, @@ -985,7 +995,7 @@ def update_analysis_comment_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseCommentResponse]: - """Update a comment + """(Deprecated) Update a comment Updates the content of an existing comment. Users can only update their own comments. @@ -1016,6 +1026,7 @@ def update_analysis_comment_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/{analysis_id}/comments/{comment_id} is deprecated.", DeprecationWarning) _param = self._update_analysis_comment_serialize( comment_id=comment_id, @@ -1063,7 +1074,7 @@ def update_analysis_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a comment + """(Deprecated) Update a comment Updates the content of an existing comment. Users can only update their own comments. @@ -1094,6 +1105,7 @@ def update_analysis_comment_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/{analysis_id}/comments/{comment_id} is deprecated.", DeprecationWarning) _param = self._update_analysis_comment_serialize( comment_id=comment_id, diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 8bee8b6..a74cccf 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -23,6 +23,7 @@ from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_detail_output_body import AnalysisDetailOutputBody from revengai.models.analysis_report import AnalysisReport +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody from revengai.models.analysis_update_request import AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest from revengai.models.app_api_rest_v2_analyses_enums_order_by import AppApiRestV2AnalysesEnumsOrderBy @@ -59,10 +60,12 @@ 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.search_tags_output_body import SearchTagsOutputBody 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.update_analysis_input_body import UpdateAnalysisInputBody +from revengai.models.update_tags_input_body import UpdateTagsInputBody from revengai.models.upgrade_analysis_model_output_body import UpgradeAnalysisModelOutputBody from revengai.models.upload_file_type import UploadFileType from revengai.models.workspace import Workspace @@ -706,7 +709,7 @@ def delete_analysis( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseDict: - """Delete Analysis + """(Deprecated) Delete Analysis Deletes an analysis based on the provided analysis ID. @@ -733,6 +736,7 @@ def delete_analysis( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id} is deprecated.", DeprecationWarning) _param = self._delete_analysis_serialize( analysis_id=analysis_id, @@ -776,7 +780,7 @@ def delete_analysis_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseDict]: - """Delete Analysis + """(Deprecated) Delete Analysis Deletes an analysis based on the provided analysis ID. @@ -803,6 +807,7 @@ def delete_analysis_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id} is deprecated.", DeprecationWarning) _param = self._delete_analysis_serialize( analysis_id=analysis_id, @@ -846,7 +851,7 @@ def delete_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Analysis + """(Deprecated) Delete Analysis Deletes an analysis based on the provided analysis ID. @@ -873,6 +878,7 @@ def delete_analysis_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /v2/analyses/{analysis_id} is deprecated.", DeprecationWarning) _param = self._delete_analysis_serialize( analysis_id=analysis_id, @@ -4752,7 +4758,7 @@ def lookup_binary_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> object: - """Gets the analysis ID from binary ID + """(Deprecated) Gets the analysis ID from binary ID Given an binary ID gets the ID of an analysis @@ -4779,6 +4785,7 @@ def lookup_binary_id( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/lookup/{binary_id} is deprecated.", DeprecationWarning) _param = self._lookup_binary_id_serialize( binary_id=binary_id, @@ -4820,7 +4827,7 @@ def lookup_binary_id_with_http_info( _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 + """(Deprecated) Gets the analysis ID from binary ID Given an binary ID gets the ID of an analysis @@ -4847,6 +4854,7 @@ def lookup_binary_id_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/lookup/{binary_id} is deprecated.", DeprecationWarning) _param = self._lookup_binary_id_serialize( binary_id=binary_id, @@ -4888,7 +4896,7 @@ 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 + """(Deprecated) Gets the analysis ID from binary ID Given an binary ID gets the ID of an analysis @@ -4915,6 +4923,7 @@ def lookup_binary_id_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/lookup/{binary_id} is deprecated.", DeprecationWarning) _param = self._lookup_binary_id_serialize( binary_id=binary_id, @@ -5933,7 +5942,7 @@ def update_analysis( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseAnalysisDetailResponse: - """Update Analysis + """(Deprecated) Update Analysis Updates analysis attributes (binary_name, analysis_scope). User must be the owner. @@ -5962,6 +5971,7 @@ def update_analysis( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/{analysis_id} is deprecated.", DeprecationWarning) _param = self._update_analysis_serialize( analysis_id=analysis_id, @@ -6005,7 +6015,7 @@ def update_analysis_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseAnalysisDetailResponse]: - """Update Analysis + """(Deprecated) Update Analysis Updates analysis attributes (binary_name, analysis_scope). User must be the owner. @@ -6034,6 +6044,7 @@ def update_analysis_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/{analysis_id} is deprecated.", DeprecationWarning) _param = self._update_analysis_serialize( analysis_id=analysis_id, @@ -6077,7 +6088,7 @@ def update_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Analysis + """(Deprecated) Update Analysis Updates analysis attributes (binary_name, analysis_scope). User must be the owner. @@ -6106,6 +6117,7 @@ def update_analysis_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("PATCH /v2/analyses/{analysis_id} is deprecated.", DeprecationWarning) _param = self._update_analysis_serialize( analysis_id=analysis_id, @@ -11291,6 +11303,310 @@ def _v3_queue_binary_export_serialize( + @validate_call + def v3_search_tags( + self, + partial_name: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True)]], Field(description="Partial or full tag name to search for, at least 3 characters")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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, + ) -> SearchTagsOutputBody: + """Search tags + + Searches for tags by name. partial_name is required and must be at least 3 characters. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full tag name to search for, at least 3 characters + :type partial_name: str + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_tags_serialize( + partial_name=partial_name, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchTagsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_search_tags_with_http_info( + self, + partial_name: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True)]], Field(description="Partial or full tag name to search for, at least 3 characters")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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[SearchTagsOutputBody]: + """Search tags + + Searches for tags by name. partial_name is required and must be at least 3 characters. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full tag name to search for, at least 3 characters + :type partial_name: str + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_tags_serialize( + partial_name=partial_name, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchTagsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_search_tags_without_preload_content( + self, + partial_name: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True)]], Field(description="Partial or full tag name to search for, at least 3 characters")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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: + """Search tags + + Searches for tags by name. partial_name is required and must be at least 3 characters. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full tag name to search for, at least 3 characters + :type partial_name: str + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_tags_serialize( + partial_name=partial_name, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchTagsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_search_tags_serialize( + self, + partial_name, + limit, + offset, + _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 + if partial_name is not None: + + _query_params.append(('partial_name', partial_name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/tags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_update_analysis( self, @@ -11308,7 +11624,83 @@ def v3_update_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AnalysisDetailOutputBody: + ) -> AnalysisDetailOutputBody: + """Update an analysis. + + Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param update_analysis_input_body: (required) + :type update_analysis_input_body: UpdateAnalysisInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_update_analysis_serialize( + analysis_id=analysis_id, + update_analysis_input_body=update_analysis_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisDetailOutputBody", + '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 v3_update_analysis_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + update_analysis_input_body: UpdateAnalysisInputBody, + _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[AnalysisDetailOutputBody]: """Update an analysis. Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied @@ -11364,11 +11756,11 @@ def v3_update_analysis( return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, - ).data + ) @validate_call - def v3_update_analysis_with_http_info( + def v3_update_analysis_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], update_analysis_input_body: UpdateAnalysisInputBody, @@ -11384,7 +11776,7 @@ def v3_update_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[AnalysisDetailOutputBody]: + ) -> RESTResponseType: """Update an analysis. Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied @@ -11436,6 +11828,233 @@ def v3_update_analysis_with_http_info( *_param, _request_timeout=_request_timeout ) + return response_data.response + + + def _v3_update_analysis_serialize( + self, + analysis_id, + update_analysis_input_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_analysis_input_body is not None: + _body_params = update_analysis_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v3/analyses/{analysis_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 v3_update_analysis_tags( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + update_tags_input_body: UpdateTagsInputBody, + _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, + ) -> AnalysisTagsOutputBody: + """Replace an analysis' tags. + + Replaces the analysis' binary's user tags (origin RevEng) with the given set. A tag recorded under any other origin, such as a heuristic detection sharing a name with a user tag, is left in place even when its name is absent from the request. Only the owner may call it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param update_tags_input_body: (required) + :type update_tags_input_body: UpdateTagsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_update_analysis_tags_serialize( + analysis_id=analysis_id, + update_tags_input_body=update_tags_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_update_analysis_tags_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + update_tags_input_body: UpdateTagsInputBody, + _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[AnalysisTagsOutputBody]: + """Replace an analysis' tags. + + Replaces the analysis' binary's user tags (origin RevEng) with the given set. A tag recorded under any other origin, such as a heuristic detection sharing a name with a user tag, is left in place even when its name is absent from the request. Only the owner may call it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param update_tags_input_body: (required) + :type update_tags_input_body: UpdateTagsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_update_analysis_tags_serialize( + analysis_id=analysis_id, + update_tags_input_body=update_tags_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisTagsOutputBody", + '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, @@ -11444,10 +12063,10 @@ def v3_update_analysis_with_http_info( @validate_call - def v3_update_analysis_without_preload_content( + def v3_update_analysis_tags_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - update_analysis_input_body: UpdateAnalysisInputBody, + update_tags_input_body: UpdateTagsInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11461,14 +12080,14 @@ def v3_update_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update an analysis. + """Replace an analysis' tags. - Renames the analysis' binary and/or changes its scope. Only the owner may call it. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Replaces the analysis' binary's user tags (origin RevEng) with the given set. A tag recorded under any other origin, such as a heuristic detection sharing a name with a user tag, is left in place even when its name is absent from the request. Only the owner may call it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int - :param update_analysis_input_body: (required) - :type update_analysis_input_body: UpdateAnalysisInputBody + :param update_tags_input_body: (required) + :type update_tags_input_body: UpdateTagsInputBody :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 @@ -11491,9 +12110,9 @@ def v3_update_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_update_analysis_serialize( + _param = self._v3_update_analysis_tags_serialize( analysis_id=analysis_id, - update_analysis_input_body=update_analysis_input_body, + update_tags_input_body=update_tags_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11501,8 +12120,7 @@ def v3_update_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AnalysisDetailOutputBody", - '400': "APIError", + '200': "AnalysisTagsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -11515,10 +12133,10 @@ def v3_update_analysis_without_preload_content( return response_data.response - def _v3_update_analysis_serialize( + def _v3_update_analysis_tags_serialize( self, analysis_id, - update_analysis_input_body, + update_tags_input_body, _request_auth, _content_type, _headers, @@ -11546,8 +12164,8 @@ def _v3_update_analysis_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_analysis_input_body is not None: - _body_params = update_analysis_input_body + if update_tags_input_body is not None: + _body_params = update_tags_input_body # set the HTTP header `Accept` @@ -11580,7 +12198,7 @@ def _v3_update_analysis_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/v3/analyses/{analysis_id}', + resource_path='/v3/analyses/{analysis_id}/tags', 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 438baa1..a8947e1 100644 --- a/revengai/api/analyses_results_metadata_api.py +++ b/revengai/api/analyses_results_metadata_api.py @@ -19,6 +19,8 @@ from typing import Optional from typing_extensions import Annotated from revengai.models.analysis_capabilities_output_body import AnalysisCapabilitiesOutputBody +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody +from revengai.models.analysis_xref_output_body import AnalysisXrefOutputBody from revengai.models.base_response_analysis_functions import BaseResponseAnalysisFunctions from revengai.models.base_response_analysis_functions_list import BaseResponseAnalysisFunctionsList from revengai.models.base_response_analysis_tags import BaseResponseAnalysisTags @@ -361,7 +363,7 @@ def get_capabilities( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseCapabilities: - """Gets the capabilities from the analysis + """(Deprecated) Gets the capabilities from the analysis :param analysis_id: (required) @@ -387,6 +389,7 @@ def get_capabilities( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/capabilities is deprecated.", DeprecationWarning) _param = self._get_capabilities_serialize( analysis_id=analysis_id, @@ -428,7 +431,7 @@ def get_capabilities_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseCapabilities]: - """Gets the capabilities from the analysis + """(Deprecated) Gets the capabilities from the analysis :param analysis_id: (required) @@ -454,6 +457,7 @@ def get_capabilities_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/capabilities is deprecated.", DeprecationWarning) _param = self._get_capabilities_serialize( analysis_id=analysis_id, @@ -495,7 +499,7 @@ def get_capabilities_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the capabilities from the analysis + """(Deprecated) Gets the capabilities from the analysis :param analysis_id: (required) @@ -521,6 +525,7 @@ def get_capabilities_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/analyses/{analysis_id}/capabilities is deprecated.", DeprecationWarning) _param = self._get_capabilities_serialize( analysis_id=analysis_id, @@ -1238,6 +1243,295 @@ def _get_tags_serialize( + @validate_call + def v3_get_analysis_xref( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + vaddr: Annotated[StrictInt, Field(description="Virtual address to match against xrefs")], + _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, + ) -> AnalysisXrefOutputBody: + """Look up xrefs by virtual address. + + Returns every cross-reference into and out of a virtual address, read from the analysis' cache. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param vaddr: Virtual address to match against xrefs (required) + :type vaddr: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_xref_serialize( + analysis_id=analysis_id, + vaddr=vaddr, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisXrefOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_analysis_xref_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + vaddr: Annotated[StrictInt, Field(description="Virtual address to match against xrefs")], + _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[AnalysisXrefOutputBody]: + """Look up xrefs by virtual address. + + Returns every cross-reference into and out of a virtual address, read from the analysis' cache. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param vaddr: Virtual address to match against xrefs (required) + :type vaddr: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_xref_serialize( + analysis_id=analysis_id, + vaddr=vaddr, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisXrefOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_analysis_xref_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + vaddr: Annotated[StrictInt, Field(description="Virtual address to match against xrefs")], + _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: + """Look up xrefs by virtual address. + + Returns every cross-reference into and out of a virtual address, read from the analysis' cache. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param vaddr: Virtual address to match against xrefs (required) + :type vaddr: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_xref_serialize( + analysis_id=analysis_id, + vaddr=vaddr, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisXrefOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_analysis_xref_serialize( + self, + analysis_id, + vaddr, + _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 vaddr is not None: + _path_params['vaddr'] = vaddr + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/xrefs/{vaddr}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_list_analysis_capabilities( self, @@ -1510,3 +1804,277 @@ def _v3_list_analysis_capabilities_serialize( ) + + + @validate_call + def v3_list_analysis_tags( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisTagsOutputBody: + """List the tags on an analysis. + + Returns every tag on the analysis' binary, of any origin. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_list_analysis_tags_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': "AnalysisTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_list_analysis_tags_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisTagsOutputBody]: + """List the tags on an analysis. + + Returns every tag on the analysis' binary, of any origin. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_list_analysis_tags_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': "AnalysisTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_list_analysis_tags_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the tags on an analysis. + + Returns every tag on the analysis' binary, of any origin. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_list_analysis_tags_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': "AnalysisTagsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_list_analysis_tags_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/tags', + 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/binaries_api.py b/revengai/api/binaries_api.py index d4c30b1..d9b3520 100644 --- a/revengai/api/binaries_api.py +++ b/revengai/api/binaries_api.py @@ -16,7 +16,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator -from typing import Optional, Tuple, Union +from typing import List, Optional, Tuple, Union from typing_extensions import Annotated from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse @@ -27,9 +27,11 @@ from revengai.models.base_response_list_die_match import BaseResponseListDieMatch from revengai.models.get_additional_details_output_body import GetAdditionalDetailsOutputBody from revengai.models.get_additional_details_status_output_body import GetAdditionalDetailsStatusOutputBody +from revengai.models.get_binary_externals_output_body import GetBinaryExternalsOutputBody from revengai.models.get_die_info_output_body import GetDieInfoOutputBody from revengai.models.get_related_binaries_output_body import GetRelatedBinariesOutputBody from revengai.models.get_related_status_output_body import GetRelatedStatusOutputBody +from revengai.models.search_binaries_output_body import SearchBinariesOutputBody from revengai.models.upload_output_body import UploadOutputBody from revengai.api_client import ApiClient, RequestSerialized @@ -1670,7 +1672,7 @@ def get_binary_die_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseListDieMatch: - """Gets the die info of a binary + """(Deprecated) Gets the die info of a binary :param binary_id: (required) @@ -1696,6 +1698,7 @@ def get_binary_die_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/die-info is deprecated.", DeprecationWarning) _param = self._get_binary_die_info_serialize( binary_id=binary_id, @@ -1737,7 +1740,7 @@ def get_binary_die_info_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseListDieMatch]: - """Gets the die info of a binary + """(Deprecated) Gets the die info of a binary :param binary_id: (required) @@ -1763,6 +1766,7 @@ def get_binary_die_info_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/die-info is deprecated.", DeprecationWarning) _param = self._get_binary_die_info_serialize( binary_id=binary_id, @@ -1804,7 +1808,7 @@ def get_binary_die_info_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the die info of a binary + """(Deprecated) Gets the die info of a binary :param binary_id: (required) @@ -1830,6 +1834,7 @@ def get_binary_die_info_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/die-info is deprecated.", DeprecationWarning) _param = self._get_binary_die_info_serialize( binary_id=binary_id, @@ -2194,7 +2199,7 @@ def get_binary_related_status( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseBinariesRelatedStatusResponse: - """Gets the status of the unpack binary task for a binary + """(Deprecated) Gets the status of the unpack binary task for a binary :param binary_id: (required) @@ -2220,6 +2225,7 @@ def get_binary_related_status( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/related/status is deprecated.", DeprecationWarning) _param = self._get_binary_related_status_serialize( binary_id=binary_id, @@ -2261,7 +2267,7 @@ def get_binary_related_status_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseBinariesRelatedStatusResponse]: - """Gets the status of the unpack binary task for a binary + """(Deprecated) Gets the status of the unpack binary task for a binary :param binary_id: (required) @@ -2287,6 +2293,7 @@ def get_binary_related_status_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/related/status is deprecated.", DeprecationWarning) _param = self._get_binary_related_status_serialize( binary_id=binary_id, @@ -2328,7 +2335,7 @@ def get_binary_related_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 the unpack binary task for a binary + """(Deprecated) Gets the status of the unpack binary task for a binary :param binary_id: (required) @@ -2354,6 +2361,7 @@ def get_binary_related_status_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/related/status is deprecated.", DeprecationWarning) _param = self._get_binary_related_status_serialize( binary_id=binary_id, @@ -2456,7 +2464,7 @@ def get_related_binaries( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseChildBinariesResponse: - """Gets the related binaries of a binary. + """(Deprecated) Gets the related binaries of a binary. :param binary_id: (required) @@ -2482,6 +2490,7 @@ def get_related_binaries( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/related is deprecated.", DeprecationWarning) _param = self._get_related_binaries_serialize( binary_id=binary_id, @@ -2524,7 +2533,7 @@ def get_related_binaries_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseChildBinariesResponse]: - """Gets the related binaries of a binary. + """(Deprecated) Gets the related binaries of a binary. :param binary_id: (required) @@ -2550,6 +2559,7 @@ def get_related_binaries_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/related is deprecated.", DeprecationWarning) _param = self._get_related_binaries_serialize( binary_id=binary_id, @@ -2592,7 +2602,7 @@ def get_related_binaries_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets the related binaries of a binary. + """(Deprecated) Gets the related binaries of a binary. :param binary_id: (required) @@ -2618,6 +2628,7 @@ def get_related_binaries_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/binaries/{binary_id}/related is deprecated.", DeprecationWarning) _param = self._get_related_binaries_serialize( binary_id=binary_id, @@ -2704,6 +2715,280 @@ def _get_related_binaries_serialize( + @validate_call + def v3_download_binary_zipped( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Download a binary as a password-protected zip. + + Streams the binary's uploaded file back as a zip archive, encrypted with a fixed password (`infected`) that deters antivirus scanning in transit rather than protecting confidentiality. Only the binary's owner, or an admin/superadmin, may download it; an internally-managed account's binary can only be downloaded by a superadmin. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: 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._v3_download_binary_zipped_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': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_download_binary_zipped_with_http_info( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Download a binary as a password-protected zip. + + Streams the binary's uploaded file back as a zip archive, encrypted with a fixed password (`infected`) that deters antivirus scanning in transit rather than protecting confidentiality. Only the binary's owner, or an admin/superadmin, may download it; an internally-managed account's binary can only be downloaded by a superadmin. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: 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._v3_download_binary_zipped_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': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_download_binary_zipped_without_preload_content( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary 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: + """Download a binary as a password-protected zip. + + Streams the binary's uploaded file back as a zip archive, encrypted with a fixed password (`infected`) that deters antivirus scanning in transit rather than protecting confidentiality. Only the binary's owner, or an admin/superadmin, may download it; an internally-managed account's binary can only be downloaded by a superadmin. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: 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._v3_download_binary_zipped_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': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_download_binary_zipped_serialize( + self, + binary_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 binary_id is not None: + _path_params['binary_id'] = binary_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/binaries/{binary_id}/download-zipped', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_get_binary_die_info( self, @@ -2720,10 +3005,284 @@ def v3_get_binary_die_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetDieInfoOutputBody: - """Get Detect It Easy matches for a binary. + ) -> GetDieInfoOutputBody: + """Get Detect It Easy matches for a binary. + + Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: 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._v3_get_binary_die_info_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': "GetDieInfoOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_get_binary_die_info_with_http_info( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary 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[GetDieInfoOutputBody]: + """Get Detect It Easy matches for a binary. + + Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: 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._v3_get_binary_die_info_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': "GetDieInfoOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_get_binary_die_info_without_preload_content( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary 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 Detect It Easy matches for a binary. + + Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param binary_id: 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._v3_get_binary_die_info_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': "GetDieInfoOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_binary_die_info_serialize( + self, + binary_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 binary_id is not None: + _path_params['binary_id'] = binary_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/binaries/{binary_id}/die-info', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_binary_externals( + self, + binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary 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, + ) -> GetBinaryExternalsOutputBody: + """Get third-party threat-intel lookups for a binary. - Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns VirusTotal and MalwareBazaar lookup results for the binary's content hash. `externals` is null until at least one lookup has run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param binary_id: Binary ID (required) :type binary_id: int @@ -2749,7 +3308,7 @@ def v3_get_binary_die_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_binary_die_info_serialize( + _param = self._v3_get_binary_externals_serialize( binary_id=binary_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2758,7 +3317,7 @@ def v3_get_binary_die_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetDieInfoOutputBody", + '200': "GetBinaryExternalsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2776,7 +3335,7 @@ def v3_get_binary_die_info( @validate_call - def v3_get_binary_die_info_with_http_info( + def v3_get_binary_externals_with_http_info( self, binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], _request_timeout: Union[ @@ -2791,10 +3350,10 @@ def v3_get_binary_die_info_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[GetDieInfoOutputBody]: - """Get Detect It Easy matches for a binary. + ) -> ApiResponse[GetBinaryExternalsOutputBody]: + """Get third-party threat-intel lookups for a binary. - Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns VirusTotal and MalwareBazaar lookup results for the binary's content hash. `externals` is null until at least one lookup has run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param binary_id: Binary ID (required) :type binary_id: int @@ -2820,7 +3379,7 @@ def v3_get_binary_die_info_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_binary_die_info_serialize( + _param = self._v3_get_binary_externals_serialize( binary_id=binary_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2829,7 +3388,7 @@ def v3_get_binary_die_info_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetDieInfoOutputBody", + '200': "GetBinaryExternalsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2847,7 +3406,7 @@ def v3_get_binary_die_info_with_http_info( @validate_call - def v3_get_binary_die_info_without_preload_content( + def v3_get_binary_externals_without_preload_content( self, binary_id: Annotated[int, Field(strict=True, ge=1, description="Binary ID")], _request_timeout: Union[ @@ -2863,9 +3422,9 @@ def v3_get_binary_die_info_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Detect It Easy matches for a binary. + """Get third-party threat-intel lookups for a binary. - Returns the signatures Detect It Easy recognised in the binary — packers, compilers and file types — with the version it could extract. Empty when detection has not run or recognised nothing. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns VirusTotal and MalwareBazaar lookup results for the binary's content hash. `externals` is null until at least one lookup has run. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param binary_id: Binary ID (required) :type binary_id: int @@ -2891,7 +3450,7 @@ def v3_get_binary_die_info_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_binary_die_info_serialize( + _param = self._v3_get_binary_externals_serialize( binary_id=binary_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2900,7 +3459,7 @@ def v3_get_binary_die_info_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetDieInfoOutputBody", + '200': "GetBinaryExternalsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -2913,7 +3472,7 @@ def v3_get_binary_die_info_without_preload_content( return response_data.response - def _v3_get_binary_die_info_serialize( + def _v3_get_binary_externals_serialize( self, binary_id, _request_auth, @@ -2962,7 +3521,7 @@ def _v3_get_binary_die_info_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/binaries/{binary_id}/die-info', + resource_path='/v3/binaries/{binary_id}/externals', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3526,6 +4085,414 @@ def _v3_get_binary_related_status_serialize( + @validate_call + def v3_search_binaries( + self, + partial_name: Annotated[Optional[StrictStr], Field(description="Partial or full binary name to search for")] = None, + partial_sha256: Annotated[Optional[StrictStr], Field(description="Partial or full SHA-256 hash to search for")] = None, + tags: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Restrict results to binaries carrying at least one of these tags")] = None, + model_name: Annotated[Optional[StrictStr], Field(description="Restrict results to binaries analysed with this model")] = None, + user_files_only: Annotated[Optional[StrictBool], Field(description="Restrict results to files the caller uploaded themself")] = None, + exclude_binary_id: Annotated[Optional[StrictInt], Field(description="A binary ID to exclude from the results")] = None, + user_ids: Annotated[Optional[List[StrictInt]], Field(description="Restrict results to binaries owned by one of these user IDs")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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, + ) -> SearchBinariesOutputBody: + """Search binaries + + Searches for binaries visible to the caller. At least one of partial_name, partial_sha256, tags, or model_name must be provided. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full binary name to search for + :type partial_name: str + :param partial_sha256: Partial or full SHA-256 hash to search for + :type partial_sha256: str + :param tags: Restrict results to binaries carrying at least one of these tags + :type tags: List[Optional[str]] + :param model_name: Restrict results to binaries analysed with this model + :type model_name: str + :param user_files_only: Restrict results to files the caller uploaded themself + :type user_files_only: bool + :param exclude_binary_id: A binary ID to exclude from the results + :type exclude_binary_id: int + :param user_ids: Restrict results to binaries owned by one of these user IDs + :type user_ids: List[int] + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_binaries_serialize( + partial_name=partial_name, + partial_sha256=partial_sha256, + tags=tags, + model_name=model_name, + user_files_only=user_files_only, + exclude_binary_id=exclude_binary_id, + user_ids=user_ids, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchBinariesOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_search_binaries_with_http_info( + self, + partial_name: Annotated[Optional[StrictStr], Field(description="Partial or full binary name to search for")] = None, + partial_sha256: Annotated[Optional[StrictStr], Field(description="Partial or full SHA-256 hash to search for")] = None, + tags: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Restrict results to binaries carrying at least one of these tags")] = None, + model_name: Annotated[Optional[StrictStr], Field(description="Restrict results to binaries analysed with this model")] = None, + user_files_only: Annotated[Optional[StrictBool], Field(description="Restrict results to files the caller uploaded themself")] = None, + exclude_binary_id: Annotated[Optional[StrictInt], Field(description="A binary ID to exclude from the results")] = None, + user_ids: Annotated[Optional[List[StrictInt]], Field(description="Restrict results to binaries owned by one of these user IDs")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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[SearchBinariesOutputBody]: + """Search binaries + + Searches for binaries visible to the caller. At least one of partial_name, partial_sha256, tags, or model_name must be provided. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full binary name to search for + :type partial_name: str + :param partial_sha256: Partial or full SHA-256 hash to search for + :type partial_sha256: str + :param tags: Restrict results to binaries carrying at least one of these tags + :type tags: List[Optional[str]] + :param model_name: Restrict results to binaries analysed with this model + :type model_name: str + :param user_files_only: Restrict results to files the caller uploaded themself + :type user_files_only: bool + :param exclude_binary_id: A binary ID to exclude from the results + :type exclude_binary_id: int + :param user_ids: Restrict results to binaries owned by one of these user IDs + :type user_ids: List[int] + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_binaries_serialize( + partial_name=partial_name, + partial_sha256=partial_sha256, + tags=tags, + model_name=model_name, + user_files_only=user_files_only, + exclude_binary_id=exclude_binary_id, + user_ids=user_ids, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchBinariesOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_search_binaries_without_preload_content( + self, + partial_name: Annotated[Optional[StrictStr], Field(description="Partial or full binary name to search for")] = None, + partial_sha256: Annotated[Optional[StrictStr], Field(description="Partial or full SHA-256 hash to search for")] = None, + tags: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Restrict results to binaries carrying at least one of these tags")] = None, + model_name: Annotated[Optional[StrictStr], Field(description="Restrict results to binaries analysed with this model")] = None, + user_files_only: Annotated[Optional[StrictBool], Field(description="Restrict results to files the caller uploaded themself")] = None, + exclude_binary_id: Annotated[Optional[StrictInt], Field(description="A binary ID to exclude from the results")] = None, + user_ids: Annotated[Optional[List[StrictInt]], Field(description="Restrict results to binaries owned by one of these user IDs")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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: + """Search binaries + + Searches for binaries visible to the caller. At least one of partial_name, partial_sha256, tags, or model_name must be provided. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full binary name to search for + :type partial_name: str + :param partial_sha256: Partial or full SHA-256 hash to search for + :type partial_sha256: str + :param tags: Restrict results to binaries carrying at least one of these tags + :type tags: List[Optional[str]] + :param model_name: Restrict results to binaries analysed with this model + :type model_name: str + :param user_files_only: Restrict results to files the caller uploaded themself + :type user_files_only: bool + :param exclude_binary_id: A binary ID to exclude from the results + :type exclude_binary_id: int + :param user_ids: Restrict results to binaries owned by one of these user IDs + :type user_ids: List[int] + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_binaries_serialize( + partial_name=partial_name, + partial_sha256=partial_sha256, + tags=tags, + model_name=model_name, + user_files_only=user_files_only, + exclude_binary_id=exclude_binary_id, + user_ids=user_ids, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchBinariesOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_search_binaries_serialize( + self, + partial_name, + partial_sha256, + tags, + model_name, + user_files_only, + exclude_binary_id, + user_ids, + limit, + offset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'tags': 'csv', + 'user_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 partial_name is not None: + + _query_params.append(('partial_name', partial_name)) + + if partial_sha256 is not None: + + _query_params.append(('partial_sha256', partial_sha256)) + + if tags is not None: + + _query_params.append(('tags', tags)) + + if model_name is not None: + + _query_params.append(('model_name', model_name)) + + if user_files_only is not None: + + _query_params.append(('user_files_only', user_files_only)) + + if exclude_binary_id is not None: + + _query_params.append(('exclude_binary_id', exclude_binary_id)) + + if user_ids is not None: + + _query_params.append(('user_ids', user_ids)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/binaries', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_upload_file( self, diff --git a/revengai/api/collections_api.py b/revengai/api/collections_api.py index 5fad69e..34066e8 100644 --- a/revengai/api/collections_api.py +++ b/revengai/api/collections_api.py @@ -3426,7 +3426,11 @@ def _v3_get_collection_serialize( @validate_call def v3_list_collections( self, - search_term: Optional[StrictStr] = None, + search_term: Annotated[Optional[StrictStr], Field(description="Partial or full collection name to search for")] = None, + binary_name: Annotated[Optional[StrictStr], Field(description="Only return Collections containing a Binary whose name contains this")] = None, + binary_sha256: Annotated[Optional[StrictStr], Field(description="Only return Collections containing a Binary whose SHA-256 hash contains this")] = None, + tags: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Only return Collections carrying at least one of these Tags")] = None, + user_ids: Annotated[Optional[List[StrictInt]], Field(description="Restrict results to Collections owned by one of these user IDs")] = None, filters: Optional[List[StrictStr]] = None, limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -3447,10 +3451,18 @@ def v3_list_collections( ) -> ListCollectionsOutputBody: """List collections. - Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Lists collections accessible to the authenticated user. Supports search by collection name, contained binary name/SHA-256, tags, owner, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param search_term: + :param search_term: Partial or full collection name to search for :type search_term: str + :param binary_name: Only return Collections containing a Binary whose name contains this + :type binary_name: str + :param binary_sha256: Only return Collections containing a Binary whose SHA-256 hash contains this + :type binary_sha256: str + :param tags: Only return Collections carrying at least one of these Tags + :type tags: List[Optional[str]] + :param user_ids: Restrict results to Collections owned by one of these user IDs + :type user_ids: List[int] :param filters: :type filters: List[str] :param limit: @@ -3485,6 +3497,10 @@ def v3_list_collections( _param = self._v3_list_collections_serialize( search_term=search_term, + binary_name=binary_name, + binary_sha256=binary_sha256, + tags=tags, + user_ids=user_ids, filters=filters, limit=limit, offset=offset, @@ -3515,7 +3531,11 @@ def v3_list_collections( @validate_call def v3_list_collections_with_http_info( self, - search_term: Optional[StrictStr] = None, + search_term: Annotated[Optional[StrictStr], Field(description="Partial or full collection name to search for")] = None, + binary_name: Annotated[Optional[StrictStr], Field(description="Only return Collections containing a Binary whose name contains this")] = None, + binary_sha256: Annotated[Optional[StrictStr], Field(description="Only return Collections containing a Binary whose SHA-256 hash contains this")] = None, + tags: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Only return Collections carrying at least one of these Tags")] = None, + user_ids: Annotated[Optional[List[StrictInt]], Field(description="Restrict results to Collections owned by one of these user IDs")] = None, filters: Optional[List[StrictStr]] = None, limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -3536,10 +3556,18 @@ def v3_list_collections_with_http_info( ) -> ApiResponse[ListCollectionsOutputBody]: """List collections. - Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Lists collections accessible to the authenticated user. Supports search by collection name, contained binary name/SHA-256, tags, owner, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param search_term: + :param search_term: Partial or full collection name to search for :type search_term: str + :param binary_name: Only return Collections containing a Binary whose name contains this + :type binary_name: str + :param binary_sha256: Only return Collections containing a Binary whose SHA-256 hash contains this + :type binary_sha256: str + :param tags: Only return Collections carrying at least one of these Tags + :type tags: List[Optional[str]] + :param user_ids: Restrict results to Collections owned by one of these user IDs + :type user_ids: List[int] :param filters: :type filters: List[str] :param limit: @@ -3574,6 +3602,10 @@ def v3_list_collections_with_http_info( _param = self._v3_list_collections_serialize( search_term=search_term, + binary_name=binary_name, + binary_sha256=binary_sha256, + tags=tags, + user_ids=user_ids, filters=filters, limit=limit, offset=offset, @@ -3604,7 +3636,11 @@ def v3_list_collections_with_http_info( @validate_call def v3_list_collections_without_preload_content( self, - search_term: Optional[StrictStr] = None, + search_term: Annotated[Optional[StrictStr], Field(description="Partial or full collection name to search for")] = None, + binary_name: Annotated[Optional[StrictStr], Field(description="Only return Collections containing a Binary whose name contains this")] = None, + binary_sha256: Annotated[Optional[StrictStr], Field(description="Only return Collections containing a Binary whose SHA-256 hash contains this")] = None, + tags: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Only return Collections carrying at least one of these Tags")] = None, + user_ids: Annotated[Optional[List[StrictInt]], Field(description="Restrict results to Collections owned by one of these user IDs")] = None, filters: Optional[List[StrictStr]] = None, limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -3625,10 +3661,18 @@ def v3_list_collections_without_preload_content( ) -> RESTResponseType: """List collections. - Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Lists collections accessible to the authenticated user. Supports search by collection name, contained binary name/SHA-256, tags, owner, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param search_term: + :param search_term: Partial or full collection name to search for :type search_term: str + :param binary_name: Only return Collections containing a Binary whose name contains this + :type binary_name: str + :param binary_sha256: Only return Collections containing a Binary whose SHA-256 hash contains this + :type binary_sha256: str + :param tags: Only return Collections carrying at least one of these Tags + :type tags: List[Optional[str]] + :param user_ids: Restrict results to Collections owned by one of these user IDs + :type user_ids: List[int] :param filters: :type filters: List[str] :param limit: @@ -3663,6 +3707,10 @@ def v3_list_collections_without_preload_content( _param = self._v3_list_collections_serialize( search_term=search_term, + binary_name=binary_name, + binary_sha256=binary_sha256, + tags=tags, + user_ids=user_ids, filters=filters, limit=limit, offset=offset, @@ -3689,6 +3737,10 @@ def v3_list_collections_without_preload_content( def _v3_list_collections_serialize( self, search_term, + binary_name, + binary_sha256, + tags, + user_ids, filters, limit, offset, @@ -3703,6 +3755,8 @@ def _v3_list_collections_serialize( _host = None _collection_formats: Dict[str, str] = { + 'tags': 'csv', + 'user_ids': 'csv', 'filters': 'csv', } @@ -3721,6 +3775,22 @@ def _v3_list_collections_serialize( _query_params.append(('search_term', search_term)) + if binary_name is not None: + + _query_params.append(('binary_name', binary_name)) + + if binary_sha256 is not None: + + _query_params.append(('binary_sha256', binary_sha256)) + + if tags is not None: + + _query_params.append(('tags', tags)) + + if user_ids is not None: + + _query_params.append(('user_ids', user_ids)) + if filters is not None: _query_params.append(('filters', filters)) diff --git a/revengai/api/config_api.py b/revengai/api/config_api.py index f6c8ac8..7b0bfd1 100644 --- a/revengai/api/config_api.py +++ b/revengai/api/config_api.py @@ -53,7 +53,7 @@ def get_config( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseConfigResponse: - """Get Config + """(Deprecated) Get Config General configuration endpoint @@ -78,6 +78,7 @@ def get_config( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/config is deprecated.", DeprecationWarning) _param = self._get_config_serialize( _request_auth=_request_auth, @@ -117,7 +118,7 @@ def get_config_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseConfigResponse]: - """Get Config + """(Deprecated) Get Config General configuration endpoint @@ -142,6 +143,7 @@ def get_config_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/config is deprecated.", DeprecationWarning) _param = self._get_config_serialize( _request_auth=_request_auth, @@ -181,7 +183,7 @@ def get_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Config + """(Deprecated) Get Config General configuration endpoint @@ -206,6 +208,7 @@ def get_config_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/config is deprecated.", DeprecationWarning) _param = self._get_config_serialize( _request_auth=_request_auth, diff --git a/revengai/api/functions_ai_decompilation_api.py b/revengai/api/functions_ai_decompilation_api.py index 9e930dc..4b62c30 100644 --- a/revengai/api/functions_ai_decompilation_api.py +++ b/revengai/api/functions_ai_decompilation_api.py @@ -18,6 +18,8 @@ from pydantic import Field, StrictBool, StrictInt from typing import List, Optional, Union from typing_extensions import Annotated +from revengai.models.accept_type_suggestions_input_body import AcceptTypeSuggestionsInputBody +from revengai.models.accept_type_suggestions_output_body import AcceptTypeSuggestionsOutputBody from revengai.models.base_response import BaseResponse from revengai.models.base_response_union_get_ai_decompilation_rating_response_none_type import BaseResponseUnionGetAiDecompilationRatingResponseNoneType from revengai.models.comments_data import CommentsData @@ -3974,6 +3976,314 @@ def _upsert_ai_decompilation_rating_serialize( + @validate_call + def v3_accept_ai_decompilation_type_suggestions( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + accept_type_suggestions_input_body: AcceptTypeSuggestionsInputBody, + _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, + ) -> AcceptTypeSuggestionsOutputBody: + """Accept AI decompilation type suggestions + + Stores the named type suggestions as data types of this function's analysis, with a `source_type` of `AI_DECOMP` and this function as their `source_function_id`. Each suggestion is stored as the type suggestions endpoint renders it: a `STRUCT` where members were placed, a `TYPEDEF` where the suggestion is a name for a scalar, and an `UNKNOWN` type where nothing gave it a shape. A member with no offset or width is left out and counted in `skipped_members`. A type expression a member names is matched against the analysis by name alone and created where nothing matches: `char *` creates a `char` `BASE` type and a `POINTER` type pointing at it, reusing either where the analysis already holds it. A member naming another suggestion accepted by the same request resolves to it. Only a trailing `*` is taken apart, so a name like `int &` stands for one type. No size is stored: the widths a suggestion carries are lower bounds rather than the type's own. A suggestion the analysis already holds a type of that name and kind for resolves to it, so repeating a request stores nothing further. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param accept_type_suggestions_input_body: (required) + :type accept_type_suggestions_input_body: AcceptTypeSuggestionsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_accept_ai_decompilation_type_suggestions_serialize( + function_id=function_id, + accept_type_suggestions_input_body=accept_type_suggestions_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AcceptTypeSuggestionsOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_accept_ai_decompilation_type_suggestions_with_http_info( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + accept_type_suggestions_input_body: AcceptTypeSuggestionsInputBody, + _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[AcceptTypeSuggestionsOutputBody]: + """Accept AI decompilation type suggestions + + Stores the named type suggestions as data types of this function's analysis, with a `source_type` of `AI_DECOMP` and this function as their `source_function_id`. Each suggestion is stored as the type suggestions endpoint renders it: a `STRUCT` where members were placed, a `TYPEDEF` where the suggestion is a name for a scalar, and an `UNKNOWN` type where nothing gave it a shape. A member with no offset or width is left out and counted in `skipped_members`. A type expression a member names is matched against the analysis by name alone and created where nothing matches: `char *` creates a `char` `BASE` type and a `POINTER` type pointing at it, reusing either where the analysis already holds it. A member naming another suggestion accepted by the same request resolves to it. Only a trailing `*` is taken apart, so a name like `int &` stands for one type. No size is stored: the widths a suggestion carries are lower bounds rather than the type's own. A suggestion the analysis already holds a type of that name and kind for resolves to it, so repeating a request stores nothing further. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param accept_type_suggestions_input_body: (required) + :type accept_type_suggestions_input_body: AcceptTypeSuggestionsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_accept_ai_decompilation_type_suggestions_serialize( + function_id=function_id, + accept_type_suggestions_input_body=accept_type_suggestions_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AcceptTypeSuggestionsOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_accept_ai_decompilation_type_suggestions_without_preload_content( + self, + function_id: Annotated[int, Field(strict=True, ge=1, description="Function ID")], + accept_type_suggestions_input_body: AcceptTypeSuggestionsInputBody, + _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: + """Accept AI decompilation type suggestions + + Stores the named type suggestions as data types of this function's analysis, with a `source_type` of `AI_DECOMP` and this function as their `source_function_id`. Each suggestion is stored as the type suggestions endpoint renders it: a `STRUCT` where members were placed, a `TYPEDEF` where the suggestion is a name for a scalar, and an `UNKNOWN` type where nothing gave it a shape. A member with no offset or width is left out and counted in `skipped_members`. A type expression a member names is matched against the analysis by name alone and created where nothing matches: `char *` creates a `char` `BASE` type and a `POINTER` type pointing at it, reusing either where the analysis already holds it. A member naming another suggestion accepted by the same request resolves to it. Only a trailing `*` is taken apart, so a name like `int &` stands for one type. No size is stored: the widths a suggestion carries are lower bounds rather than the type's own. A suggestion the analysis already holds a type of that name and kind for resolves to it, so repeating a request stores nothing further. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - `500` [`INTERNAL_ERROR`](/errors/INTERNAL_ERROR) — Internal Server Error + + :param function_id: Function ID (required) + :type function_id: int + :param accept_type_suggestions_input_body: (required) + :type accept_type_suggestions_input_body: AcceptTypeSuggestionsInputBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_accept_ai_decompilation_type_suggestions_serialize( + function_id=function_id, + accept_type_suggestions_input_body=accept_type_suggestions_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AcceptTypeSuggestionsOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '409': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_accept_ai_decompilation_type_suggestions_serialize( + self, + function_id, + accept_type_suggestions_input_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if function_id is not None: + _path_params['function_id'] = function_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if accept_type_suggestions_input_body is not None: + _body_params = accept_type_suggestions_input_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/functions/{function_id}/ai-decompilation/type-suggestions/accept', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def v3_get_ai_decompilation_line_attributions( self, diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index 4901972..6f69605 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -41,6 +41,7 @@ from revengai.models.list_analysis_functions_output_body import ListAnalysisFunctionsOutputBody from revengai.models.list_function_strings_output_body import ListFunctionStringsOutputBody from revengai.models.list_imported_functions_output_body import ListImportedFunctionsOutputBody +from revengai.models.search_functions_output_body import SearchFunctionsOutputBody from revengai.models.start_matching_for_functions_input_body import StartMatchingForFunctionsInputBody from revengai.models.start_matching_output_body import StartMatchingOutputBody @@ -7015,3 +7016,324 @@ def _v3_canonicalize_function_names_serialize( ) + + + @validate_call + def v3_search_functions( + self, + partial_name: Annotated[Optional[StrictStr], Field(description="Partial or full function name to search for")] = None, + model_name: Annotated[Optional[StrictStr], Field(description="Restrict results to functions analysed with this model")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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, + ) -> SearchFunctionsOutputBody: + """Search functions + + Searches for functions visible to the caller. At least one of partial_name or model_name must be provided. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full function name to search for + :type partial_name: str + :param model_name: Restrict results to functions analysed with this model + :type model_name: str + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_functions_serialize( + partial_name=partial_name, + model_name=model_name, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchFunctionsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_search_functions_with_http_info( + self, + partial_name: Annotated[Optional[StrictStr], Field(description="Partial or full function name to search for")] = None, + model_name: Annotated[Optional[StrictStr], Field(description="Restrict results to functions analysed with this model")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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[SearchFunctionsOutputBody]: + """Search functions + + Searches for functions visible to the caller. At least one of partial_name or model_name must be provided. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full function name to search for + :type partial_name: str + :param model_name: Restrict results to functions analysed with this model + :type model_name: str + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_functions_serialize( + partial_name=partial_name, + model_name=model_name, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchFunctionsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_search_functions_without_preload_content( + self, + partial_name: Annotated[Optional[StrictStr], Field(description="Partial or full function name to search for")] = None, + model_name: Annotated[Optional[StrictStr], Field(description="Restrict results to functions analysed with this model")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Maximum results to return")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of results to skip")] = 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: + """Search functions + + Searches for functions visible to the caller. At least one of partial_name or model_name must be provided. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param partial_name: Partial or full function name to search for + :type partial_name: str + :param model_name: Restrict results to functions analysed with this model + :type model_name: str + :param limit: Maximum results to return + :type limit: int + :param offset: Number of results to skip + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_search_functions_serialize( + partial_name=partial_name, + model_name=model_name, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchFunctionsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_search_functions_serialize( + self, + partial_name, + model_name, + limit, + offset, + _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 + if partial_name is not None: + + _query_params.append(('partial_name', partial_name)) + + if model_name is not None: + + _query_params.append(('model_name', model_name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/functions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/revengai/api/models_api.py b/revengai/api/models_api.py index 0a9aa1e..e5ddb9b 100644 --- a/revengai/api/models_api.py +++ b/revengai/api/models_api.py @@ -51,7 +51,7 @@ def get_models( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BaseResponseModelsResponse: - """Gets models + """(Deprecated) Gets models Gets active models available for analysis. @@ -76,6 +76,7 @@ def get_models( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/models is deprecated.", DeprecationWarning) _param = self._get_models_serialize( _request_auth=_request_auth, @@ -115,7 +116,7 @@ def get_models_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[BaseResponseModelsResponse]: - """Gets models + """(Deprecated) Gets models Gets active models available for analysis. @@ -140,6 +141,7 @@ def get_models_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/models is deprecated.", DeprecationWarning) _param = self._get_models_serialize( _request_auth=_request_auth, @@ -179,7 +181,7 @@ def get_models_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Gets models + """(Deprecated) Gets models Gets active models available for analysis. @@ -204,6 +206,7 @@ def get_models_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v2/models is deprecated.", DeprecationWarning) _param = self._get_models_serialize( _request_auth=_request_auth, diff --git a/revengai/api_client.py b/revengai/api_client.py index 30708c4..a647e4f 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/v4.54.0/python' + self.user_agent = 'OpenAPI-Generator/v4.60.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index cb538ff..16cb7e3 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -541,8 +541,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v4.54.0\n"\ - "SDK Package Version: v4.54.0".\ + "Version of the API: v4.60.1\n"\ + "SDK Package Version: v4.60.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index 9bf8a16..dc4e741 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -13,6 +13,9 @@ # import models into model package from revengai.models.api_error import APIError +from revengai.models.accept_type_suggestions_input_body import AcceptTypeSuggestionsInputBody +from revengai.models.accept_type_suggestions_output_body import AcceptTypeSuggestionsOutputBody +from revengai.models.accepted_type import AcceptedType from revengai.models.add_callee_input_body import AddCalleeInputBody from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody from revengai.models.add_issuer_domain_input_body import AddIssuerDomainInputBody @@ -21,7 +24,9 @@ from revengai.models.add_user_string_input_body import AddUserStringInputBody from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse +from revengai.models.agent_workflow_usage_output_body import AgentWorkflowUsageOutputBody from revengai.models.ai_decompilation_rating import AiDecompilationRating +from revengai.models.analyse_capabilities_body import AnalyseCapabilitiesBody from revengai.models.analysis_access_body import AnalysisAccessBody from revengai.models.analysis_access_info import AnalysisAccessInfo from revengai.models.analysis_basic_info_output_body import AnalysisBasicInfoOutputBody @@ -57,9 +62,11 @@ from revengai.models.analysis_strings_status_response import AnalysisStringsStatusResponse from revengai.models.analysis_tag_body import AnalysisTagBody from revengai.models.analysis_tags import AnalysisTags +from revengai.models.analysis_tags_output_body import AnalysisTagsOutputBody from revengai.models.analysis_update_request import AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest from revengai.models.analysis_update_tags_response import AnalysisUpdateTagsResponse +from revengai.models.analysis_xref_output_body import AnalysisXrefOutputBody from revengai.models.api_call import ApiCall from revengai.models.api_combination_evidence import ApiCombinationEvidence from revengai.models.app_api_rest_v2_agent_schema_capability import AppApiRestV2AgentSchemaCapability @@ -156,11 +163,16 @@ from revengai.models.binary_details_response import BinaryDetailsResponse from revengai.models.binary_export_metadata import BinaryExportMetadata from revengai.models.binary_export_result import BinaryExportResult +from revengai.models.binary_externals_body import BinaryExternalsBody from revengai.models.binary_externals_response import BinaryExternalsResponse from revengai.models.binary_search_response import BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult +from revengai.models.binary_search_result_body import BinarySearchResultBody from revengai.models.binary_task_status import BinaryTaskStatus from revengai.models.bitfield_data_type import BitfieldDataType +from revengai.models.bulk_add_tags_input_body import BulkAddTagsInputBody +from revengai.models.bulk_add_tags_output_body import BulkAddTagsOutputBody +from revengai.models.bulk_add_tags_result_body import BulkAddTagsResultBody from revengai.models.bulk_create_user_result import BulkCreateUserResult from revengai.models.bulk_create_users_output_body import BulkCreateUsersOutputBody from revengai.models.bulk_delete_analyses_input_body import BulkDeleteAnalysesInputBody @@ -238,6 +250,8 @@ from revengai.models.create_struct_data_type import CreateStructDataType from revengai.models.create_team_input_body import CreateTeamInputBody from revengai.models.create_typedef_data_type import CreateTypedefDataType +from revengai.models.create_url_request import CreateURLRequest +from revengai.models.create_url_response import CreateURLResponse from revengai.models.create_union_data_type import CreateUnionDataType from revengai.models.create_unknown_data_type import CreateUnknownDataType from revengai.models.create_user_input_body import CreateUserInputBody @@ -250,6 +264,9 @@ from revengai.models.crypto_finding import CryptoFinding from revengai.models.crypto_scan_metadata import CryptoScanMetadata from revengai.models.crypto_scan_result import CryptoScanResult +from revengai.models.crypto_verification import CryptoVerification +from revengai.models.daily_analyses_count_output_body import DailyAnalysesCountOutputBody +from revengai.models.daily_count_body import DailyCountBody from revengai.models.data_type_entry import DataTypeEntry from revengai.models.data_type_enum_value_entry import DataTypeEnumValueEntry from revengai.models.data_type_function_entry import DataTypeFunctionEntry @@ -323,6 +340,7 @@ from revengai.models.execution_finding import ExecutionFinding from revengai.models.execution_scan_metadata import ExecutionScanMetadata from revengai.models.execution_scan_result import ExecutionScanResult +from revengai.models.execution_verification import ExecutionVerification from revengai.models.export_model import ExportModel from revengai.models.external_response import ExternalResponse from revengai.models.extracted_binary import ExtractedBinary @@ -341,6 +359,7 @@ from revengai.models.filesystem_finding import FilesystemFinding from revengai.models.filesystem_scan_metadata import FilesystemScanMetadata from revengai.models.filesystem_scan_result import FilesystemScanResult +from revengai.models.filesystem_verification import FilesystemVerification from revengai.models.filters import Filters from revengai.models.finding import Finding from revengai.models.finding_evidence_inner import FindingEvidenceInner @@ -363,6 +382,7 @@ from revengai.models.function_rename_map import FunctionRenameMap from revengai.models.function_search_response import FunctionSearchResponse from revengai.models.function_search_result import FunctionSearchResult +from revengai.models.function_search_result_body import FunctionSearchResultBody from revengai.models.function_signature_body import FunctionSignatureBody from revengai.models.function_signature_entry import FunctionSignatureEntry from revengai.models.function_signature_version import FunctionSignatureVersion @@ -382,6 +402,7 @@ from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody +from revengai.models.get_binary_externals_output_body import GetBinaryExternalsOutputBody from revengai.models.get_collection_output_body import GetCollectionOutputBody from revengai.models.get_config_output_body import GetConfigOutputBody from revengai.models.get_data_type_history_body import GetDataTypeHistoryBody @@ -463,6 +484,7 @@ from revengai.models.networking_finding import NetworkingFinding from revengai.models.networking_scan_metadata import NetworkingScanMetadata from revengai.models.networking_scan_result import NetworkingScanResult +from revengai.models.networking_verification import NetworkingVerification from revengai.models.oidc_callback_input_body import OIDCCallbackInputBody from revengai.models.operation_binary_export_metadata_binary_export_result import OperationBinaryExportMetadataBinaryExportResult from revengai.models.operation_create_metadata_create_result import OperationCreateMetadataCreateResult @@ -534,6 +556,7 @@ from revengai.models.rename_output_body import RenameOutputBody from revengai.models.rename_unnamed_functions_result import RenameUnnamedFunctionsResult from revengai.models.rendered_token import RenderedToken +from revengai.models.report_analysis_body import ReportAnalysisBody from revengai.models.report_analysis_response import ReportAnalysisResponse from revengai.models.report_event import ReportEvent from revengai.models.report_info import ReportInfo @@ -555,6 +578,9 @@ from revengai.models.scrape_third_party_config import ScrapeThirdPartyConfig from revengai.models.screenshot_entry import ScreenshotEntry from revengai.models.screenshots_index import ScreenshotsIndex +from revengai.models.search_binaries_output_body import SearchBinariesOutputBody +from revengai.models.search_functions_output_body import SearchFunctionsOutputBody +from revengai.models.search_tags_output_body import SearchTagsOutputBody from revengai.models.secrets_agent_response import SecretsAgentResponse from revengai.models.section_model import SectionModel from revengai.models.security_finding import SecurityFinding @@ -573,6 +599,7 @@ from revengai.models.single_code_signature_model import SingleCodeSignatureModel from revengai.models.single_pdb_entry_model import SinglePDBEntryModel from revengai.models.single_section_model import SingleSectionModel +from revengai.models.software_type_counts_body import SoftwareTypeCountsBody from revengai.models.source_delta_event import SourceDeltaEvent from revengai.models.source_reset_event import SourceResetEvent from revengai.models.sse_event_context_compacted_data import SseEventContextCompactedData @@ -627,6 +654,7 @@ from revengai.models.tag_response import TagResponse from revengai.models.tag_search_response import TagSearchResponse from revengai.models.tag_search_result import TagSearchResult +from revengai.models.tag_search_result_body import TagSearchResultBody from revengai.models.task_response import TaskResponse from revengai.models.task_status import TaskStatus from revengai.models.task_status_response import TaskStatusResponse @@ -677,6 +705,7 @@ from revengai.models.update_pointer_data_type import UpdatePointerDataType from revengai.models.update_profile_input_body import UpdateProfileInputBody from revengai.models.update_struct_data_type import UpdateStructDataType +from revengai.models.update_tags_input_body import UpdateTagsInputBody from revengai.models.update_team_input_body import UpdateTeamInputBody from revengai.models.update_typedef_data_type import UpdateTypedefDataType from revengai.models.update_union_data_type import UpdateUnionDataType @@ -697,9 +726,13 @@ from revengai.models.user_identity import UserIdentity from revengai.models.user_profile import UserProfile from revengai.models.warning_event import WarningEvent +from revengai.models.workflow_day_body import WorkflowDayBody from revengai.models.workflow_progress import WorkflowProgress from revengai.models.workspace import Workspace +from revengai.models.xref_from_body import XrefFromBody from revengai.models.xref_from_response import XrefFromResponse +from revengai.models.xref_into_body import XrefIntoBody from revengai.models.xref_response import XrefResponse +from revengai.models.xref_segment_body import XrefSegmentBody from revengai.models.xref_to_response import XrefToResponse diff --git a/revengai/models/accept_type_suggestions_input_body.py b/revengai/models/accept_type_suggestions_input_body.py new file mode 100644 index 0000000..a098330 --- /dev/null +++ b/revengai/models/accept_type_suggestions_input_body.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AcceptTypeSuggestionsInputBody(BaseModel): + """ + AcceptTypeSuggestionsInputBody + """ # noqa: E501 + keys: Optional[Annotated[List[StrictStr], Field(min_length=1, max_length=100)]] = Field(description="Keys of the suggestions to store, as the type suggestions endpoint returns them. A key repeated in one request is stored once.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["keys"] + + 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 AcceptTypeSuggestionsInputBody 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 keys (nullable) is None + # and model_fields_set contains the field + if self.keys is None and "keys" in self.model_fields_set: + _dict['keys'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AcceptTypeSuggestionsInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "keys": obj.get("keys") + }) + # 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/accept_type_suggestions_output_body.py b/revengai/models/accept_type_suggestions_output_body.py new file mode 100644 index 0000000..a4d04fb --- /dev/null +++ b/revengai/models/accept_type_suggestions_output_body.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.accepted_type import AcceptedType +from revengai.models.data_type_entry import DataTypeEntry +from typing import Optional, Set +from typing_extensions import Self + +class AcceptTypeSuggestionsOutputBody(BaseModel): + """ + AcceptTypeSuggestionsOutputBody + """ # noqa: E501 + accepted: Optional[List[AcceptedType]] = Field(description="One entry per requested suggestion, in request order.") + data_types: Optional[List[DataTypeEntry]] = Field(description="The type each requested suggestion resolved to, plus every type minted to satisfy one, ordered by data_type_id.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["accepted", "data_types"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AcceptTypeSuggestionsOutputBody 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 accepted (list) + _items = [] + if self.accepted: + for _item_accepted in self.accepted: + if _item_accepted: + _items.append(_item_accepted.to_dict()) + _dict['accepted'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in data_types (list) + _items = [] + if self.data_types: + for _item_data_types in self.data_types: + if _item_data_types: + _items.append(_item_data_types.to_dict()) + _dict['data_types'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if accepted (nullable) is None + # and model_fields_set contains the field + if self.accepted is None and "accepted" in self.model_fields_set: + _dict['accepted'] = None + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AcceptTypeSuggestionsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accepted": [AcceptedType.from_dict(_item) for _item in obj["accepted"]] if obj.get("accepted") is not None else None, + "data_types": [DataTypeEntry.from_dict(_item) for _item in obj["data_types"]] if obj.get("data_types") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/accepted_type.py b/revengai/models/accepted_type.py new file mode 100644 index 0000000..667c3e0 --- /dev/null +++ b/revengai/models/accepted_type.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AcceptedType(BaseModel): + """ + AcceptedType + """ # noqa: E501 + created: StrictBool = Field(description="False when the analysis already held a type under this name and kind, which this request resolved to rather than replaced.") + data_type_id: StrictInt = Field(description="The data type the suggestion is now stored as.") + key: StrictStr = Field(description="The suggestion this entry answers.") + skipped_members: StrictInt = Field(description="Members left out of the stored type because no offset or width was established for them.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["created", "data_type_id", "key", "skipped_members"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AcceptedType 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 AcceptedType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created": obj.get("created"), + "data_type_id": obj.get("data_type_id"), + "key": obj.get("key"), + "skipped_members": obj.get("skipped_members") + }) + # 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/agent_workflow_usage_output_body.py b/revengai/models/agent_workflow_usage_output_body.py new file mode 100644 index 0000000..a5c2bc0 --- /dev/null +++ b/revengai/models/agent_workflow_usage_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.workflow_day_body import WorkflowDayBody +from typing import Optional, Set +from typing_extensions import Self + +class AgentWorkflowUsageOutputBody(BaseModel): + """ + AgentWorkflowUsageOutputBody + """ # noqa: E501 + report: Optional[List[WorkflowDayBody]] = Field(description="One entry per day in the requested window, oldest first") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["report"] + + 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 AgentWorkflowUsageOutputBody 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 report (list) + _items = [] + if self.report: + for _item_report in self.report: + if _item_report: + _items.append(_item_report.to_dict()) + _dict['report'] = _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 report (nullable) is None + # and model_fields_set contains the field + if self.report is None and "report" in self.model_fields_set: + _dict['report'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentWorkflowUsageOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "report": [WorkflowDayBody.from_dict(_item) for _item in obj["report"]] if obj.get("report") 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/analyse_capabilities_body.py b/revengai/models/analyse_capabilities_body.py new file mode 100644 index 0000000..2f158c4 --- /dev/null +++ b/revengai/models/analyse_capabilities_body.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AnalyseCapabilitiesBody(BaseModel): + """ + AnalyseCapabilitiesBody + """ # noqa: E501 + completed: StrictInt = Field(description="ANALYSE_CAPABILITIES agent tasks completed that day") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["completed"] + + 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 AnalyseCapabilitiesBody 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 AnalyseCapabilitiesBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed": obj.get("completed") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_tags_output_body.py b/revengai/models/analysis_tags_output_body.py new file mode 100644 index 0000000..64774ff --- /dev/null +++ b/revengai/models/analysis_tags_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_tag_body import AnalysisTagBody +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisTagsOutputBody(BaseModel): + """ + AnalysisTagsOutputBody + """ # noqa: E501 + tags: Optional[List[AnalysisTagBody]] = Field(description="Every tag on the analysis' binary, of any origin") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["tags"] + + 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 AnalysisTagsOutputBody 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 tags (list) + _items = [] + if self.tags: + for _item_tags in self.tags: + if _item_tags: + _items.append(_item_tags.to_dict()) + _dict['tags'] = _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 tags (nullable) is None + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: + _dict['tags'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisTagsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tags": [AnalysisTagBody.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") 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/analysis_xref_output_body.py b/revengai/models/analysis_xref_output_body.py new file mode 100644 index 0000000..3a7f1c9 --- /dev/null +++ b/revengai/models/analysis_xref_output_body.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.xref_from_body import XrefFromBody +from revengai.models.xref_into_body import XrefIntoBody +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisXrefOutputBody(BaseModel): + """ + AnalysisXrefOutputBody + """ # noqa: E501 + xref_from_list: Optional[List[XrefFromBody]] = Field(description="Xrefs that originate at the queried vaddr, one per target address") + xref_to_list: Optional[List[XrefIntoBody]] = Field(description="Xrefs that target the queried vaddr, one per referencing address") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["xref_from_list", "xref_to_list"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnalysisXrefOutputBody 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 xref_from_list (list) + _items = [] + if self.xref_from_list: + for _item_xref_from_list in self.xref_from_list: + if _item_xref_from_list: + _items.append(_item_xref_from_list.to_dict()) + _dict['xref_from_list'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in xref_to_list (list) + _items = [] + if self.xref_to_list: + for _item_xref_to_list in self.xref_to_list: + if _item_xref_to_list: + _items.append(_item_xref_to_list.to_dict()) + _dict['xref_to_list'] = _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 xref_from_list (nullable) is None + # and model_fields_set contains the field + if self.xref_from_list is None and "xref_from_list" in self.model_fields_set: + _dict['xref_from_list'] = None + + # set to None if xref_to_list (nullable) is None + # and model_fields_set contains the field + if self.xref_to_list is None and "xref_to_list" in self.model_fields_set: + _dict['xref_to_list'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisXrefOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "xref_from_list": [XrefFromBody.from_dict(_item) for _item in obj["xref_from_list"]] if obj.get("xref_from_list") is not None else None, + "xref_to_list": [XrefIntoBody.from_dict(_item) for _item in obj["xref_to_list"]] if obj.get("xref_to_list") 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/binary_externals_body.py b/revengai/models/binary_externals_body.py new file mode 100644 index 0000000..35688c5 --- /dev/null +++ b/revengai/models/binary_externals_body.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BinaryExternalsBody(BaseModel): + """ + BinaryExternalsBody + """ # noqa: E501 + mb: Optional[Any] + mb_last_updated: Optional[datetime] = Field(description="When the MalwareBazaar lookup last ran, null if never looked up") + sha_256_hash: StrictStr = Field(description="SHA-256 hash the lookups were keyed by") + vt: Optional[Any] + vt_last_updated: datetime = Field(description="When the VirusTotal lookup last ran") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mb", "mb_last_updated", "sha_256_hash", "vt", "vt_last_updated"] + + 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 BinaryExternalsBody 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 mb (nullable) is None + # and model_fields_set contains the field + if self.mb is None and "mb" in self.model_fields_set: + _dict['mb'] = None + + # set to None if mb_last_updated (nullable) is None + # and model_fields_set contains the field + if self.mb_last_updated is None and "mb_last_updated" in self.model_fields_set: + _dict['mb_last_updated'] = None + + # set to None if vt (nullable) is None + # and model_fields_set contains the field + if self.vt is None and "vt" in self.model_fields_set: + _dict['vt'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BinaryExternalsBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mb": obj.get("mb"), + "mb_last_updated": obj.get("mb_last_updated"), + "sha_256_hash": obj.get("sha_256_hash"), + "vt": obj.get("vt"), + "vt_last_updated": obj.get("vt_last_updated") + }) + # 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/binary_search_result_body.py b/revengai/models/binary_search_result_body.py new file mode 100644 index 0000000..061282f --- /dev/null +++ b/revengai/models/binary_search_result_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 datetime import datetime +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 BinarySearchResultBody(BaseModel): + """ + BinarySearchResultBody + """ # noqa: E501 + analysis_id: StrictInt + binary_id: StrictInt + binary_name: StrictStr + created_at: datetime + model_id: StrictInt + model_name: StrictStr + owned_by: StrictStr + sha_256_hash: StrictStr + tags: Optional[List[StrictStr]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_id", "binary_id", "binary_name", "created_at", "model_id", "model_name", "owned_by", "sha_256_hash", "tags"] + + 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 BinarySearchResultBody 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 tags (nullable) is None + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: + _dict['tags'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BinarySearchResultBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analysis_id": obj.get("analysis_id"), + "binary_id": obj.get("binary_id"), + "binary_name": obj.get("binary_name"), + "created_at": obj.get("created_at"), + "model_id": obj.get("model_id"), + "model_name": obj.get("model_name"), + "owned_by": obj.get("owned_by"), + "sha_256_hash": obj.get("sha_256_hash"), + "tags": obj.get("tags") + }) + # 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/bulk_add_tags_input_body.py b/revengai/models/bulk_add_tags_input_body.py new file mode 100644 index 0000000..24eab56 --- /dev/null +++ b/revengai/models/bulk_add_tags_input_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class BulkAddTagsInputBody(BaseModel): + """ + BulkAddTagsInputBody + """ # noqa: E501 + analysis_ids: Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=100)]] = Field(description="IDs of the analyses to tag. The caller must own every one, or none are changed") + tags: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(description="Tags to add. A binary that already carries a tag, under any origin, is left as-is for that name") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_ids", "tags"] + + 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 BulkAddTagsInputBody 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 analysis_ids (nullable) is None + # and model_fields_set contains the field + if self.analysis_ids is None and "analysis_ids" in self.model_fields_set: + _dict['analysis_ids'] = None + + # set to None if tags (nullable) is None + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: + _dict['tags'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkAddTagsInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analysis_ids": obj.get("analysis_ids"), + "tags": obj.get("tags") + }) + # 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/bulk_add_tags_output_body.py b/revengai/models/bulk_add_tags_output_body.py new file mode 100644 index 0000000..38a9577 --- /dev/null +++ b/revengai/models/bulk_add_tags_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.bulk_add_tags_result_body import BulkAddTagsResultBody +from typing import Optional, Set +from typing_extensions import Self + +class BulkAddTagsOutputBody(BaseModel): + """ + BulkAddTagsOutputBody + """ # noqa: E501 + results: Optional[List[BulkAddTagsResultBody]] = Field(description="One entry per requested analysis, in the order they were given") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["results"] + + 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 BulkAddTagsOutputBody 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 results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if results (nullable) is None + # and model_fields_set contains the field + if self.results is None and "results" in self.model_fields_set: + _dict['results'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkAddTagsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [BulkAddTagsResultBody.from_dict(_item) for _item in obj["results"]] if obj.get("results") 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/bulk_add_tags_result_body.py b/revengai/models/bulk_add_tags_result_body.py new file mode 100644 index 0000000..5ebe5b8 --- /dev/null +++ b/revengai/models/bulk_add_tags_result_body.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BulkAddTagsResultBody(BaseModel): + """ + BulkAddTagsResultBody + """ # noqa: E501 + added_tags: Optional[List[StrictStr]] = Field(description="Tags actually added; empty when the binary already carried every requested name") + analysis_id: StrictInt = Field(description="ID of the analysis") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["added_tags", "analysis_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 BulkAddTagsResultBody 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 added_tags (nullable) is None + # and model_fields_set contains the field + if self.added_tags is None and "added_tags" in self.model_fields_set: + _dict['added_tags'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkAddTagsResultBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "added_tags": obj.get("added_tags"), + "analysis_id": obj.get("analysis_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/create_url_request.py b/revengai/models/create_url_request.py new file mode 100644 index 0000000..84116cd --- /dev/null +++ b/revengai/models/create_url_request.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateURLRequest(BaseModel): + """ + CreateURLRequest + """ # noqa: E501 + analysis_scope: Optional[StrictStr] = 'PRIVATE' + url: Annotated[str, Field(min_length=1, strict=True, max_length=2048)] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_scope", "url"] + + @field_validator('analysis_scope') + def analysis_scope_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PRIVATE', 'PUBLIC', 'TEAM', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('PRIVATE', 'PUBLIC', 'TEAM', '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 CreateURLRequest 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 CreateURLRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analysis_scope": obj.get("analysis_scope") if obj.get("analysis_scope") is not None else 'PRIVATE', + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_url_response.py b/revengai/models/create_url_response.py new file mode 100644 index 0000000..6232b51 --- /dev/null +++ b/revengai/models/create_url_response.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateURLResponse(BaseModel): + """ + CreateURLResponse + """ # noqa: E501 + analysis_id: StrictInt + binary_id: StrictInt + sha_256_hash: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_id", "binary_id", "sha_256_hash"] + + 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 CreateURLResponse 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 CreateURLResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analysis_id": obj.get("analysis_id"), + "binary_id": obj.get("binary_id"), + "sha_256_hash": obj.get("sha_256_hash") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/create_user_input_body.py b/revengai/models/create_user_input_body.py index 74974c1..e56958a 100644 --- a/revengai/models/create_user_input_body.py +++ b/revengai/models/create_user_input_body.py @@ -32,11 +32,12 @@ class CreateUserInputBody(BaseModel): last_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Last name") password: Annotated[str, Field(min_length=8, strict=True, max_length=128)] = Field(description="Initial password") role: Optional[StrictStr] = Field(default=None, description="User role (defaults to USER)") + team_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Existing team to add the user to, which also becomes their default team") tier: Optional[StrictStr] = Field(default=None, description="User tier (defaults to ENTHUSIAST)") time_zone: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="IANA time zone") username: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Username") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["credits", "email", "first_name", "last_name", "password", "role", "tier", "time_zone", "username"] + __properties: ClassVar[List[str]] = ["credits", "email", "first_name", "last_name", "password", "role", "team_id", "tier", "time_zone", "username"] @field_validator('email') def email_validate_regular_expression(cls, value): @@ -129,6 +130,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "last_name": obj.get("last_name"), "password": obj.get("password"), "role": obj.get("role"), + "team_id": obj.get("team_id"), "tier": obj.get("tier"), "time_zone": obj.get("time_zone"), "username": obj.get("username") diff --git a/revengai/models/crypto_finding.py b/revengai/models/crypto_finding.py index 3d631a7..ad05991 100644 --- a/revengai/models/crypto_finding.py +++ b/revengai/models/crypto_finding.py @@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional from revengai.models.crypto_call import CryptoCall from revengai.models.crypto_direct_match import CryptoDirectMatch +from revengai.models.crypto_verification import CryptoVerification from typing import Optional, Set from typing_extensions import Self @@ -37,8 +38,9 @@ class CryptoFinding(BaseModel): function_name: StrictStr = Field(description="Name of the function the finding was reported in") function_size: StrictInt = Field(description="Size of the function in bytes") libraries: Optional[List[StrictStr]] = Field(description="Distinct crypto libraries evidenced by this function") + verification: Optional[CryptoVerification] = Field(default=None, description="LLM verdict checking this finding against its decompilation. Present only when the run verified this finding.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "crypto_calls", "direct_matches", "evidence_count", "function_id", "function_name", "function_size", "libraries"] + __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "crypto_calls", "direct_matches", "evidence_count", "function_id", "function_name", "function_size", "libraries", "verification"] @field_validator('categories') def categories_validate_enum(cls, value): @@ -124,6 +126,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_direct_matches: _items.append(_item_direct_matches.to_dict()) _dict['direct_matches'] = _items + # override the default output from pydantic by calling `to_dict()` of verification + if self.verification: + _dict['verification'] = self.verification.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(): @@ -170,7 +175,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "function_id": obj.get("function_id"), "function_name": obj.get("function_name"), "function_size": obj.get("function_size"), - "libraries": obj.get("libraries") + "libraries": obj.get("libraries"), + "verification": CryptoVerification.from_dict(obj["verification"]) if obj.get("verification") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/crypto_verification.py b/revengai/models/crypto_verification.py new file mode 100644 index 0000000..bcd70dd --- /dev/null +++ b/revengai/models/crypto_verification.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CryptoVerification(BaseModel): + """ + CryptoVerification + """ # noqa: E501 + confidence: Optional[StrictStr] = Field(default=None, description="LLM's confidence in the verdict. Absent when verified is null.") + reasoning: StrictStr = Field(description="LLM's explanation for the verdict, or the reason verification could not be completed") + verified: Optional[StrictBool] = Field(description="Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["confidence", "reasoning", "verified"] + + @field_validator('confidence') + def confidence_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['high', 'medium', 'low', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('high', 'medium', 'low', '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 CryptoVerification 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 verified (nullable) is None + # and model_fields_set contains the field + if self.verified is None and "verified" in self.model_fields_set: + _dict['verified'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CryptoVerification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "verified": obj.get("verified") + }) + # 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/daily_analyses_count_output_body.py b/revengai/models/daily_analyses_count_output_body.py new file mode 100644 index 0000000..b6b8610 --- /dev/null +++ b/revengai/models/daily_analyses_count_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.daily_count_body import DailyCountBody +from typing import Optional, Set +from typing_extensions import Self + +class DailyAnalysesCountOutputBody(BaseModel): + """ + DailyAnalysesCountOutputBody + """ # noqa: E501 + daily_counts: Optional[List[DailyCountBody]] = Field(description="One entry per day of the last 31 days, oldest first") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["daily_counts"] + + 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 DailyAnalysesCountOutputBody 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 daily_counts (list) + _items = [] + if self.daily_counts: + for _item_daily_counts in self.daily_counts: + if _item_daily_counts: + _items.append(_item_daily_counts.to_dict()) + _dict['daily_counts'] = _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 daily_counts (nullable) is None + # and model_fields_set contains the field + if self.daily_counts is None and "daily_counts" in self.model_fields_set: + _dict['daily_counts'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DailyAnalysesCountOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "daily_counts": [DailyCountBody.from_dict(_item) for _item in obj["daily_counts"]] if obj.get("daily_counts") 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/daily_count_body.py b/revengai/models/daily_count_body.py new file mode 100644 index 0000000..eafa49e --- /dev/null +++ b/revengai/models/daily_count_body.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class DailyCountBody(BaseModel): + """ + DailyCountBody + """ # noqa: E501 + count: StrictInt = Field(description="Analyses the user created that day") + day: datetime = Field(description="Day this count covers, at midnight UTC") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["count", "day"] + + 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 DailyCountBody 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 DailyCountBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "day": obj.get("day") + }) + # 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/execution_finding.py b/revengai/models/execution_finding.py index cdfaad4..444bbd0 100644 --- a/revengai/models/execution_finding.py +++ b/revengai/models/execution_finding.py @@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional from revengai.models.execution_call import ExecutionCall from revengai.models.execution_direct_match import ExecutionDirectMatch +from revengai.models.execution_verification import ExecutionVerification from typing import Optional, Set from typing_extensions import Self @@ -38,8 +39,9 @@ class ExecutionFinding(BaseModel): function_name: StrictStr = Field(description="Name of the function the finding was reported in") function_size: StrictInt = Field(description="Size of the function in bytes") sources: Optional[List[StrictStr]] = Field(description="Distinct execution sources evidenced by this function") + verification: Optional[ExecutionVerification] = Field(default=None, description="LLM verdict checking this finding against its decompilation. Present only when the run verified this finding.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "direct_matches", "evidence_count", "executes", "execution_calls", "function_id", "function_name", "function_size", "sources"] + __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "direct_matches", "evidence_count", "executes", "execution_calls", "function_id", "function_name", "function_size", "sources", "verification"] @field_validator('categories') def categories_validate_enum(cls, value): @@ -125,6 +127,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_execution_calls: _items.append(_item_execution_calls.to_dict()) _dict['execution_calls'] = _items + # override the default output from pydantic by calling `to_dict()` of verification + if self.verification: + _dict['verification'] = self.verification.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(): @@ -172,7 +177,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "function_id": obj.get("function_id"), "function_name": obj.get("function_name"), "function_size": obj.get("function_size"), - "sources": obj.get("sources") + "sources": obj.get("sources"), + "verification": ExecutionVerification.from_dict(obj["verification"]) if obj.get("verification") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/execution_verification.py b/revengai/models/execution_verification.py new file mode 100644 index 0000000..c99827c --- /dev/null +++ b/revengai/models/execution_verification.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ExecutionVerification(BaseModel): + """ + ExecutionVerification + """ # noqa: E501 + confidence: Optional[StrictStr] = Field(default=None, description="LLM's confidence in the verdict. Absent when verified is null.") + reasoning: StrictStr = Field(description="LLM's explanation for the verdict, or the reason verification could not be completed") + verified: Optional[StrictBool] = Field(description="Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["confidence", "reasoning", "verified"] + + @field_validator('confidence') + def confidence_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['high', 'medium', 'low', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('high', 'medium', 'low', '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 ExecutionVerification 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 verified (nullable) is None + # and model_fields_set contains the field + if self.verified is None and "verified" in self.model_fields_set: + _dict['verified'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExecutionVerification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "verified": obj.get("verified") + }) + # 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/filesystem_finding.py b/revengai/models/filesystem_finding.py index 909f1d4..d528a78 100644 --- a/revengai/models/filesystem_finding.py +++ b/revengai/models/filesystem_finding.py @@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional from revengai.models.filesystem_call import FilesystemCall from revengai.models.filesystem_direct_match import FilesystemDirectMatch +from revengai.models.filesystem_verification import FilesystemVerification from typing import Optional, Set from typing_extensions import Self @@ -38,8 +39,9 @@ class FilesystemFinding(BaseModel): function_size: StrictInt = Field(description="Size of the function in bytes") modifies: StrictBool = Field(description="Whether this function evidences modifying the filesystem rather than only observing it") sources: Optional[List[StrictStr]] = Field(description="Distinct filesystem sources evidenced by this function") + verification: Optional[FilesystemVerification] = Field(default=None, description="LLM verdict checking this finding against its decompilation. Present only when the run verified this finding.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "direct_matches", "evidence_count", "filesystem_calls", "function_id", "function_name", "function_size", "modifies", "sources"] + __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "direct_matches", "evidence_count", "filesystem_calls", "function_id", "function_name", "function_size", "modifies", "sources", "verification"] @field_validator('categories') def categories_validate_enum(cls, value): @@ -125,6 +127,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_filesystem_calls: _items.append(_item_filesystem_calls.to_dict()) _dict['filesystem_calls'] = _items + # override the default output from pydantic by calling `to_dict()` of verification + if self.verification: + _dict['verification'] = self.verification.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(): @@ -172,7 +177,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "function_name": obj.get("function_name"), "function_size": obj.get("function_size"), "modifies": obj.get("modifies"), - "sources": obj.get("sources") + "sources": obj.get("sources"), + "verification": FilesystemVerification.from_dict(obj["verification"]) if obj.get("verification") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/filesystem_verification.py b/revengai/models/filesystem_verification.py new file mode 100644 index 0000000..3fb312e --- /dev/null +++ b/revengai/models/filesystem_verification.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FilesystemVerification(BaseModel): + """ + FilesystemVerification + """ # noqa: E501 + confidence: Optional[StrictStr] = Field(default=None, description="LLM's confidence in the verdict. Absent when verified is null.") + reasoning: StrictStr = Field(description="LLM's explanation for the verdict, or the reason verification could not be completed") + verified: Optional[StrictBool] = Field(description="Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["confidence", "reasoning", "verified"] + + @field_validator('confidence') + def confidence_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['high', 'medium', 'low', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('high', 'medium', 'low', '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 FilesystemVerification 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 verified (nullable) is None + # and model_fields_set contains the field + if self.verified is None and "verified" in self.model_fields_set: + _dict['verified'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FilesystemVerification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "verified": obj.get("verified") + }) + # 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_search_result_body.py b/revengai/models/function_search_result_body.py new file mode 100644 index 0000000..a3edbe3 --- /dev/null +++ b/revengai/models/function_search_result_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 datetime import datetime +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 FunctionSearchResultBody(BaseModel): + """ + FunctionSearchResultBody + """ # noqa: E501 + binary_name: StrictStr + created_at: datetime + function_id: StrictInt + function_name: StrictStr + model_id: StrictInt + model_name: StrictStr + owned_by: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binary_name", "created_at", "function_id", "function_name", "model_id", "model_name", "owned_by"] + + 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 FunctionSearchResultBody 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 FunctionSearchResultBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binary_name": obj.get("binary_name"), + "created_at": obj.get("created_at"), + "function_id": obj.get("function_id"), + "function_name": obj.get("function_name"), + "model_id": obj.get("model_id"), + "model_name": obj.get("model_name"), + "owned_by": obj.get("owned_by") + }) + # 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_binary_externals_output_body.py b/revengai/models/get_binary_externals_output_body.py new file mode 100644 index 0000000..6cc9e3d --- /dev/null +++ b/revengai/models/get_binary_externals_output_body.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from revengai.models.binary_externals_body import BinaryExternalsBody +from typing import Optional, Set +from typing_extensions import Self + +class GetBinaryExternalsOutputBody(BaseModel): + """ + GetBinaryExternalsOutputBody + """ # noqa: E501 + binary_id: StrictInt + externals: BinaryExternalsBody = Field(description="Null until at least one external lookup has run for this binary's content hash") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binary_id", "externals"] + + 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 GetBinaryExternalsOutputBody 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 externals + if self.externals: + _dict['externals'] = self.externals.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 GetBinaryExternalsOutputBody 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"), + "externals": BinaryExternalsBody.from_dict(obj["externals"]) if obj.get("externals") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/get_tokens_response.py b/revengai/models/get_tokens_response.py index ef5d892..fcee314 100644 --- a/revengai/models/get_tokens_response.py +++ b/revengai/models/get_tokens_response.py @@ -30,7 +30,7 @@ class GetTokensResponse(BaseModel): ai_decomp: StrictStr = Field(description="Tokenised AI-decompilation. Includes generated comments. Empty until a run has succeeded.") analysis_id: StrictInt = Field(description="Analysis the function belongs to. Scopes every data_type_id below.") placeholder_to_rendered_token: Dict[str, RenderedToken] = Field(description="Each placeholder token mapped to the value the server would render in its place, and the record it refers to. Null until a run has succeeded.") - placeholder_to_user_override: Dict[str, Token] = Field(description="The caller's own overrides, keyed by token. Null until a run has succeeded.") + placeholder_to_user_override: Dict[str, Token] = Field(description="The overrides on this function, keyed by token, each carrying who chose it. Null until a run has succeeded.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["ai_decomp", "analysis_id", "placeholder_to_rendered_token", "placeholder_to_user_override"] diff --git a/revengai/models/networking_finding.py b/revengai/models/networking_finding.py index 59afbe9..bf08a3d 100644 --- a/revengai/models/networking_finding.py +++ b/revengai/models/networking_finding.py @@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional from revengai.models.networking_call import NetworkingCall from revengai.models.networking_direct_match import NetworkingDirectMatch +from revengai.models.networking_verification import NetworkingVerification from typing import Optional, Set from typing_extensions import Self @@ -38,8 +39,9 @@ class NetworkingFinding(BaseModel): network_calls: Optional[List[NetworkingCall]] = Field(default=None, description="Matches against names this function calls") remote: StrictBool = Field(description="Whether this function evidences remote communication rather than only supporting it") sources: Optional[List[StrictStr]] = Field(description="Distinct networking sources evidenced by this function") + verification: Optional[NetworkingVerification] = Field(default=None, description="LLM verdict checking this finding against its decompilation. Present only when the run verified this finding.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "direct_matches", "evidence_count", "function_id", "function_name", "function_size", "network_calls", "remote", "sources"] + __properties: ClassVar[List[str]] = ["address", "categories", "confidence", "direct_matches", "evidence_count", "function_id", "function_name", "function_size", "network_calls", "remote", "sources", "verification"] @field_validator('categories') def categories_validate_enum(cls, value): @@ -125,6 +127,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_network_calls: _items.append(_item_network_calls.to_dict()) _dict['network_calls'] = _items + # override the default output from pydantic by calling `to_dict()` of verification + if self.verification: + _dict['verification'] = self.verification.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(): @@ -172,7 +177,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "function_size": obj.get("function_size"), "network_calls": [NetworkingCall.from_dict(_item) for _item in obj["network_calls"]] if obj.get("network_calls") is not None else None, "remote": obj.get("remote"), - "sources": obj.get("sources") + "sources": obj.get("sources"), + "verification": NetworkingVerification.from_dict(obj["verification"]) if obj.get("verification") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/networking_verification.py b/revengai/models/networking_verification.py new file mode 100644 index 0000000..3b8efe7 --- /dev/null +++ b/revengai/models/networking_verification.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NetworkingVerification(BaseModel): + """ + NetworkingVerification + """ # noqa: E501 + confidence: Optional[StrictStr] = Field(default=None, description="LLM's confidence in the verdict. Absent when verified is null.") + reasoning: StrictStr = Field(description="LLM's explanation for the verdict, or the reason verification could not be completed") + verified: Optional[StrictBool] = Field(description="Whether an LLM confirmed the finding against its decompilation; null if verification could not be completed, in which case the finding is kept unverified rather than dropped") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["confidence", "reasoning", "verified"] + + @field_validator('confidence') + def confidence_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['high', 'medium', 'low', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('high', 'medium', 'low', '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 NetworkingVerification 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 verified (nullable) is None + # and model_fields_set contains the field + if self.verified is None and "verified" in self.model_fields_set: + _dict['verified'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkingVerification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "verified": obj.get("verified") + }) + # 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/report_analysis_body.py b/revengai/models/report_analysis_body.py new file mode 100644 index 0000000..709e922 --- /dev/null +++ b/revengai/models/report_analysis_body.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from revengai.models.software_type_counts_body import SoftwareTypeCountsBody +from typing import Optional, Set +from typing_extensions import Self + +class ReportAnalysisBody(BaseModel): + """ + ReportAnalysisBody + """ # noqa: E501 + completed: StrictInt = Field(description="REPORT_ANALYSIS agent tasks completed that day") + software_types: SoftwareTypeCountsBody = Field(description="Breakdown of completed reports by the software type the agent classified") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["completed", "software_types"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReportAnalysisBody 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 software_types + if self.software_types: + _dict['software_types'] = self.software_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 ReportAnalysisBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed": obj.get("completed"), + "software_types": SoftwareTypeCountsBody.from_dict(obj["software_types"]) if obj.get("software_types") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/search_binaries_output_body.py b/revengai/models/search_binaries_output_body.py new file mode 100644 index 0000000..1673e6b --- /dev/null +++ b/revengai/models/search_binaries_output_body.py @@ -0,0 +1,118 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.binary_search_result_body import BinarySearchResultBody +from typing import Optional, Set +from typing_extensions import Self + +class SearchBinariesOutputBody(BaseModel): + """ + SearchBinariesOutputBody + """ # noqa: E501 + has_next_page: StrictBool + page_number: StrictInt + page_size: StrictInt + results: Optional[List[BinarySearchResultBody]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["has_next_page", "page_number", "page_size", "results"] + + 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 SearchBinariesOutputBody 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 results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if results (nullable) is None + # and model_fields_set contains the field + if self.results is None and "results" in self.model_fields_set: + _dict['results'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchBinariesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "has_next_page": obj.get("has_next_page"), + "page_number": obj.get("page_number"), + "page_size": obj.get("page_size"), + "results": [BinarySearchResultBody.from_dict(_item) for _item in obj["results"]] if obj.get("results") 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/search_functions_output_body.py b/revengai/models/search_functions_output_body.py new file mode 100644 index 0000000..e47c038 --- /dev/null +++ b/revengai/models/search_functions_output_body.py @@ -0,0 +1,118 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.function_search_result_body import FunctionSearchResultBody +from typing import Optional, Set +from typing_extensions import Self + +class SearchFunctionsOutputBody(BaseModel): + """ + SearchFunctionsOutputBody + """ # noqa: E501 + has_next_page: StrictBool + page_number: StrictInt + page_size: StrictInt + results: Optional[List[FunctionSearchResultBody]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["has_next_page", "page_number", "page_size", "results"] + + 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 SearchFunctionsOutputBody 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 results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if results (nullable) is None + # and model_fields_set contains the field + if self.results is None and "results" in self.model_fields_set: + _dict['results'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchFunctionsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "has_next_page": obj.get("has_next_page"), + "page_number": obj.get("page_number"), + "page_size": obj.get("page_size"), + "results": [FunctionSearchResultBody.from_dict(_item) for _item in obj["results"]] if obj.get("results") 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/search_tags_output_body.py b/revengai/models/search_tags_output_body.py new file mode 100644 index 0000000..65d59c8 --- /dev/null +++ b/revengai/models/search_tags_output_body.py @@ -0,0 +1,118 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.tag_search_result_body import TagSearchResultBody +from typing import Optional, Set +from typing_extensions import Self + +class SearchTagsOutputBody(BaseModel): + """ + SearchTagsOutputBody + """ # noqa: E501 + has_next_page: StrictBool + page_number: StrictInt + page_size: StrictInt + results: Optional[List[TagSearchResultBody]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["has_next_page", "page_number", "page_size", "results"] + + 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 SearchTagsOutputBody 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 results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if results (nullable) is None + # and model_fields_set contains the field + if self.results is None and "results" in self.model_fields_set: + _dict['results'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchTagsOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "has_next_page": obj.get("has_next_page"), + "page_number": obj.get("page_number"), + "page_size": obj.get("page_size"), + "results": [TagSearchResultBody.from_dict(_item) for _item in obj["results"]] if obj.get("results") 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/software_type_counts_body.py b/revengai/models/software_type_counts_body.py new file mode 100644 index 0000000..f005730 --- /dev/null +++ b/revengai/models/software_type_counts_body.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SoftwareTypeCountsBody(BaseModel): + """ + SoftwareTypeCountsBody + """ # noqa: E501 + benign: StrictInt = Field(description="Reports classifying the software as benign") + legitimate: StrictInt = Field(description="Reports classifying the software as legitimate") + legitimate_software_backdoor: StrictInt = Field(description="Reports classifying the software as a legitimate backdoor") + malicious: StrictInt = Field(description="Reports classifying the software as malicious") + potentially_unwanted_application: StrictInt = Field(description="Reports classifying the software as a potentially unwanted application") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["benign", "legitimate", "legitimate_software_backdoor", "malicious", "potentially_unwanted_application"] + + 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 SoftwareTypeCountsBody 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 SoftwareTypeCountsBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "benign": obj.get("benign"), + "legitimate": obj.get("legitimate"), + "legitimate_software_backdoor": obj.get("legitimate_software_backdoor"), + "malicious": obj.get("malicious"), + "potentially_unwanted_application": obj.get("potentially_unwanted_application") + }) + # 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/tag_search_result_body.py b/revengai/models/tag_search_result_body.py new file mode 100644 index 0000000..5597290 --- /dev/null +++ b/revengai/models/tag_search_result_body.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class TagSearchResultBody(BaseModel): + """ + TagSearchResultBody + """ # noqa: E501 + tag: StrictStr + tag_id: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["tag", "tag_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 TagSearchResultBody 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 TagSearchResultBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "tag_id": obj.get("tag_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/token.py b/revengai/models/token.py index d1153fb..085429f 100644 --- a/revengai/models/token.py +++ b/revengai/models/token.py @@ -16,8 +16,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -25,9 +25,20 @@ class Token(BaseModel): """ Token """ # noqa: E501 + source: Optional[StrictStr] = Field(default=None, description="Who chose this override. Response only; ignored in a request.") value: StrictStr = Field(description="Name the token resolves to. An empty string in a request removes the override.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["value"] + __properties: ClassVar[List[str]] = ["source", "value"] + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['user', 'llm', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('user', 'llm', 'unknown_default_open_api')") + return value model_config = ConfigDict( populate_by_name=True, @@ -87,6 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "source": obj.get("source"), "value": obj.get("value") }) # store additional fields in additional_properties diff --git a/revengai/models/update_tags_input_body.py b/revengai/models/update_tags_input_body.py new file mode 100644 index 0000000..ff7e129 --- /dev/null +++ b/revengai/models/update_tags_input_body.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpdateTagsInputBody(BaseModel): + """ + UpdateTagsInputBody + """ # noqa: E501 + tags: Optional[List[StrictStr]] = Field(description="The complete set of user tags the analysis' binary should carry after this call") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["tags"] + + 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 UpdateTagsInputBody 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 tags (nullable) is None + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: + _dict['tags'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateTagsInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tags": obj.get("tags") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/upsert_overrides_data.py b/revengai/models/upsert_overrides_data.py index d9cce59..5816ed3 100644 --- a/revengai/models/upsert_overrides_data.py +++ b/revengai/models/upsert_overrides_data.py @@ -26,7 +26,7 @@ class UpsertOverridesData(BaseModel): """ UpsertOverridesData """ # noqa: E501 - placeholder_to_user_override: Dict[str, Token] = Field(description="Every override on the function after applying this request, keyed by placeholder token.") + placeholder_to_user_override: Dict[str, Token] = Field(description="Every override on the function after applying this request, keyed by placeholder token, each carrying who chose it.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["placeholder_to_user_override"] diff --git a/revengai/models/workflow_day_body.py b/revengai/models/workflow_day_body.py new file mode 100644 index 0000000..c0d8549 --- /dev/null +++ b/revengai/models/workflow_day_body.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from revengai.models.analyse_capabilities_body import AnalyseCapabilitiesBody +from revengai.models.report_analysis_body import ReportAnalysisBody +from typing import Optional, Set +from typing_extensions import Self + +class WorkflowDayBody(BaseModel): + """ + WorkflowDayBody + """ # noqa: E501 + analyse_capabilities: AnalyseCapabilitiesBody = Field(description="ANALYSE_CAPABILITIES agent-task stats for the day") + var_date: StrictStr = Field(description="Day this entry covers", alias="date") + report_analysis: ReportAnalysisBody = Field(description="REPORT_ANALYSIS agent-task stats for the day") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analyse_capabilities", "date", "report_analysis"] + + 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 WorkflowDayBody 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 analyse_capabilities + if self.analyse_capabilities: + _dict['analyse_capabilities'] = self.analyse_capabilities.to_dict() + # override the default output from pydantic by calling `to_dict()` of report_analysis + if self.report_analysis: + _dict['report_analysis'] = self.report_analysis.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 WorkflowDayBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "analyse_capabilities": AnalyseCapabilitiesBody.from_dict(obj["analyse_capabilities"]) if obj.get("analyse_capabilities") is not None else None, + "date": obj.get("date"), + "report_analysis": ReportAnalysisBody.from_dict(obj["report_analysis"]) if obj.get("report_analysis") 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/xref_from_body.py b/revengai/models/xref_from_body.py new file mode 100644 index 0000000..77ef727 --- /dev/null +++ b/revengai/models/xref_from_body.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.xref_segment_body import XrefSegmentBody +from typing import Optional, Set +from typing_extensions import Self + +class XrefFromBody(BaseModel): + """ + XrefFromBody + """ # noqa: E501 + is_call: StrictBool = Field(description="True when the xref is a call instruction") + is_data: StrictBool = Field(description="True when the xref targets data rather than code") + is_scalar: StrictBool = Field(description="True when the xref is a scalar constant") + is_string: StrictBool = Field(description="True when the xref targets a string") + orig_str_encoding: Optional[StrictStr] = Field(default=None, description="String encoding, set only when is_string is true") + raw_data: Optional[StrictStr] = Field(default=None, description="Raw bytes at the xref target, when captured") + segment: Optional[XrefSegmentBody] = Field(default=None, description="Memory segment the xref target sits in") + value: Optional[StrictStr] = Field(default=None, description="The xref's resolved value, when the sequencer could determine one") + xref_to: StrictInt = Field(description="Address the reference targets") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["is_call", "is_data", "is_scalar", "is_string", "orig_str_encoding", "raw_data", "segment", "value", "xref_to"] + + 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 XrefFromBody 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 segment + if self.segment: + _dict['segment'] = self.segment.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 XrefFromBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "is_call": obj.get("is_call"), + "is_data": obj.get("is_data"), + "is_scalar": obj.get("is_scalar"), + "is_string": obj.get("is_string"), + "orig_str_encoding": obj.get("orig_str_encoding"), + "raw_data": obj.get("raw_data"), + "segment": XrefSegmentBody.from_dict(obj["segment"]) if obj.get("segment") is not None else None, + "value": obj.get("value"), + "xref_to": obj.get("xref_to") + }) + # 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/xref_into_body.py b/revengai/models/xref_into_body.py new file mode 100644 index 0000000..3c366af --- /dev/null +++ b/revengai/models/xref_into_body.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.xref_segment_body import XrefSegmentBody +from typing import Optional, Set +from typing_extensions import Self + +class XrefIntoBody(BaseModel): + """ + XrefIntoBody + """ # noqa: E501 + is_call: StrictBool = Field(description="True when the xref is a call instruction") + is_data: StrictBool = Field(description="True when the xref targets data rather than code") + is_scalar: StrictBool = Field(description="True when the xref is a scalar constant") + is_string: StrictBool = Field(description="True when the xref targets a string") + orig_str_encoding: Optional[StrictStr] = Field(default=None, description="String encoding, set only when is_string is true") + raw_data: Optional[StrictStr] = Field(default=None, description="Raw bytes at the xref target, when captured") + segment: Optional[XrefSegmentBody] = Field(default=None, description="Memory segment the xref target sits in") + value: Optional[StrictStr] = Field(default=None, description="The xref's resolved value, when the sequencer could determine one") + xref_from: StrictInt = Field(description="Address the reference originates from") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["is_call", "is_data", "is_scalar", "is_string", "orig_str_encoding", "raw_data", "segment", "value", "xref_from"] + + 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 XrefIntoBody 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 segment + if self.segment: + _dict['segment'] = self.segment.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 XrefIntoBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "is_call": obj.get("is_call"), + "is_data": obj.get("is_data"), + "is_scalar": obj.get("is_scalar"), + "is_string": obj.get("is_string"), + "orig_str_encoding": obj.get("orig_str_encoding"), + "raw_data": obj.get("raw_data"), + "segment": XrefSegmentBody.from_dict(obj["segment"]) if obj.get("segment") is not None else None, + "value": obj.get("value"), + "xref_from": obj.get("xref_from") + }) + # 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/xref_segment_body.py b/revengai/models/xref_segment_body.py new file mode 100644 index 0000000..5618f24 --- /dev/null +++ b/revengai/models/xref_segment_body.py @@ -0,0 +1,118 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class XrefSegmentBody(BaseModel): + """ + XrefSegmentBody + """ # noqa: E501 + end: StrictInt = Field(description="End address of the segment, inclusive") + var_exec: StrictBool = Field(description="True when the segment is executable", alias="exec") + kind: StrictStr = Field(description="Coarse classification of the segment") + name: StrictStr = Field(description="Segment name") + read: StrictBool = Field(description="True when the segment is readable") + start: StrictInt = Field(description="Start address of the segment") + write: StrictBool = Field(description="True when the segment is writable") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["end", "exec", "kind", "name", "read", "start", "write"] + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['code', 'data', 'other', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('code', 'data', 'other', '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 XrefSegmentBody 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 XrefSegmentBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "end": obj.get("end"), + "exec": obj.get("exec"), + "kind": obj.get("kind"), + "name": obj.get("name"), + "read": obj.get("read"), + "start": obj.get("start"), + "write": obj.get("write") + }) + # 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 + +