diff --git a/.sdk-version b/.sdk-version index 7947760..4fc4729 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v4.51.0 +v4.54.0 diff --git a/README.md b/README.md index f86f756..e080712 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_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 *AnalysesCommentsApi* | [**get_analysis_comments**](docs/AnalysesCommentsApi.md#get_analysis_comments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis @@ -126,19 +127,27 @@ Class | Method | HTTP request | Description *AnalysesCoreApi* | [**update_analysis_tags**](docs/AnalysesCoreApi.md#update_analysis_tags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags *AnalysesCoreApi* | [**upload_file**](docs/AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File *AnalysesCoreApi* | [**v3_create_analysis**](docs/AnalysesCoreApi.md#v3_create_analysis) | **POST** /v3/analyses | Create an analysis +*AnalysesCoreApi* | [**v3_delete_analysis**](docs/AnalysesCoreApi.md#v3_delete_analysis) | **DELETE** /v3/analyses/{analysis_id} | Delete an analysis. +*AnalysesCoreApi* | [**v3_download_binary_export**](docs/AnalysesCoreApi.md#v3_download_binary_export) | **GET** /v3/analyses/{analysis_id}/binary-export | Download a binary export +*AnalysesCoreApi* | [**v3_get_analysis**](docs/AnalysesCoreApi.md#v3_get_analysis) | **GET** /v3/analyses/{analysis_id} | Get an analysis. *AnalysesCoreApi* | [**v3_get_analysis_auto_unstrip_status**](docs/AnalysesCoreApi.md#v3_get_analysis_auto_unstrip_status) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. *AnalysesCoreApi* | [**v3_get_analysis_functions_progress**](docs/AnalysesCoreApi.md#v3_get_analysis_functions_progress) | **GET** /v3/analyses/{analysis_id}/progress/functions | Get function embedding progress for an analysis. *AnalysesCoreApi* | [**v3_get_analysis_logs**](docs/AnalysesCoreApi.md#v3_get_analysis_logs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log *AnalysesCoreApi* | [**v3_get_analysis_operation**](docs/AnalysesCoreApi.md#v3_get_analysis_operation) | **GET** /v3/operations/analyses/{analysis_id} | Get an Analysis-creation operation *AnalysesCoreApi* | [**v3_get_analysis_strings**](docs/AnalysesCoreApi.md#v3_get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. *AnalysesCoreApi* | [**v3_get_analysis_strings_status**](docs/AnalysesCoreApi.md#v3_get_analysis_strings_status) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. +*AnalysesCoreApi* | [**v3_get_binary_export_operation**](docs/AnalysesCoreApi.md#v3_get_binary_export_operation) | **GET** /v3/operations/binary-export/{task_id} | Get a binary export operation *AnalysesCoreApi* | [**v3_list_analyses**](docs/AnalysesCoreApi.md#v3_list_analyses) | **GET** /v3/analyses | List analyses *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_update_analysis**](docs/AnalysesCoreApi.md#v3_update_analysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. *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_list_analysis_capabilities**](docs/AnalysesResultsMetadataApi.md#v3_list_analysis_capabilities) | **GET** /v3/analyses/{analysis_id}/capabilities | List the capabilities found in 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 @@ -271,17 +280,21 @@ Class | Method | HTTP request | Description - [AddUserStringToFunctionInputBody](docs/AddUserStringToFunctionInputBody.md) - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) + - [AnalysisAccessBody](docs/AnalysisAccessBody.md) - [AnalysisAccessInfo](docs/AnalysisAccessInfo.md) - [AnalysisBasicInfoOutputBody](docs/AnalysisBasicInfoOutputBody.md) - [AnalysisBulkAddTagsRequest](docs/AnalysisBulkAddTagsRequest.md) - [AnalysisBulkAddTagsResponse](docs/AnalysisBulkAddTagsResponse.md) - [AnalysisBulkAddTagsResponseItem](docs/AnalysisBulkAddTagsResponseItem.md) + - [AnalysisCapabilitiesOutputBody](docs/AnalysisCapabilitiesOutputBody.md) + - [AnalysisCapabilityBody](docs/AnalysisCapabilityBody.md) - [AnalysisConfig](docs/AnalysisConfig.md) - [AnalysisConfigSnapshot](docs/AnalysisConfigSnapshot.md) - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) - [AnalysisDataTypesGroup](docs/AnalysisDataTypesGroup.md) - [AnalysisDataTypesOutputBody](docs/AnalysisDataTypesOutputBody.md) + - [AnalysisDetailOutputBody](docs/AnalysisDetailOutputBody.md) - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) - [AnalysisFunctionEntry](docs/AnalysisFunctionEntry.md) - [AnalysisFunctionMapping](docs/AnalysisFunctionMapping.md) @@ -320,6 +333,7 @@ Class | Method | HTTP request | Description - [AttemptFailedEvent](docs/AttemptFailedEvent.md) - [AttemptStartedEvent](docs/AttemptStartedEvent.md) - [AutoRunAgents](docs/AutoRunAgents.md) + - [AutoRunAgentsBody](docs/AutoRunAgentsBody.md) - [AutoUnstripStatusOutputBody](docs/AutoUnstripStatusOutputBody.md) - [BaseDataType](docs/BaseDataType.md) - [BaseResponse](docs/BaseResponse.md) @@ -398,6 +412,8 @@ Class | Method | HTTP request | Description - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) - [BinaryConfig](docs/BinaryConfig.md) - [BinaryDetailsResponse](docs/BinaryDetailsResponse.md) + - [BinaryExportMetadata](docs/BinaryExportMetadata.md) + - [BinaryExportResult](docs/BinaryExportResult.md) - [BinaryExternalsResponse](docs/BinaryExternalsResponse.md) - [BinarySearchResponse](docs/BinarySearchResponse.md) - [BinarySearchResult](docs/BinarySearchResult.md) @@ -405,6 +421,7 @@ Class | Method | HTTP request | Description - [BitfieldDataType](docs/BitfieldDataType.md) - [BulkCreateUserResult](docs/BulkCreateUserResult.md) - [BulkCreateUsersOutputBody](docs/BulkCreateUsersOutputBody.md) + - [BulkDeleteAnalysesInputBody](docs/BulkDeleteAnalysesInputBody.md) - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) - [BytesConstant](docs/BytesConstant.md) - [CallChain](docs/CallChain.md) @@ -644,6 +661,7 @@ Class | Method | HTTP request | Description - [IOC](docs/IOC.md) - [ISA](docs/ISA.md) - [IconModel](docs/IconModel.md) + - [ImportDynamicExecutionFileOutputBody](docs/ImportDynamicExecutionFileOutputBody.md) - [ImportModel](docs/ImportModel.md) - [ImportedApi](docs/ImportedApi.md) - [ImportedApiCall](docs/ImportedApiCall.md) @@ -676,6 +694,7 @@ Class | Method | HTTP request | Description - [ListUsersOutputBody](docs/ListUsersOutputBody.md) - [LocationOutputBody](docs/LocationOutputBody.md) - [Logs](docs/Logs.md) + - [LookupAnalysisByBinaryIDOutputBody](docs/LookupAnalysisByBinaryIDOutputBody.md) - [MITRETechnique](docs/MITRETechnique.md) - [MatchFilters](docs/MatchFilters.md) - [MatchedFunction](docs/MatchedFunction.md) @@ -703,6 +722,7 @@ Class | Method | HTTP request | Description - [NetworkingScanMetadata](docs/NetworkingScanMetadata.md) - [NetworkingScanResult](docs/NetworkingScanResult.md) - [OIDCCallbackInputBody](docs/OIDCCallbackInputBody.md) + - [OperationBinaryExportMetadataBinaryExportResult](docs/OperationBinaryExportMetadataBinaryExportResult.md) - [OperationCreateMetadataCreateResult](docs/OperationCreateMetadataCreateResult.md) - [OperationCryptoExplainMetadataCryptoExplainResult](docs/OperationCryptoExplainMetadataCryptoExplainResult.md) - [OperationCryptoScanMetadataCryptoScanResult](docs/OperationCryptoScanMetadataCryptoScanResult.md) @@ -778,6 +798,7 @@ Class | Method | HTTP request | Description - [ReportOptions](docs/ReportOptions.md) - [ReportReachabilityStatus](docs/ReportReachabilityStatus.md) - [ReportResult](docs/ReportResult.md) + - [RequestedConfigBody](docs/RequestedConfigBody.md) - [ResolvedEntity](docs/ResolvedEntity.md) - [ResultBody](docs/ResultBody.md) - [RevokeBody](docs/RevokeBody.md) @@ -842,6 +863,8 @@ Class | Method | HTTP request | Description - [StreamAiDecompilation200ResponseInner](docs/StreamAiDecompilation200ResponseInner.md) - [StreamEvents200ResponseInner](docs/StreamEvents200ResponseInner.md) - [StringFunctions](docs/StringFunctions.md) + - [StringMatch](docs/StringMatch.md) + - [StringMatchEvidence](docs/StringMatchEvidence.md) - [StringSource](docs/StringSource.md) - [StructDataType](docs/StructDataType.md) - [StructDefinition](docs/StructDefinition.md) @@ -856,8 +879,6 @@ Class | Method | HTTP request | Description - [SuggestedMemberView](docs/SuggestedMemberView.md) - [SuggestedTypeView](docs/SuggestedTypeView.md) - [SummaryData](docs/SummaryData.md) - - [SuspiciousString](docs/SuspiciousString.md) - - [SuspiciousStringEvidence](docs/SuspiciousStringEvidence.md) - [Symbols](docs/Symbols.md) - [Tag](docs/Tag.md) - [TagItem](docs/TagItem.md) @@ -900,6 +921,7 @@ Class | Method | HTTP request | Description - [UnionDefinition](docs/UnionDefinition.md) - [UnknownDataType](docs/UnknownDataType.md) - [UpdateAnalysisDataTypesInputBody](docs/UpdateAnalysisDataTypesInputBody.md) + - [UpdateAnalysisInputBody](docs/UpdateAnalysisInputBody.md) - [UpdateArrayDataType](docs/UpdateArrayDataType.md) - [UpdateBaseDataType](docs/UpdateBaseDataType.md) - [UpdateBitfieldDataType](docs/UpdateBitfieldDataType.md) diff --git a/docs/AnalysesBulkActionsApi.md b/docs/AnalysesBulkActionsApi.md index 3d9ae5a..95c4cf9 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_delete_analyses**](AnalysesBulkActionsApi.md#v3_batch_delete_analyses) | **POST** /v3/analyses:batchDelete | Delete multiple analyses. # **bulk_add_analysis_tags** @@ -184,3 +185,94 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **v3_batch_delete_analyses** +> v3_batch_delete_analyses(bulk_delete_analyses_input_body) + +Delete multiple analyses. + +Deactivates every given analysis. The caller must own all of them, or none are deleted. + +**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_delete_analyses_input_body import BulkDeleteAnalysesInputBody +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_delete_analyses_input_body = revengai.BulkDeleteAnalysesInputBody() # BulkDeleteAnalysesInputBody | + + try: + # Delete multiple analyses. + api_instance.v3_batch_delete_analyses(bulk_delete_analyses_input_body) + except Exception as e: + print("Exception when calling AnalysesBulkActionsApi->v3_batch_delete_analyses: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bulk_delete_analyses_input_body** | [**BulkDeleteAnalysesInputBody**](BulkDeleteAnalysesInputBody.md)| | + +### Return type + +void (empty response body) + +### 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 | +|-------------|-------------|------------------| +**204** | No Content | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 771f015..ab2b5c8 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -28,14 +28,21 @@ Method | HTTP request | Description [**update_analysis_tags**](AnalysesCoreApi.md#update_analysis_tags) | **PATCH** /v2/analyses/{analysis_id}/tags | Update Analysis Tags [**upload_file**](AnalysesCoreApi.md#upload_file) | **POST** /v2/upload | Upload File [**v3_create_analysis**](AnalysesCoreApi.md#v3_create_analysis) | **POST** /v3/analyses | Create an analysis +[**v3_delete_analysis**](AnalysesCoreApi.md#v3_delete_analysis) | **DELETE** /v3/analyses/{analysis_id} | Delete an analysis. +[**v3_download_binary_export**](AnalysesCoreApi.md#v3_download_binary_export) | **GET** /v3/analyses/{analysis_id}/binary-export | Download a binary export +[**v3_get_analysis**](AnalysesCoreApi.md#v3_get_analysis) | **GET** /v3/analyses/{analysis_id} | Get an analysis. [**v3_get_analysis_auto_unstrip_status**](AnalysesCoreApi.md#v3_get_analysis_auto_unstrip_status) | **GET** /v3/analyses/{analysis_id}/auto-unstrip/status | Get the auto-unstrip status for an analysis. [**v3_get_analysis_functions_progress**](AnalysesCoreApi.md#v3_get_analysis_functions_progress) | **GET** /v3/analyses/{analysis_id}/progress/functions | Get function embedding progress for an analysis. [**v3_get_analysis_logs**](AnalysesCoreApi.md#v3_get_analysis_logs) | **GET** /v3/analyses/{analysis_id}/logs | Get the Analysis log [**v3_get_analysis_operation**](AnalysesCoreApi.md#v3_get_analysis_operation) | **GET** /v3/operations/analyses/{analysis_id} | Get an Analysis-creation operation [**v3_get_analysis_strings**](AnalysesCoreApi.md#v3_get_analysis_strings) | **GET** /v3/analyses/{analysis_id}/functions/strings | List strings for an analysis. [**v3_get_analysis_strings_status**](AnalysesCoreApi.md#v3_get_analysis_strings_status) | **GET** /v3/analyses/{analysis_id}/functions/strings/status | Get the string-extraction status for an analysis. +[**v3_get_binary_export_operation**](AnalysesCoreApi.md#v3_get_binary_export_operation) | **GET** /v3/operations/binary-export/{task_id} | Get a binary export operation [**v3_list_analyses**](AnalysesCoreApi.md#v3_list_analyses) | **GET** /v3/analyses | List analyses [**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_update_analysis**](AnalysesCoreApi.md#v3_update_analysis) | **PATCH** /v3/analyses/{analysis_id} | Update an analysis. [**v3_upgrade_analysis_model**](AnalysesCoreApi.md#v3_upgrade_analysis_model) | **POST** /v3/analyses/{analysis_id}/upgrade-model | Re-analyse on the latest model @@ -2247,12 +2254,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_get_analysis_auto_unstrip_status** -> AutoUnstripStatusOutputBody v3_get_analysis_auto_unstrip_status(analysis_id) +# **v3_delete_analysis** +> v3_delete_analysis(analysis_id) -Get the auto-unstrip status for an analysis. +Delete an analysis. -Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. +Deactivates the analysis. Only the owner may call it. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found @@ -2265,7 +2272,6 @@ Returns the status of the auto-unstrip task for the binary backing the analysis. ```python import revengai -from revengai.models.auto_unstrip_status_output_body import AutoUnstripStatusOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2298,12 +2304,10 @@ with revengai.ApiClient(configuration) as api_client: analysis_id = 56 # int | Analysis ID try: - # Get the auto-unstrip status for an analysis. - api_response = api_instance.v3_get_analysis_auto_unstrip_status(analysis_id) - print("The response of AnalysesCoreApi->v3_get_analysis_auto_unstrip_status:\n") - pprint(api_response) + # Delete an analysis. + api_instance.v3_delete_analysis(analysis_id) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_get_analysis_auto_unstrip_status: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_delete_analysis: %s\n" % e) ``` @@ -2317,7 +2321,7 @@ Name | Type | Description | Notes ### Return type -[**AutoUnstripStatusOutputBody**](AutoUnstripStatusOutputBody.md) +void (empty response body) ### Authorization @@ -2332,7 +2336,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**204** | No Content | - | **403** | Forbidden | - | **404** | Not Found | - | **422** | Unprocessable Entity | - | @@ -2340,12 +2344,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_get_analysis_functions_progress** -> FunctionsProgressOutputBody v3_get_analysis_functions_progress(analysis_id) +# **v3_download_binary_export** +> v3_download_binary_export(analysis_id, task_id=task_id) -Get function embedding progress for an analysis. +Download a binary export -Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. +Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found @@ -2358,7 +2362,6 @@ Returns how many functions the analysis has and how many carry an embedding, wit ```python import revengai -from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2389,14 +2392,13 @@ 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 + task_id = 'task_id_example' # str | Task ID returned by queueing the export (optional) try: - # Get function embedding progress for an analysis. - api_response = api_instance.v3_get_analysis_functions_progress(analysis_id) - print("The response of AnalysesCoreApi->v3_get_analysis_functions_progress:\n") - pprint(api_response) + # Download a binary export + api_instance.v3_download_binary_export(analysis_id, task_id=task_id) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_get_analysis_functions_progress: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_download_binary_export: %s\n" % e) ``` @@ -2407,10 +2409,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_id** | **int**| Analysis ID | + **task_id** | **str**| Task ID returned by queueing the export | [optional] ### Return type -[**FunctionsProgressOutputBody**](FunctionsProgressOutputBody.md) +void (empty response body) ### Authorization @@ -2433,12 +2436,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_get_analysis_logs** -> GetAnalysisLogsOutputBody v3_get_analysis_logs(analysis_id) +# **v3_get_analysis** +> AnalysisDetailOutputBody v3_get_analysis(analysis_id) -Get the Analysis log +Get an analysis. -Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. +Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found @@ -2451,7 +2454,7 @@ Returns every log line recorded for the Analysis, oldest first, merged from ever ```python import revengai -from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody +from revengai.models.analysis_detail_output_body import AnalysisDetailOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2484,12 +2487,12 @@ with revengai.ApiClient(configuration) as api_client: analysis_id = 56 # int | Analysis ID try: - # Get the Analysis log - api_response = api_instance.v3_get_analysis_logs(analysis_id) - print("The response of AnalysesCoreApi->v3_get_analysis_logs:\n") + # Get an analysis. + api_response = api_instance.v3_get_analysis(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis:\n") pprint(api_response) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_get_analysis_logs: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_get_analysis: %s\n" % e) ``` @@ -2503,7 +2506,7 @@ Name | Type | Description | Notes ### Return type -[**GetAnalysisLogsOutputBody**](GetAnalysisLogsOutputBody.md) +[**AnalysisDetailOutputBody**](AnalysisDetailOutputBody.md) ### Authorization @@ -2526,12 +2529,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_get_analysis_operation** -> OperationCreateMetadataCreateResult v3_get_analysis_operation(analysis_id) +# **v3_get_analysis_auto_unstrip_status** +> AutoUnstripStatusOutputBody v3_get_analysis_auto_unstrip_status(analysis_id) -Get an Analysis-creation operation +Get the auto-unstrip status for an analysis. -Polls the status of an Analysis-creation operation. +Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found @@ -2544,7 +2547,7 @@ Polls the status of an Analysis-creation operation. ```python import revengai -from revengai.models.operation_create_metadata_create_result import OperationCreateMetadataCreateResult +from revengai.models.auto_unstrip_status_output_body import AutoUnstripStatusOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2577,12 +2580,12 @@ with revengai.ApiClient(configuration) as api_client: analysis_id = 56 # int | Analysis ID try: - # Get an Analysis-creation operation - api_response = api_instance.v3_get_analysis_operation(analysis_id) - print("The response of AnalysesCoreApi->v3_get_analysis_operation:\n") + # Get the auto-unstrip status for an analysis. + api_response = api_instance.v3_get_analysis_auto_unstrip_status(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_auto_unstrip_status:\n") pprint(api_response) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_get_analysis_operation: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_get_analysis_auto_unstrip_status: %s\n" % e) ``` @@ -2596,7 +2599,7 @@ Name | Type | Description | Notes ### Return type -[**OperationCreateMetadataCreateResult**](OperationCreateMetadataCreateResult.md) +[**AutoUnstripStatusOutputBody**](AutoUnstripStatusOutputBody.md) ### Authorization @@ -2619,12 +2622,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_get_analysis_strings** -> ListAnalysisStringsOutputBody v3_get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, search_operator=search_operator, function_search=function_search, order_by=order_by, sort_order=sort_order) +# **v3_get_analysis_functions_progress** +> FunctionsProgressOutputBody v3_get_analysis_functions_progress(analysis_id) -List strings for an analysis. +Get function embedding progress for an analysis. -Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. +Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found @@ -2637,7 +2640,7 @@ Returns the strings discovered in an analysis, combining function-level and anal ```python import revengai -from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody +from revengai.models.functions_progress_output_body import FunctionsProgressOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2668,21 +2671,14 @@ 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 - page = 1 # int | Page number (1-indexed). (optional) (default to 1) - page_size = 100 # int | Number of results per page. (optional) (default to 100) - search = 'search_example' # str | Filter by string value (case-insensitive substring match). (optional) - search_operator = CONTAINS # str | How the search term matches string values. (optional) (default to CONTAINS) - function_search = 'function_search_example' # str | Filter by function name (case-insensitive substring match). (optional) - order_by = value # str | Field to order results by. (optional) (default to value) - sort_order = ASC # str | Sort direction. (optional) (default to ASC) try: - # List strings for an analysis. - api_response = api_instance.v3_get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, search_operator=search_operator, function_search=function_search, order_by=order_by, sort_order=sort_order) - print("The response of AnalysesCoreApi->v3_get_analysis_strings:\n") + # Get function embedding progress for an analysis. + api_response = api_instance.v3_get_analysis_functions_progress(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_functions_progress:\n") pprint(api_response) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_get_analysis_strings: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_get_analysis_functions_progress: %s\n" % e) ``` @@ -2693,17 +2689,10 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_id** | **int**| Analysis ID | - **page** | **int**| Page number (1-indexed). | [optional] [default to 1] - **page_size** | **int**| Number of results per page. | [optional] [default to 100] - **search** | **str**| Filter by string value (case-insensitive substring match). | [optional] - **search_operator** | **str**| How the search term matches string values. | [optional] [default to CONTAINS] - **function_search** | **str**| Filter by function name (case-insensitive substring match). | [optional] - **order_by** | **str**| Field to order results by. | [optional] [default to value] - **sort_order** | **str**| Sort direction. | [optional] [default to ASC] ### Return type -[**ListAnalysisStringsOutputBody**](ListAnalysisStringsOutputBody.md) +[**FunctionsProgressOutputBody**](FunctionsProgressOutputBody.md) ### Authorization @@ -2726,12 +2715,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_get_analysis_strings_status** -> GetAnalysisStringsStatusOutputBody v3_get_analysis_strings_status(analysis_id) +# **v3_get_analysis_logs** +> GetAnalysisLogsOutputBody v3_get_analysis_logs(analysis_id) -Get the string-extraction status for an analysis. +Get the Analysis log -Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. +Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found @@ -2744,7 +2733,7 @@ Returns the status of the string-extraction task for the binary backing the anal ```python import revengai -from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody +from revengai.models.get_analysis_logs_output_body import GetAnalysisLogsOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2777,12 +2766,12 @@ with revengai.ApiClient(configuration) as api_client: analysis_id = 56 # int | Analysis ID try: - # Get the string-extraction status for an analysis. - api_response = api_instance.v3_get_analysis_strings_status(analysis_id) - print("The response of AnalysesCoreApi->v3_get_analysis_strings_status:\n") + # Get the Analysis log + api_response = api_instance.v3_get_analysis_logs(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_logs:\n") pprint(api_response) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_get_analysis_strings_status: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_get_analysis_logs: %s\n" % e) ``` @@ -2796,7 +2785,7 @@ Name | Type | Description | Notes ### Return type -[**GetAnalysisStringsStatusOutputBody**](GetAnalysisStringsStatusOutputBody.md) +[**GetAnalysisLogsOutputBody**](GetAnalysisLogsOutputBody.md) ### Authorization @@ -2819,15 +2808,16 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_list_analyses** -> ListAnalysesOutputBody v3_list_analyses(search_term=search_term, analysis_scope=analysis_scope, status=status, model_name=model_name, usernames=usernames, sha256_hash=sha256_hash, platform=platform, architecture=architecture, page_size=page_size, next_page_token=next_page_token, order_by=order_by, order=order) +# **v3_get_analysis_operation** +> OperationCreateMetadataCreateResult v3_get_analysis_operation(analysis_id) -List analyses +Get an Analysis-creation operation -Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. +Polls the status of an Analysis-creation operation. **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 ### Example @@ -2836,7 +2826,7 @@ Returns a page of analyses visible to the caller, filtered and ordered by the qu ```python import revengai -from revengai.models.list_analyses_output_body import ListAnalysesOutputBody +from revengai.models.operation_create_metadata_create_result import OperationCreateMetadataCreateResult from revengai.rest import ApiException from pprint import pprint @@ -2866,26 +2856,15 @@ configuration = revengai.Configuration( with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.AnalysesCoreApi(api_client) - search_term = 'search_term_example' # str | (optional) - analysis_scope = ['analysis_scope_example'] # List[str] | Leave empty to search your own, your team's and all public analyses (optional) - status = ['status_example'] # List[str] | (optional) - model_name = ['model_name_example'] # List[Optional[str]] | (optional) - usernames = ['usernames_example'] # List[Optional[str]] | (optional) - sha256_hash = 'sha256_hash_example' # str | (optional) - platform = ['platform_example'] # List[str] | Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) - architecture = ['architecture_example'] # List[str] | Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) - page_size = 20 # int | (optional) (default to 20) - next_page_token = 'next_page_token_example' # str | Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) - order_by = created # str | (optional) (default to created) - order = DESC # str | (optional) (default to DESC) + analysis_id = 56 # int | Analysis ID try: - # List analyses - api_response = api_instance.v3_list_analyses(search_term=search_term, analysis_scope=analysis_scope, status=status, model_name=model_name, usernames=usernames, sha256_hash=sha256_hash, platform=platform, architecture=architecture, page_size=page_size, next_page_token=next_page_token, order_by=order_by, order=order) - print("The response of AnalysesCoreApi->v3_list_analyses:\n") + # Get an Analysis-creation operation + api_response = api_instance.v3_get_analysis_operation(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_operation:\n") pprint(api_response) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_list_analyses: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_get_analysis_operation: %s\n" % e) ``` @@ -2895,22 +2874,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **search_term** | **str**| | [optional] - **analysis_scope** | [**List[str]**](str.md)| Leave empty to search your own, your team's and all public analyses | [optional] - **status** | [**List[str]**](str.md)| | [optional] - **model_name** | [**List[Optional[str]]**](str.md)| | [optional] - **usernames** | [**List[Optional[str]]**](str.md)| | [optional] - **sha256_hash** | **str**| | [optional] - **platform** | [**List[str]**](str.md)| Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter | [optional] - **architecture** | [**List[str]**](str.md)| Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter | [optional] - **page_size** | **int**| | [optional] [default to 20] - **next_page_token** | **str**| Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). | [optional] - **order_by** | **str**| | [optional] [default to created] - **order** | **str**| | [optional] [default to DESC] + **analysis_id** | **int**| Analysis ID | ### Return type -[**ListAnalysesOutputBody**](ListAnalysesOutputBody.md) +[**OperationCreateMetadataCreateResult**](OperationCreateMetadataCreateResult.md) ### Authorization @@ -2926,18 +2894,23 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | -**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | **422** | Unprocessable Entity | - | **500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **v3_list_example_analyses** -> ListExampleAnalysesOutputBody v3_list_example_analyses() +# **v3_get_analysis_strings** +> ListAnalysisStringsOutputBody v3_get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, search_operator=search_operator, function_search=function_search, order_by=order_by, sort_order=sort_order) -List example analyses +List strings for an analysis. -Returns the curated example Analyses. +Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied ### Example @@ -2946,7 +2919,7 @@ Returns the curated example Analyses. ```python import revengai -from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody +from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.rest import ApiException from pprint import pprint @@ -2976,25 +2949,43 @@ configuration = revengai.Configuration( 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 + page = 1 # int | Page number (1-indexed). (optional) (default to 1) + page_size = 100 # int | Number of results per page. (optional) (default to 100) + search = 'search_example' # str | Filter by string value (case-insensitive substring match). (optional) + search_operator = CONTAINS # str | How the search term matches string values. (optional) (default to CONTAINS) + function_search = 'function_search_example' # str | Filter by function name (case-insensitive substring match). (optional) + order_by = value # str | Field to order results by. (optional) (default to value) + sort_order = ASC # str | Sort direction. (optional) (default to ASC) try: - # List example analyses - api_response = api_instance.v3_list_example_analyses() - print("The response of AnalysesCoreApi->v3_list_example_analyses:\n") + # List strings for an analysis. + api_response = api_instance.v3_get_analysis_strings(analysis_id, page=page, page_size=page_size, search=search, search_operator=search_operator, function_search=function_search, order_by=order_by, sort_order=sort_order) + print("The response of AnalysesCoreApi->v3_get_analysis_strings:\n") pprint(api_response) except Exception as e: - print("Exception when calling AnalysesCoreApi->v3_list_example_analyses: %s\n" % e) + print("Exception when calling AnalysesCoreApi->v3_get_analysis_strings: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **page** | **int**| Page number (1-indexed). | [optional] [default to 1] + **page_size** | **int**| Number of results per page. | [optional] [default to 100] + **search** | **str**| Filter by string value (case-insensitive substring match). | [optional] + **search_operator** | **str**| How the search term matches string values. | [optional] [default to CONTAINS] + **function_search** | **str**| Filter by function name (case-insensitive substring match). | [optional] + **order_by** | **str**| Field to order results by. | [optional] [default to value] + **sort_order** | **str**| Sort direction. | [optional] [default to ASC] ### Return type -[**ListExampleAnalysesOutputBody**](ListExampleAnalysesOutputBody.md) +[**ListAnalysisStringsOutputBody**](ListAnalysisStringsOutputBody.md) ### Authorization @@ -3010,7 +3001,675 @@ This endpoint does not need any parameter. | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | -**0** | Error | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_get_analysis_strings_status** +> GetAnalysisStringsStatusOutputBody v3_get_analysis_strings_status(analysis_id) + +Get the string-extraction status for an analysis. + +Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.get_analysis_strings_status_output_body import GetAnalysisStringsStatusOutputBody +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Get the string-extraction status for an analysis. + api_response = api_instance.v3_get_analysis_strings_status(analysis_id) + print("The response of AnalysesCoreApi->v3_get_analysis_strings_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_get_analysis_strings_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**GetAnalysisStringsStatusOutputBody**](GetAnalysisStringsStatusOutputBody.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_export_operation** +> OperationBinaryExportMetadataBinaryExportResult v3_get_binary_export_operation(task_id) + +Get a binary export operation + +Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. + +**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.operation_binary_export_metadata_binary_export_result import OperationBinaryExportMetadataBinaryExportResult +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) + task_id = 'task_id_example' # str | Task ID returned by queueing the export + + try: + # Get a binary export operation + api_response = api_instance.v3_get_binary_export_operation(task_id) + print("The response of AnalysesCoreApi->v3_get_binary_export_operation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_get_binary_export_operation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **task_id** | **str**| Task ID returned by queueing the export | + +### Return type + +[**OperationBinaryExportMetadataBinaryExportResult**](OperationBinaryExportMetadataBinaryExportResult.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_analyses** +> ListAnalysesOutputBody v3_list_analyses(search_term=search_term, analysis_scope=analysis_scope, status=status, model_name=model_name, usernames=usernames, sha256_hash=sha256_hash, binary_id=binary_id, platform=platform, architecture=architecture, page_size=page_size, next_page_token=next_page_token, order_by=order_by, order=order) + +List analyses + +Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. + +**Error codes:** +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.list_analyses_output_body import ListAnalysesOutputBody +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) + search_term = 'search_term_example' # str | (optional) + analysis_scope = ['analysis_scope_example'] # List[str] | Leave empty to search your own, your team's and all public analyses (optional) + status = ['status_example'] # List[str] | (optional) + model_name = ['model_name_example'] # List[Optional[str]] | (optional) + usernames = ['usernames_example'] # List[Optional[str]] | (optional) + sha256_hash = 'sha256_hash_example' # str | (optional) + binary_id = 56 # int | Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort (optional) + platform = ['platform_example'] # List[str] | Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter (optional) + architecture = ['architecture_example'] # List[str] | Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter (optional) + page_size = 20 # int | (optional) (default to 20) + next_page_token = 'next_page_token_example' # str | Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). (optional) + order_by = created # str | (optional) (default to created) + order = DESC # str | (optional) (default to DESC) + + try: + # List analyses + api_response = api_instance.v3_list_analyses(search_term=search_term, analysis_scope=analysis_scope, status=status, model_name=model_name, usernames=usernames, sha256_hash=sha256_hash, binary_id=binary_id, platform=platform, architecture=architecture, page_size=page_size, next_page_token=next_page_token, order_by=order_by, order=order) + print("The response of AnalysesCoreApi->v3_list_analyses:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_list_analyses: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search_term** | **str**| | [optional] + **analysis_scope** | [**List[str]**](str.md)| Leave empty to search your own, your team's and all public analyses | [optional] + **status** | [**List[str]**](str.md)| | [optional] + **model_name** | [**List[Optional[str]]**](str.md)| | [optional] + **usernames** | [**List[Optional[str]]**](str.md)| | [optional] + **sha256_hash** | **str**| | [optional] + **binary_id** | **int**| Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort | [optional] + **platform** | [**List[str]**](str.md)| Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter | [optional] + **architecture** | [**List[str]**](str.md)| Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter | [optional] + **page_size** | **int**| | [optional] [default to 20] + **next_page_token** | **str**| Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). | [optional] + **order_by** | **str**| | [optional] [default to created] + **order** | **str**| | [optional] [default to DESC] + +### Return type + +[**ListAnalysesOutputBody**](ListAnalysesOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**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_example_analyses** +> ListExampleAnalysesOutputBody v3_list_example_analyses() + +List example analyses + +Returns the curated example Analyses. + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody +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) + + try: + # List example analyses + api_response = api_instance.v3_list_example_analyses() + print("The response of AnalysesCoreApi->v3_list_example_analyses:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_list_example_analyses: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ListExampleAnalysesOutputBody**](ListExampleAnalysesOutputBody.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 | - | +**0** | Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_lookup_analysis_by_binary_id** +> LookupAnalysisByBinaryIDOutputBody v3_lookup_analysis_by_binary_id(binary_id) + +Look up the most recent analysis for a binary. + +Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.lookup_analysis_by_binary_id_output_body import LookupAnalysisByBinaryIDOutputBody +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) + binary_id = 56 # int | Binary ID + + try: + # Look up the most recent analysis for a binary. + api_response = api_instance.v3_lookup_analysis_by_binary_id(binary_id) + print("The response of AnalysesCoreApi->v3_lookup_analysis_by_binary_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_lookup_analysis_by_binary_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| Binary ID | + +### Return type + +[**LookupAnalysisByBinaryIDOutputBody**](LookupAnalysisByBinaryIDOutputBody.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 | - | +**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_queue_binary_export** +> OperationBinaryExportMetadataBinaryExportResult v3_queue_binary_export(analysis_id) + +Queue a binary export + +Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. + +**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.operation_binary_export_metadata_binary_export_result import OperationBinaryExportMetadataBinaryExportResult +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + analysis_id = 56 # int | Analysis ID + + try: + # Queue a binary export + api_response = api_instance.v3_queue_binary_export(analysis_id) + print("The response of AnalysesCoreApi->v3_queue_binary_export:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_queue_binary_export: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**OperationBinaryExportMetadataBinaryExportResult**](OperationBinaryExportMetadataBinaryExportResult.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 | +|-------------|-------------|------------------| +**202** | Accepted | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **v3_update_analysis** +> AnalysisDetailOutputBody v3_update_analysis(analysis_id, update_analysis_input_body) + +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 + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.analysis_detail_output_body import AnalysisDetailOutputBody +from revengai.models.update_analysis_input_body import UpdateAnalysisInputBody +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_analysis_input_body = revengai.UpdateAnalysisInputBody() # UpdateAnalysisInputBody | + + try: + # Update an analysis. + api_response = api_instance.v3_update_analysis(analysis_id, update_analysis_input_body) + print("The response of AnalysesCoreApi->v3_update_analysis:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->v3_update_analysis: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + **update_analysis_input_body** | [**UpdateAnalysisInputBody**](UpdateAnalysisInputBody.md)| | + +### Return type + +[**AnalysisDetailOutputBody**](AnalysisDetailOutputBody.md) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/AnalysesResultsMetadataApi.md b/docs/AnalysesResultsMetadataApi.md index d72975e..f8382aa 100644 --- a/docs/AnalysesResultsMetadataApi.md +++ b/docs/AnalysesResultsMetadataApi.md @@ -8,6 +8,7 @@ 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_list_analysis_capabilities**](AnalysesResultsMetadataApi.md#v3_list_analysis_capabilities) | **GET** /v3/analyses/{analysis_id}/capabilities | List the capabilities found in an analysis. # **get_analysis_functions_paginated** @@ -366,3 +367,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_capabilities** +> AnalysisCapabilitiesOutputBody v3_list_analysis_capabilities(analysis_id) + +List the capabilities found in an analysis. + +Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities: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.analysis_capabilities_output_body import AnalysisCapabilitiesOutputBody +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 capabilities found in an analysis. + api_response = api_instance.v3_list_analysis_capabilities(analysis_id) + print("The response of AnalysesResultsMetadataApi->v3_list_analysis_capabilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesResultsMetadataApi->v3_list_analysis_capabilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| Analysis ID | + +### Return type + +[**AnalysisCapabilitiesOutputBody**](AnalysisCapabilitiesOutputBody.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/AnalysisAccessBody.md b/docs/AnalysisAccessBody.md new file mode 100644 index 0000000..7514e11 --- /dev/null +++ b/docs/AnalysisAccessBody.md @@ -0,0 +1,30 @@ +# AnalysisAccessBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner** | **bool** | True when the caller owns this analysis | +**username** | **str** | Username of the analysis owner | + +## Example + +```python +from revengai.models.analysis_access_body import AnalysisAccessBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisAccessBody from a JSON string +analysis_access_body_instance = AnalysisAccessBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisAccessBody.to_json()) + +# convert the object into a dict +analysis_access_body_dict = analysis_access_body_instance.to_dict() +# create an instance of AnalysisAccessBody from a dict +analysis_access_body_from_dict = AnalysisAccessBody.from_dict(analysis_access_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/AnalysisCapabilitiesOutputBody.md b/docs/AnalysisCapabilitiesOutputBody.md new file mode 100644 index 0000000..c878673 --- /dev/null +++ b/docs/AnalysisCapabilitiesOutputBody.md @@ -0,0 +1,29 @@ +# AnalysisCapabilitiesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | [**List[AnalysisCapabilityBody]**](AnalysisCapabilityBody.md) | Capabilities found across the binary, ordered by function address. Empty when the binary has no capability record | + +## Example + +```python +from revengai.models.analysis_capabilities_output_body import AnalysisCapabilitiesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisCapabilitiesOutputBody from a JSON string +analysis_capabilities_output_body_instance = AnalysisCapabilitiesOutputBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisCapabilitiesOutputBody.to_json()) + +# convert the object into a dict +analysis_capabilities_output_body_dict = analysis_capabilities_output_body_instance.to_dict() +# create an instance of AnalysisCapabilitiesOutputBody from a dict +analysis_capabilities_output_body_from_dict = AnalysisCapabilitiesOutputBody.from_dict(analysis_capabilities_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalysisCapabilityBody.md b/docs/AnalysisCapabilityBody.md new file mode 100644 index 0000000..02ed415 --- /dev/null +++ b/docs/AnalysisCapabilityBody.md @@ -0,0 +1,31 @@ +# AnalysisCapabilityBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | **List[str]** | Capabilities attributed to the function | +**function_name** | **str** | Name of the function the capability was found in | +**function_vaddr** | **int** | Virtual address of that function | + +## Example + +```python +from revengai.models.analysis_capability_body import AnalysisCapabilityBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisCapabilityBody from a JSON string +analysis_capability_body_instance = AnalysisCapabilityBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisCapabilityBody.to_json()) + +# convert the object into a dict +analysis_capability_body_dict = analysis_capability_body_instance.to_dict() +# create an instance of AnalysisCapabilityBody from a dict +analysis_capability_body_from_dict = AnalysisCapabilityBody.from_dict(analysis_capability_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/AnalysisDetailOutputBody.md b/docs/AnalysisDetailOutputBody.md new file mode 100644 index 0000000..4edbb18 --- /dev/null +++ b/docs/AnalysisDetailOutputBody.md @@ -0,0 +1,44 @@ +# AnalysisDetailOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access** | [**AnalysisAccessBody**](AnalysisAccessBody.md) | | +**analysis_id** | **int** | | +**analysis_scope** | **str** | | +**architecture** | **str** | | +**auto_run_agents** | [**AutoRunAgentsBody**](AutoRunAgentsBody.md) | | +**binary_dynamic** | **bool** | | +**binary_format** | **str** | | +**binary_name** | **str** | | +**binary_size** | **int** | | +**binary_type** | **str** | | +**creation** | **str** | | +**dashboard_url** | **str** | URL to view this analysis in the dashboard | +**debug** | **bool** | | +**model_name** | **str** | | +**requested_config** | [**RequestedConfigBody**](RequestedConfigBody.md) | Snapshot of the configuration the analysis was submitted with | +**sha_256_hash** | **str** | | + +## Example + +```python +from revengai.models.analysis_detail_output_body import AnalysisDetailOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisDetailOutputBody from a JSON string +analysis_detail_output_body_instance = AnalysisDetailOutputBody.from_json(json) +# print the JSON string representation of the object +print(AnalysisDetailOutputBody.to_json()) + +# convert the object into a dict +analysis_detail_output_body_dict = analysis_detail_output_body_instance.to_dict() +# create an instance of AnalysisDetailOutputBody from a dict +analysis_detail_output_body_from_dict = AnalysisDetailOutputBody.from_dict(analysis_detail_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/AutoRunAgentsBody.md b/docs/AutoRunAgentsBody.md new file mode 100644 index 0000000..b17281b --- /dev/null +++ b/docs/AutoRunAgentsBody.md @@ -0,0 +1,29 @@ +# AutoRunAgentsBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triage** | **bool** | Whether the triage agent ran automatically once the functions pipeline finished | + +## Example + +```python +from revengai.models.auto_run_agents_body import AutoRunAgentsBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AutoRunAgentsBody from a JSON string +auto_run_agents_body_instance = AutoRunAgentsBody.from_json(json) +# print the JSON string representation of the object +print(AutoRunAgentsBody.to_json()) + +# convert the object into a dict +auto_run_agents_body_dict = auto_run_agents_body_instance.to_dict() +# create an instance of AutoRunAgentsBody from a dict +auto_run_agents_body_from_dict = AutoRunAgentsBody.from_dict(auto_run_agents_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/Binary.md b/docs/Binary.md index 79e5e0d..f4f299d 100644 --- a/docs/Binary.md +++ b/docs/Binary.md @@ -9,9 +9,14 @@ Name | Type | Description | Notes **binary_id** | **int** | | **binary_name** | **str** | | **created_at** | **datetime** | | +**detected_architecture** | **str** | Detected instruction-set architecture; empty when unavailable | +**detected_binary_type** | **str** | Detected operating-system platform; empty when unavailable | **is_system_analysis** | **bool** | | +**model_name** | **str** | Name of the model the analysis ran on | **owner_id** | **int** | | **sha_256_hash** | **str** | | +**supplied_architecture** | **str** | User-supplied instruction-set architecture; \"AUTO\" when not overridden | +**supplied_binary_type** | **str** | User-supplied operating-system platform; \"AUTO\" when not overridden | ## Example diff --git a/docs/BinaryExportMetadata.md b/docs/BinaryExportMetadata.md new file mode 100644 index 0000000..10e992c --- /dev/null +++ b/docs/BinaryExportMetadata.md @@ -0,0 +1,29 @@ +# BinaryExportMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | Analysis ID | + +## Example + +```python +from revengai.models.binary_export_metadata import BinaryExportMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of BinaryExportMetadata from a JSON string +binary_export_metadata_instance = BinaryExportMetadata.from_json(json) +# print the JSON string representation of the object +print(BinaryExportMetadata.to_json()) + +# convert the object into a dict +binary_export_metadata_dict = binary_export_metadata_instance.to_dict() +# create an instance of BinaryExportMetadata from a dict +binary_export_metadata_from_dict = BinaryExportMetadata.from_dict(binary_export_metadata_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/BinaryExportResult.md b/docs/BinaryExportResult.md new file mode 100644 index 0000000..73d290b --- /dev/null +++ b/docs/BinaryExportResult.md @@ -0,0 +1,29 @@ +# BinaryExportResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_name** | **str** | Name to give the downloaded file | + +## Example + +```python +from revengai.models.binary_export_result import BinaryExportResult + +# TODO update the JSON string below +json = "{}" +# create an instance of BinaryExportResult from a JSON string +binary_export_result_instance = BinaryExportResult.from_json(json) +# print the JSON string representation of the object +print(BinaryExportResult.to_json()) + +# convert the object into a dict +binary_export_result_dict = binary_export_result_instance.to_dict() +# create an instance of BinaryExportResult from a dict +binary_export_result_from_dict = BinaryExportResult.from_dict(binary_export_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BulkDeleteAnalysesInputBody.md b/docs/BulkDeleteAnalysesInputBody.md new file mode 100644 index 0000000..da4cea1 --- /dev/null +++ b/docs/BulkDeleteAnalysesInputBody.md @@ -0,0 +1,29 @@ +# BulkDeleteAnalysesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_ids** | **List[int]** | IDs of the analyses to delete. The caller must own every one, or none are deleted | + +## Example + +```python +from revengai.models.bulk_delete_analyses_input_body import BulkDeleteAnalysesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BulkDeleteAnalysesInputBody from a JSON string +bulk_delete_analyses_input_body_instance = BulkDeleteAnalysesInputBody.from_json(json) +# print the JSON string representation of the object +print(BulkDeleteAnalysesInputBody.to_json()) + +# convert the object into a dict +bulk_delete_analyses_input_body_dict = bulk_delete_analyses_input_body_instance.to_dict() +# create an instance of BulkDeleteAnalysesInputBody from a dict +bulk_delete_analyses_input_body_from_dict = BulkDeleteAnalysesInputBody.from_dict(bulk_delete_analyses_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/FindingEvidenceInner.md b/docs/FindingEvidenceInner.md index eb1500e..7d4d1b6 100644 --- a/docs/FindingEvidenceInner.md +++ b/docs/FindingEvidenceInner.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **call_chain** | **List[int]** | | **constants** | [**List[ReferencedConstant]**](ReferencedConstant.md) | | **calls** | [**List[ImportedApiCall]**](ImportedApiCall.md) | | -**strings** | [**List[SuspiciousString]**](SuspiciousString.md) | | +**strings** | [**List[StringMatch]**](StringMatch.md) | | **similarities** | [**List[FunctionSimilarity]**](FunctionSimilarity.md) | | **apis** | [**List[ImportedApi]**](ImportedApi.md) | | **summaries** | [**List[DecompilerSummary]**](DecompilerSummary.md) | | diff --git a/docs/ImportDynamicExecutionFileOutputBody.md b/docs/ImportDynamicExecutionFileOutputBody.md new file mode 100644 index 0000000..d44dc4e --- /dev/null +++ b/docs/ImportDynamicExecutionFileOutputBody.md @@ -0,0 +1,34 @@ +# ImportDynamicExecutionFileOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_extract** | **bool** | Whether the firmware/extraction flow can accept this file. | +**can_sandbox** | **bool** | Whether the file can be extracted and run in the Windows sandbox. | +**is_archive** | **bool** | Whether the detected format is a container/compression archive. | +**mime** | **str** | The MIME type detected from the file's contents. | +**sha_256_hash** | **str** | SHA-256 hash the file is stored under; the storage key for every subsequent reference to it. | +**size** | **int** | Size of the file in bytes. | + +## Example + +```python +from revengai.models.import_dynamic_execution_file_output_body import ImportDynamicExecutionFileOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of ImportDynamicExecutionFileOutputBody from a JSON string +import_dynamic_execution_file_output_body_instance = ImportDynamicExecutionFileOutputBody.from_json(json) +# print the JSON string representation of the object +print(ImportDynamicExecutionFileOutputBody.to_json()) + +# convert the object into a dict +import_dynamic_execution_file_output_body_dict = import_dynamic_execution_file_output_body_instance.to_dict() +# create an instance of ImportDynamicExecutionFileOutputBody from a dict +import_dynamic_execution_file_output_body_from_dict = ImportDynamicExecutionFileOutputBody.from_dict(import_dynamic_execution_file_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/LookupAnalysisByBinaryIDOutputBody.md b/docs/LookupAnalysisByBinaryIDOutputBody.md new file mode 100644 index 0000000..34f16e5 --- /dev/null +++ b/docs/LookupAnalysisByBinaryIDOutputBody.md @@ -0,0 +1,29 @@ +# LookupAnalysisByBinaryIDOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_id** | **int** | Most recent analysis for this binary that the caller may see | + +## Example + +```python +from revengai.models.lookup_analysis_by_binary_id_output_body import LookupAnalysisByBinaryIDOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of LookupAnalysisByBinaryIDOutputBody from a JSON string +lookup_analysis_by_binary_id_output_body_instance = LookupAnalysisByBinaryIDOutputBody.from_json(json) +# print the JSON string representation of the object +print(LookupAnalysisByBinaryIDOutputBody.to_json()) + +# convert the object into a dict +lookup_analysis_by_binary_id_output_body_dict = lookup_analysis_by_binary_id_output_body_instance.to_dict() +# create an instance of LookupAnalysisByBinaryIDOutputBody from a dict +lookup_analysis_by_binary_id_output_body_from_dict = LookupAnalysisByBinaryIDOutputBody.from_dict(lookup_analysis_by_binary_id_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/OperationBinaryExportMetadataBinaryExportResult.md b/docs/OperationBinaryExportMetadataBinaryExportResult.md new file mode 100644 index 0000000..d30e829 --- /dev/null +++ b/docs/OperationBinaryExportMetadataBinaryExportResult.md @@ -0,0 +1,33 @@ +# OperationBinaryExportMetadataBinaryExportResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**done** | **bool** | Whether the operation has reached a terminal state. | +**error** | [**Status**](Status.md) | Failure detail, populated only when done is true and the operation failed. | [optional] +**metadata** | [**BinaryExportMetadata**](BinaryExportMetadata.md) | In-flight information and details. | [optional] +**name** | **str** | API resource name. | +**response** | [**BinaryExportResult**](BinaryExportResult.md) | Result, set only when done is true and the operation succeeded. | [optional] + +## Example + +```python +from revengai.models.operation_binary_export_metadata_binary_export_result import OperationBinaryExportMetadataBinaryExportResult + +# TODO update the JSON string below +json = "{}" +# create an instance of OperationBinaryExportMetadataBinaryExportResult from a JSON string +operation_binary_export_metadata_binary_export_result_instance = OperationBinaryExportMetadataBinaryExportResult.from_json(json) +# print the JSON string representation of the object +print(OperationBinaryExportMetadataBinaryExportResult.to_json()) + +# convert the object into a dict +operation_binary_export_metadata_binary_export_result_dict = operation_binary_export_metadata_binary_export_result_instance.to_dict() +# create an instance of OperationBinaryExportMetadataBinaryExportResult from a dict +operation_binary_export_metadata_binary_export_result_from_dict = OperationBinaryExportMetadataBinaryExportResult.from_dict(operation_binary_export_metadata_binary_export_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestedConfigBody.md b/docs/RequestedConfigBody.md new file mode 100644 index 0000000..090dd8a --- /dev/null +++ b/docs/RequestedConfigBody.md @@ -0,0 +1,33 @@ +# RequestedConfigBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | **bool** | Whether the capabilities agent was requested | +**functions** | **bool** | Whether the functions pipeline was requested | +**sandbox** | **bool** | Whether dynamic execution (sandbox) was requested | +**scrape** | **bool** | Whether external-source scraping was requested | +**triage** | **bool** | Whether the triage agent was requested | + +## Example + +```python +from revengai.models.requested_config_body import RequestedConfigBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RequestedConfigBody from a JSON string +requested_config_body_instance = RequestedConfigBody.from_json(json) +# print the JSON string representation of the object +print(RequestedConfigBody.to_json()) + +# convert the object into a dict +requested_config_body_dict = requested_config_body_instance.to_dict() +# create an instance of RequestedConfigBody from a dict +requested_config_body_from_dict = RequestedConfigBody.from_dict(requested_config_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/SuspiciousString.md b/docs/StringMatch.md similarity index 54% rename from docs/SuspiciousString.md rename to docs/StringMatch.md index 98c0ebb..97e619b 100644 --- a/docs/SuspiciousString.md +++ b/docs/StringMatch.md @@ -1,4 +1,4 @@ -# SuspiciousString +# StringMatch ## Properties @@ -11,19 +11,19 @@ Name | Type | Description | Notes ## Example ```python -from revengai.models.suspicious_string import SuspiciousString +from revengai.models.string_match import StringMatch # TODO update the JSON string below json = "{}" -# create an instance of SuspiciousString from a JSON string -suspicious_string_instance = SuspiciousString.from_json(json) +# create an instance of StringMatch from a JSON string +string_match_instance = StringMatch.from_json(json) # print the JSON string representation of the object -print(SuspiciousString.to_json()) +print(StringMatch.to_json()) # convert the object into a dict -suspicious_string_dict = suspicious_string_instance.to_dict() -# create an instance of SuspiciousString from a dict -suspicious_string_from_dict = SuspiciousString.from_dict(suspicious_string_dict) +string_match_dict = string_match_instance.to_dict() +# create an instance of StringMatch from a dict +string_match_from_dict = StringMatch.from_dict(string_match_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/StringMatchEvidence.md b/docs/StringMatchEvidence.md new file mode 100644 index 0000000..5bacb1f --- /dev/null +++ b/docs/StringMatchEvidence.md @@ -0,0 +1,34 @@ +# StringMatchEvidence + +String matches without demonstrated semantic use. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**evidence_kind** | **str** | | [optional] [default to 'string_match'] +**kind** | **str** | | [optional] [default to 'deterministic_derivation'] +**effect** | [**EvidenceEffect**](EvidenceEffect.md) | | +**strength** | **str** | | [optional] [default to 'indirect'] +**strings** | [**List[StringMatch]**](StringMatch.md) | | + +## Example + +```python +from revengai.models.string_match_evidence import StringMatchEvidence + +# TODO update the JSON string below +json = "{}" +# create an instance of StringMatchEvidence from a JSON string +string_match_evidence_instance = StringMatchEvidence.from_json(json) +# print the JSON string representation of the object +print(StringMatchEvidence.to_json()) + +# convert the object into a dict +string_match_evidence_dict = string_match_evidence_instance.to_dict() +# create an instance of StringMatchEvidence from a dict +string_match_evidence_from_dict = StringMatchEvidence.from_dict(string_match_evidence_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/SuspiciousStringEvidence.md b/docs/SuspiciousStringEvidence.md deleted file mode 100644 index 0efa38d..0000000 --- a/docs/SuspiciousStringEvidence.md +++ /dev/null @@ -1,34 +0,0 @@ -# SuspiciousStringEvidence - -Suspicious strings without demonstrated semantic use. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**evidence_kind** | **str** | | [optional] [default to 'suspicious_string'] -**kind** | **str** | | [optional] [default to 'deterministic_derivation'] -**effect** | [**EvidenceEffect**](EvidenceEffect.md) | | -**strength** | **str** | | [optional] [default to 'indirect'] -**strings** | [**List[SuspiciousString]**](SuspiciousString.md) | | - -## Example - -```python -from revengai.models.suspicious_string_evidence import SuspiciousStringEvidence - -# TODO update the JSON string below -json = "{}" -# create an instance of SuspiciousStringEvidence from a JSON string -suspicious_string_evidence_instance = SuspiciousStringEvidence.from_json(json) -# print the JSON string representation of the object -print(SuspiciousStringEvidence.to_json()) - -# convert the object into a dict -suspicious_string_evidence_dict = suspicious_string_evidence_instance.to_dict() -# create an instance of SuspiciousStringEvidence from a dict -suspicious_string_evidence_from_dict = SuspiciousStringEvidence.from_dict(suspicious_string_evidence_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/UpdateAnalysisInputBody.md b/docs/UpdateAnalysisInputBody.md new file mode 100644 index 0000000..b6c8072 --- /dev/null +++ b/docs/UpdateAnalysisInputBody.md @@ -0,0 +1,30 @@ +# UpdateAnalysisInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_scope** | **str** | The analysis' visibility. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses | [optional] +**binary_name** | **str** | Renames the analysis' binary. Empty or whitespace-only is rejected | [optional] + +## Example + +```python +from revengai.models.update_analysis_input_body import UpdateAnalysisInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateAnalysisInputBody from a JSON string +update_analysis_input_body_instance = UpdateAnalysisInputBody.from_json(json) +# print the JSON string representation of the object +print(UpdateAnalysisInputBody.to_json()) + +# convert the object into a dict +update_analysis_input_body_dict = update_analysis_input_body_instance.to_dict() +# create an instance of UpdateAnalysisInputBody from a dict +update_analysis_input_body_from_dict = UpdateAnalysisInputBody.from_dict(update_analysis_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index 8518749..e37ea7a 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v4.51.0" +__version__ = "v4.54.0" # Define package exports __all__ = [ @@ -56,17 +56,21 @@ "AddUserStringToFunctionInputBody", "AdditionalDetailsStatusResponse", "AiDecompilationRating", + "AnalysisAccessBody", "AnalysisAccessInfo", "AnalysisBasicInfoOutputBody", "AnalysisBulkAddTagsRequest", "AnalysisBulkAddTagsResponse", "AnalysisBulkAddTagsResponseItem", + "AnalysisCapabilitiesOutputBody", + "AnalysisCapabilityBody", "AnalysisConfig", "AnalysisConfigSnapshot", "AnalysisCreateRequest", "AnalysisCreateResponse", "AnalysisDataTypesGroup", "AnalysisDataTypesOutputBody", + "AnalysisDetailOutputBody", "AnalysisDetailResponse", "AnalysisFunctionEntry", "AnalysisFunctionMapping", @@ -105,6 +109,7 @@ "AttemptFailedEvent", "AttemptStartedEvent", "AutoRunAgents", + "AutoRunAgentsBody", "AutoUnstripStatusOutputBody", "BaseDataType", "BaseResponse", @@ -183,6 +188,8 @@ "BinaryAdditionalResponse", "BinaryConfig", "BinaryDetailsResponse", + "BinaryExportMetadata", + "BinaryExportResult", "BinaryExternalsResponse", "BinarySearchResponse", "BinarySearchResult", @@ -190,6 +197,7 @@ "BitfieldDataType", "BulkCreateUserResult", "BulkCreateUsersOutputBody", + "BulkDeleteAnalysesInputBody", "BulkDeleteAnalysesRequest", "BytesConstant", "CallChain", @@ -429,6 +437,7 @@ "IOC", "ISA", "IconModel", + "ImportDynamicExecutionFileOutputBody", "ImportModel", "ImportedApi", "ImportedApiCall", @@ -461,6 +470,7 @@ "ListUsersOutputBody", "LocationOutputBody", "Logs", + "LookupAnalysisByBinaryIDOutputBody", "MITRETechnique", "MatchFilters", "MatchedFunction", @@ -488,6 +498,7 @@ "NetworkingScanMetadata", "NetworkingScanResult", "OIDCCallbackInputBody", + "OperationBinaryExportMetadataBinaryExportResult", "OperationCreateMetadataCreateResult", "OperationCryptoExplainMetadataCryptoExplainResult", "OperationCryptoScanMetadataCryptoScanResult", @@ -563,6 +574,7 @@ "ReportOptions", "ReportReachabilityStatus", "ReportResult", + "RequestedConfigBody", "ResolvedEntity", "ResultBody", "RevokeBody", @@ -627,6 +639,8 @@ "StreamAiDecompilation200ResponseInner", "StreamEvents200ResponseInner", "StringFunctions", + "StringMatch", + "StringMatchEvidence", "StringSource", "StructDataType", "StructDefinition", @@ -641,8 +655,6 @@ "SuggestedMemberView", "SuggestedTypeView", "SummaryData", - "SuspiciousString", - "SuspiciousStringEvidence", "Symbols", "Tag", "TagItem", @@ -685,6 +697,7 @@ "UnionDefinition", "UnknownDataType", "UpdateAnalysisDataTypesInputBody", + "UpdateAnalysisInputBody", "UpdateArrayDataType", "UpdateBaseDataType", "UpdateBitfieldDataType", @@ -769,17 +782,21 @@ 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.ai_decompilation_rating import AiDecompilationRating as AiDecompilationRating +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 from revengai.models.analysis_bulk_add_tags_request import AnalysisBulkAddTagsRequest as AnalysisBulkAddTagsRequest from revengai.models.analysis_bulk_add_tags_response import AnalysisBulkAddTagsResponse as AnalysisBulkAddTagsResponse from revengai.models.analysis_bulk_add_tags_response_item import AnalysisBulkAddTagsResponseItem as AnalysisBulkAddTagsResponseItem +from revengai.models.analysis_capabilities_output_body import AnalysisCapabilitiesOutputBody as AnalysisCapabilitiesOutputBody +from revengai.models.analysis_capability_body import AnalysisCapabilityBody as AnalysisCapabilityBody from revengai.models.analysis_config import AnalysisConfig as AnalysisConfig from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot as AnalysisConfigSnapshot from revengai.models.analysis_create_request import AnalysisCreateRequest as AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse as AnalysisCreateResponse from revengai.models.analysis_data_types_group import AnalysisDataTypesGroup as AnalysisDataTypesGroup from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody as AnalysisDataTypesOutputBody +from revengai.models.analysis_detail_output_body import AnalysisDetailOutputBody as AnalysisDetailOutputBody from revengai.models.analysis_detail_response import AnalysisDetailResponse as AnalysisDetailResponse from revengai.models.analysis_function_entry import AnalysisFunctionEntry as AnalysisFunctionEntry from revengai.models.analysis_function_mapping import AnalysisFunctionMapping as AnalysisFunctionMapping @@ -818,6 +835,7 @@ from revengai.models.attempt_failed_event import AttemptFailedEvent as AttemptFailedEvent from revengai.models.attempt_started_event import AttemptStartedEvent as AttemptStartedEvent from revengai.models.auto_run_agents import AutoRunAgents as AutoRunAgents +from revengai.models.auto_run_agents_body import AutoRunAgentsBody as AutoRunAgentsBody from revengai.models.auto_unstrip_status_output_body import AutoUnstripStatusOutputBody as AutoUnstripStatusOutputBody from revengai.models.base_data_type import BaseDataType as BaseDataType from revengai.models.base_response import BaseResponse as BaseResponse @@ -896,6 +914,8 @@ from revengai.models.binary_additional_response import BinaryAdditionalResponse as BinaryAdditionalResponse from revengai.models.binary_config import BinaryConfig as BinaryConfig 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_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 @@ -903,6 +923,7 @@ from revengai.models.bitfield_data_type import BitfieldDataType as BitfieldDataType from revengai.models.bulk_create_user_result import BulkCreateUserResult as BulkCreateUserResult from revengai.models.bulk_create_users_output_body import BulkCreateUsersOutputBody as BulkCreateUsersOutputBody +from revengai.models.bulk_delete_analyses_input_body import BulkDeleteAnalysesInputBody as BulkDeleteAnalysesInputBody from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest as BulkDeleteAnalysesRequest from revengai.models.bytes_constant import BytesConstant as BytesConstant from revengai.models.call_chain import CallChain as CallChain @@ -1142,6 +1163,7 @@ from revengai.models.ioc import IOC as IOC from revengai.models.isa import ISA as ISA from revengai.models.icon_model import IconModel as IconModel +from revengai.models.import_dynamic_execution_file_output_body import ImportDynamicExecutionFileOutputBody as ImportDynamicExecutionFileOutputBody from revengai.models.import_model import ImportModel as ImportModel from revengai.models.imported_api import ImportedApi as ImportedApi from revengai.models.imported_api_call import ImportedApiCall as ImportedApiCall @@ -1174,6 +1196,7 @@ from revengai.models.list_users_output_body import ListUsersOutputBody as ListUsersOutputBody from revengai.models.location_output_body import LocationOutputBody as LocationOutputBody from revengai.models.logs import Logs as Logs +from revengai.models.lookup_analysis_by_binary_id_output_body import LookupAnalysisByBinaryIDOutputBody as LookupAnalysisByBinaryIDOutputBody from revengai.models.mitre_technique import MITRETechnique as MITRETechnique from revengai.models.match_filters import MatchFilters as MatchFilters from revengai.models.matched_function import MatchedFunction as MatchedFunction @@ -1201,6 +1224,7 @@ from revengai.models.networking_scan_metadata import NetworkingScanMetadata as NetworkingScanMetadata from revengai.models.networking_scan_result import NetworkingScanResult as NetworkingScanResult 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 from revengai.models.operation_crypto_explain_metadata_crypto_explain_result import OperationCryptoExplainMetadataCryptoExplainResult as OperationCryptoExplainMetadataCryptoExplainResult from revengai.models.operation_crypto_scan_metadata_crypto_scan_result import OperationCryptoScanMetadataCryptoScanResult as OperationCryptoScanMetadataCryptoScanResult @@ -1276,6 +1300,7 @@ from revengai.models.report_options import ReportOptions as ReportOptions from revengai.models.report_reachability_status import ReportReachabilityStatus as ReportReachabilityStatus from revengai.models.report_result import ReportResult as ReportResult +from revengai.models.requested_config_body import RequestedConfigBody as RequestedConfigBody from revengai.models.resolved_entity import ResolvedEntity as ResolvedEntity from revengai.models.result_body import ResultBody as ResultBody from revengai.models.revoke_body import RevokeBody as RevokeBody @@ -1340,6 +1365,8 @@ from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner as StreamAiDecompilation200ResponseInner from revengai.models.stream_events200_response_inner import StreamEvents200ResponseInner as StreamEvents200ResponseInner from revengai.models.string_functions import StringFunctions as StringFunctions +from revengai.models.string_match import StringMatch as StringMatch +from revengai.models.string_match_evidence import StringMatchEvidence as StringMatchEvidence from revengai.models.string_source import StringSource as StringSource from revengai.models.struct_data_type import StructDataType as StructDataType from revengai.models.struct_definition import StructDefinition as StructDefinition @@ -1354,8 +1381,6 @@ from revengai.models.suggested_member_view import SuggestedMemberView as SuggestedMemberView from revengai.models.suggested_type_view import SuggestedTypeView as SuggestedTypeView from revengai.models.summary_data import SummaryData as SummaryData -from revengai.models.suspicious_string import SuspiciousString as SuspiciousString -from revengai.models.suspicious_string_evidence import SuspiciousStringEvidence as SuspiciousStringEvidence from revengai.models.symbols import Symbols as Symbols from revengai.models.tag import Tag as Tag from revengai.models.tag_item import TagItem as TagItem @@ -1398,6 +1423,7 @@ from revengai.models.union_definition import UnionDefinition as UnionDefinition from revengai.models.unknown_data_type import UnknownDataType as UnknownDataType from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody as UpdateAnalysisDataTypesInputBody +from revengai.models.update_analysis_input_body import UpdateAnalysisInputBody as UpdateAnalysisInputBody from revengai.models.update_array_data_type import UpdateArrayDataType as UpdateArrayDataType from revengai.models.update_base_data_type import UpdateBaseDataType as UpdateBaseDataType from revengai.models.update_bitfield_data_type import UpdateBitfieldDataType as UpdateBitfieldDataType diff --git a/revengai/api/analyses_bulk_actions_api.py b/revengai/api/analyses_bulk_actions_api.py index 294c4e8..fde5c77 100644 --- a/revengai/api/analyses_bulk_actions_api.py +++ b/revengai/api/analyses_bulk_actions_api.py @@ -18,6 +18,7 @@ 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_delete_analyses_input_body import BulkDeleteAnalysesInputBody from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest from revengai.api_client import ApiClient, RequestSerialized @@ -598,3 +599,290 @@ def _bulk_delete_analyses_serialize( ) + + + @validate_call + def v3_batch_delete_analyses( + self, + bulk_delete_analyses_input_body: BulkDeleteAnalysesInputBody, + _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: + """Delete multiple analyses. + + Deactivates every given analysis. The caller must own all of them, or none are deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param bulk_delete_analyses_input_body: (required) + :type bulk_delete_analyses_input_body: BulkDeleteAnalysesInputBody + :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_delete_analyses_serialize( + bulk_delete_analyses_input_body=bulk_delete_analyses_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def v3_batch_delete_analyses_with_http_info( + self, + bulk_delete_analyses_input_body: BulkDeleteAnalysesInputBody, + _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]: + """Delete multiple analyses. + + Deactivates every given analysis. The caller must own all of them, or none are deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param bulk_delete_analyses_input_body: (required) + :type bulk_delete_analyses_input_body: BulkDeleteAnalysesInputBody + :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_delete_analyses_serialize( + bulk_delete_analyses_input_body=bulk_delete_analyses_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def v3_batch_delete_analyses_without_preload_content( + self, + bulk_delete_analyses_input_body: BulkDeleteAnalysesInputBody, + _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: + """Delete multiple analyses. + + Deactivates every given analysis. The caller must own all of them, or none are deleted. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param bulk_delete_analyses_input_body: (required) + :type bulk_delete_analyses_input_body: BulkDeleteAnalysesInputBody + :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_delete_analyses_serialize( + bulk_delete_analyses_input_body=bulk_delete_analyses_input_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_batch_delete_analyses_serialize( + self, + bulk_delete_analyses_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_delete_analyses_input_body is not None: + _body_params = bulk_delete_analyses_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:batchDelete', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 0bbdfdb..8bee8b6 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -21,6 +21,7 @@ from revengai.models.add_user_string_input_body import AddUserStringInputBody from revengai.models.analysis_basic_info_output_body import AnalysisBasicInfoOutputBody 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_update_request import AnalysisUpdateRequest from revengai.models.analysis_update_tags_request import AnalysisUpdateTagsRequest @@ -51,7 +52,9 @@ from revengai.models.list_analyses_output_body import ListAnalysesOutputBody from revengai.models.list_analysis_strings_output_body import ListAnalysisStringsOutputBody from revengai.models.list_example_analyses_output_body import ListExampleAnalysesOutputBody +from revengai.models.lookup_analysis_by_binary_id_output_body import LookupAnalysisByBinaryIDOutputBody from revengai.models.model_name import ModelName +from revengai.models.operation_binary_export_metadata_binary_export_result import OperationBinaryExportMetadataBinaryExportResult from revengai.models.operation_create_metadata_create_result import OperationCreateMetadataCreateResult from revengai.models.order import Order from revengai.models.put_analysis_strings_request import PutAnalysisStringsRequest @@ -59,6 +62,7 @@ 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.upgrade_analysis_model_output_body import UpgradeAnalysisModelOutputBody from revengai.models.upload_file_type import UploadFileType from revengai.models.workspace import Workspace @@ -7137,7 +7141,7 @@ def _v3_create_analysis_serialize( @validate_call - def v3_get_analysis_auto_unstrip_status( + def v3_delete_analysis( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7152,10 +7156,10 @@ def v3_get_analysis_auto_unstrip_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AutoUnstripStatusOutputBody: - """Get the auto-unstrip status for an analysis. + ) -> None: + """Delete an analysis. - Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Deactivates the analysis. 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 @@ -7181,7 +7185,7 @@ def v3_get_analysis_auto_unstrip_status( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_auto_unstrip_status_serialize( + _param = self._v3_delete_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7190,7 +7194,7 @@ def v3_get_analysis_auto_unstrip_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripStatusOutputBody", + '204': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -7208,7 +7212,7 @@ def v3_get_analysis_auto_unstrip_status( @validate_call - def v3_get_analysis_auto_unstrip_status_with_http_info( + def v3_delete_analysis_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7223,10 +7227,10 @@ def v3_get_analysis_auto_unstrip_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AutoUnstripStatusOutputBody]: - """Get the auto-unstrip status for an analysis. + ) -> ApiResponse[None]: + """Delete an analysis. - Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Deactivates the analysis. 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 @@ -7252,7 +7256,7 @@ def v3_get_analysis_auto_unstrip_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_auto_unstrip_status_serialize( + _param = self._v3_delete_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7261,7 +7265,7 @@ def v3_get_analysis_auto_unstrip_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripStatusOutputBody", + '204': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -7279,7 +7283,7 @@ def v3_get_analysis_auto_unstrip_status_with_http_info( @validate_call - def v3_get_analysis_auto_unstrip_status_without_preload_content( + def v3_delete_analysis_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7295,9 +7299,9 @@ def v3_get_analysis_auto_unstrip_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the auto-unstrip status for an analysis. + """Delete an analysis. - Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Deactivates the analysis. 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 @@ -7323,7 +7327,7 @@ def v3_get_analysis_auto_unstrip_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_auto_unstrip_status_serialize( + _param = self._v3_delete_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7332,7 +7336,7 @@ def v3_get_analysis_auto_unstrip_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AutoUnstripStatusOutputBody", + '204': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -7345,7 +7349,7 @@ def v3_get_analysis_auto_unstrip_status_without_preload_content( return response_data.response - def _v3_get_analysis_auto_unstrip_status_serialize( + def _v3_delete_analysis_serialize( self, analysis_id, _request_auth, @@ -7393,8 +7397,8 @@ def _v3_get_analysis_auto_unstrip_status_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v3/analyses/{analysis_id}/auto-unstrip/status', + method='DELETE', + resource_path='/v3/analyses/{analysis_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7411,9 +7415,10 @@ def _v3_get_analysis_auto_unstrip_status_serialize( @validate_call - def v3_get_analysis_functions_progress( + def v3_download_binary_export( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + task_id: Annotated[Optional[StrictStr], Field(description="Task ID returned by queueing the export")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7426,13 +7431,15 @@ def v3_get_analysis_functions_progress( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FunctionsProgressOutputBody: - """Get function embedding progress for an analysis. + ) -> None: + """Download a binary export - Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **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 task_id: Task ID returned by queueing the export + :type task_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7455,8 +7462,9 @@ def v3_get_analysis_functions_progress( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_functions_progress_serialize( + _param = self._v3_download_binary_export_serialize( analysis_id=analysis_id, + task_id=task_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7464,7 +7472,7 @@ def v3_get_analysis_functions_progress( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionsProgressOutputBody", + '200': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -7482,9 +7490,10 @@ def v3_get_analysis_functions_progress( @validate_call - def v3_get_analysis_functions_progress_with_http_info( + def v3_download_binary_export_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + task_id: Annotated[Optional[StrictStr], Field(description="Task ID returned by queueing the export")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7497,13 +7506,15 @@ def v3_get_analysis_functions_progress_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[FunctionsProgressOutputBody]: - """Get function embedding progress for an analysis. + ) -> ApiResponse[None]: + """Download a binary export - Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **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 task_id: Task ID returned by queueing the export + :type task_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7526,8 +7537,9 @@ def v3_get_analysis_functions_progress_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_functions_progress_serialize( + _param = self._v3_download_binary_export_serialize( analysis_id=analysis_id, + task_id=task_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7535,7 +7547,7 @@ def v3_get_analysis_functions_progress_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionsProgressOutputBody", + '200': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -7553,9 +7565,10 @@ def v3_get_analysis_functions_progress_with_http_info( @validate_call - def v3_get_analysis_functions_progress_without_preload_content( + def v3_download_binary_export_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + task_id: Annotated[Optional[StrictStr], Field(description="Task ID returned by queueing the export")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7569,12 +7582,14 @@ def v3_get_analysis_functions_progress_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get function embedding progress for an analysis. + """Download a binary export - Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Streams the exported binary. Returns 404 if the task is not complete or its result has expired -- export again in either case. **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 task_id: Task ID returned by queueing the export + :type task_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7597,8 +7612,9 @@ def v3_get_analysis_functions_progress_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_functions_progress_serialize( + _param = self._v3_download_binary_export_serialize( analysis_id=analysis_id, + task_id=task_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7606,7 +7622,7 @@ def v3_get_analysis_functions_progress_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionsProgressOutputBody", + '200': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -7619,9 +7635,10 @@ def v3_get_analysis_functions_progress_without_preload_content( return response_data.response - def _v3_get_analysis_functions_progress_serialize( + def _v3_download_binary_export_serialize( self, analysis_id, + task_id, _request_auth, _content_type, _headers, @@ -7646,6 +7663,10 @@ def _v3_get_analysis_functions_progress_serialize( if analysis_id is not None: _path_params['analysis_id'] = analysis_id # process the query parameters + if task_id is not None: + + _query_params.append(('task_id', task_id)) + # process the header parameters # process the form parameters # process the body parameter @@ -7668,7 +7689,7 @@ def _v3_get_analysis_functions_progress_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/progress/functions', + resource_path='/v3/analyses/{analysis_id}/binary-export', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7685,7 +7706,7 @@ def _v3_get_analysis_functions_progress_serialize( @validate_call - def v3_get_analysis_logs( + def v3_get_analysis( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7700,10 +7721,10 @@ def v3_get_analysis_logs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetAnalysisLogsOutputBody: - """Get the Analysis log + ) -> AnalysisDetailOutputBody: + """Get an analysis. - Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **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 @@ -7729,7 +7750,7 @@ def v3_get_analysis_logs( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_logs_serialize( + _param = self._v3_get_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7738,7 +7759,7 @@ def v3_get_analysis_logs( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAnalysisLogsOutputBody", + '200': "AnalysisDetailOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -7756,7 +7777,7 @@ def v3_get_analysis_logs( @validate_call - def v3_get_analysis_logs_with_http_info( + def v3_get_analysis_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7771,10 +7792,10 @@ def v3_get_analysis_logs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetAnalysisLogsOutputBody]: - """Get the Analysis log + ) -> ApiResponse[AnalysisDetailOutputBody]: + """Get an analysis. - Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **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 @@ -7800,7 +7821,7 @@ def v3_get_analysis_logs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_logs_serialize( + _param = self._v3_get_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7809,7 +7830,7 @@ def v3_get_analysis_logs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAnalysisLogsOutputBody", + '200': "AnalysisDetailOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -7827,7 +7848,7 @@ def v3_get_analysis_logs_with_http_info( @validate_call - def v3_get_analysis_logs_without_preload_content( + def v3_get_analysis_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7843,9 +7864,9 @@ def v3_get_analysis_logs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the Analysis log + """Get an analysis. - Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the analysis' resource-level detail: binary attributes, ownership, and the configuration it was submitted with. **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 @@ -7871,7 +7892,7 @@ def v3_get_analysis_logs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_logs_serialize( + _param = self._v3_get_analysis_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7880,7 +7901,7 @@ def v3_get_analysis_logs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAnalysisLogsOutputBody", + '200': "AnalysisDetailOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -7893,7 +7914,7 @@ def v3_get_analysis_logs_without_preload_content( return response_data.response - def _v3_get_analysis_logs_serialize( + def _v3_get_analysis_serialize( self, analysis_id, _request_auth, @@ -7942,7 +7963,7 @@ def _v3_get_analysis_logs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/logs', + resource_path='/v3/analyses/{analysis_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7959,7 +7980,7 @@ def _v3_get_analysis_logs_serialize( @validate_call - def v3_get_analysis_operation( + def v3_get_analysis_auto_unstrip_status( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -7974,10 +7995,10 @@ def v3_get_analysis_operation( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> OperationCreateMetadataCreateResult: - """Get an Analysis-creation operation + ) -> AutoUnstripStatusOutputBody: + """Get the auto-unstrip status for an analysis. - Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **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 @@ -8003,7 +8024,7 @@ def v3_get_analysis_operation( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_operation_serialize( + _param = self._v3_get_analysis_auto_unstrip_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -8012,7 +8033,7 @@ def v3_get_analysis_operation( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "OperationCreateMetadataCreateResult", + '200': "AutoUnstripStatusOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8030,7 +8051,7 @@ def v3_get_analysis_operation( @validate_call - def v3_get_analysis_operation_with_http_info( + def v3_get_analysis_auto_unstrip_status_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -8045,10 +8066,10 @@ def v3_get_analysis_operation_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[OperationCreateMetadataCreateResult]: - """Get an Analysis-creation operation + ) -> ApiResponse[AutoUnstripStatusOutputBody]: + """Get the auto-unstrip status for an analysis. - Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **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 @@ -8074,7 +8095,7 @@ def v3_get_analysis_operation_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_operation_serialize( + _param = self._v3_get_analysis_auto_unstrip_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -8083,7 +8104,7 @@ def v3_get_analysis_operation_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "OperationCreateMetadataCreateResult", + '200': "AutoUnstripStatusOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8101,7 +8122,7 @@ def v3_get_analysis_operation_with_http_info( @validate_call - def v3_get_analysis_operation_without_preload_content( + def v3_get_analysis_auto_unstrip_status_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -8117,9 +8138,9 @@ def v3_get_analysis_operation_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get an Analysis-creation operation + """Get the auto-unstrip status for an analysis. - Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns the status of the auto-unstrip task for the binary backing the analysis. One of `UNINITIALISED`, `PENDING`, `RUNNING`, `COMPLETED`, `FAILED`. **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 @@ -8145,7 +8166,7 @@ def v3_get_analysis_operation_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_operation_serialize( + _param = self._v3_get_analysis_auto_unstrip_status_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -8154,7 +8175,7 @@ def v3_get_analysis_operation_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "OperationCreateMetadataCreateResult", + '200': "AutoUnstripStatusOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8167,7 +8188,7 @@ def v3_get_analysis_operation_without_preload_content( return response_data.response - def _v3_get_analysis_operation_serialize( + def _v3_get_analysis_auto_unstrip_status_serialize( self, analysis_id, _request_auth, @@ -8216,7 +8237,7 @@ def _v3_get_analysis_operation_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/operations/analyses/{analysis_id}', + resource_path='/v3/analyses/{analysis_id}/auto-unstrip/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8233,16 +8254,9 @@ def _v3_get_analysis_operation_serialize( @validate_call - def v3_get_analysis_strings( + def v3_get_analysis_functions_progress( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, - search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, - search_operator: Annotated[Optional[StrictStr], Field(description="How the search term matches string values.")] = None, - function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, - order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8255,27 +8269,13 @@ def v3_get_analysis_strings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListAnalysisStringsOutputBody: - """List strings for an analysis. + ) -> FunctionsProgressOutputBody: + """Get function embedding progress for an analysis. - Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **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 page: Page number (1-indexed). - :type page: int - :param page_size: Number of results per page. - :type page_size: int - :param search: Filter by string value (case-insensitive substring match). - :type search: str - :param search_operator: How the search term matches string values. - :type search_operator: str - :param function_search: Filter by function name (case-insensitive substring match). - :type function_search: str - :param order_by: Field to order results by. - :type order_by: str - :param sort_order: Sort direction. - :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8298,15 +8298,8 @@ def v3_get_analysis_strings( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_strings_serialize( + _param = self._v3_get_analysis_functions_progress_serialize( analysis_id=analysis_id, - page=page, - page_size=page_size, - search=search, - search_operator=search_operator, - function_search=function_search, - order_by=order_by, - sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8314,7 +8307,7 @@ def v3_get_analysis_strings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisStringsOutputBody", + '200': "FunctionsProgressOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8332,16 +8325,9 @@ def v3_get_analysis_strings( @validate_call - def v3_get_analysis_strings_with_http_info( + def v3_get_analysis_functions_progress_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, - search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, - search_operator: Annotated[Optional[StrictStr], Field(description="How the search term matches string values.")] = None, - function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, - order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8354,27 +8340,13 @@ def v3_get_analysis_strings_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListAnalysisStringsOutputBody]: - """List strings for an analysis. + ) -> ApiResponse[FunctionsProgressOutputBody]: + """Get function embedding progress for an analysis. - Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **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 page: Page number (1-indexed). - :type page: int - :param page_size: Number of results per page. - :type page_size: int - :param search: Filter by string value (case-insensitive substring match). - :type search: str - :param search_operator: How the search term matches string values. - :type search_operator: str - :param function_search: Filter by function name (case-insensitive substring match). - :type function_search: str - :param order_by: Field to order results by. - :type order_by: str - :param sort_order: Sort direction. - :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8397,15 +8369,8 @@ def v3_get_analysis_strings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_strings_serialize( + _param = self._v3_get_analysis_functions_progress_serialize( analysis_id=analysis_id, - page=page, - page_size=page_size, - search=search, - search_operator=search_operator, - function_search=function_search, - order_by=order_by, - sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8413,7 +8378,7 @@ def v3_get_analysis_strings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisStringsOutputBody", + '200': "FunctionsProgressOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8431,16 +8396,9 @@ def v3_get_analysis_strings_with_http_info( @validate_call - def v3_get_analysis_strings_without_preload_content( + def v3_get_analysis_functions_progress_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, - search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, - search_operator: Annotated[Optional[StrictStr], Field(description="How the search term matches string values.")] = None, - function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, - order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8454,26 +8412,12 @@ def v3_get_analysis_strings_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List strings for an analysis. + """Get function embedding progress for an analysis. - Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns how many functions the analysis has and how many carry an embedding, with the percentage complete. Embeddings are counted from the unified store, so an analysis whose model predates the current multi-arch one reports zero. **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 page: Page number (1-indexed). - :type page: int - :param page_size: Number of results per page. - :type page_size: int - :param search: Filter by string value (case-insensitive substring match). - :type search: str - :param search_operator: How the search term matches string values. - :type search_operator: str - :param function_search: Filter by function name (case-insensitive substring match). - :type function_search: str - :param order_by: Field to order results by. - :type order_by: str - :param sort_order: Sort direction. - :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8496,15 +8440,8 @@ def v3_get_analysis_strings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_strings_serialize( + _param = self._v3_get_analysis_functions_progress_serialize( analysis_id=analysis_id, - page=page, - page_size=page_size, - search=search, - search_operator=search_operator, - function_search=function_search, - order_by=order_by, - sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8512,7 +8449,7 @@ def v3_get_analysis_strings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysisStringsOutputBody", + '200': "FunctionsProgressOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8525,16 +8462,9 @@ def v3_get_analysis_strings_without_preload_content( return response_data.response - def _v3_get_analysis_strings_serialize( + def _v3_get_analysis_functions_progress_serialize( self, analysis_id, - page, - page_size, - search, - search_operator, - function_search, - order_by, - sort_order, _request_auth, _content_type, _headers, @@ -8559,34 +8489,6 @@ def _v3_get_analysis_strings_serialize( if analysis_id is not None: _path_params['analysis_id'] = analysis_id # process the query parameters - if page is not None: - - _query_params.append(('page', page)) - - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if search is not None: - - _query_params.append(('search', search)) - - if search_operator is not None: - - _query_params.append(('search_operator', search_operator)) - - if function_search is not None: - - _query_params.append(('function_search', function_search)) - - if order_by is not None: - - _query_params.append(('order_by', order_by)) - - if sort_order is not None: - - _query_params.append(('sort_order', sort_order)) - # process the header parameters # process the form parameters # process the body parameter @@ -8609,7 +8511,7 @@ def _v3_get_analysis_strings_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/functions/strings', + resource_path='/v3/analyses/{analysis_id}/progress/functions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8626,7 +8528,7 @@ def _v3_get_analysis_strings_serialize( @validate_call - def v3_get_analysis_strings_status( + def v3_get_analysis_logs( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -8641,10 +8543,10 @@ def v3_get_analysis_strings_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetAnalysisStringsStatusOutputBody: - """Get the string-extraction status for an analysis. + ) -> GetAnalysisLogsOutputBody: + """Get the Analysis log - Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -8670,7 +8572,7 @@ def v3_get_analysis_strings_status( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_strings_status_serialize( + _param = self._v3_get_analysis_logs_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -8679,7 +8581,7 @@ def v3_get_analysis_strings_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAnalysisStringsStatusOutputBody", + '200': "GetAnalysisLogsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8697,7 +8599,7 @@ def v3_get_analysis_strings_status( @validate_call - def v3_get_analysis_strings_status_with_http_info( + def v3_get_analysis_logs_with_http_info( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -8712,10 +8614,10 @@ def v3_get_analysis_strings_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetAnalysisStringsStatusOutputBody]: - """Get the string-extraction status for an analysis. + ) -> ApiResponse[GetAnalysisLogsOutputBody]: + """Get the Analysis log - Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -8741,7 +8643,7 @@ def v3_get_analysis_strings_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_strings_status_serialize( + _param = self._v3_get_analysis_logs_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -8750,7 +8652,7 @@ def v3_get_analysis_strings_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAnalysisStringsStatusOutputBody", + '200': "GetAnalysisLogsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8768,7 +8670,7 @@ def v3_get_analysis_strings_status_with_http_info( @validate_call - def v3_get_analysis_strings_status_without_preload_content( + def v3_get_analysis_logs_without_preload_content( self, analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ @@ -8784,9 +8686,9 @@ def v3_get_analysis_strings_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the string-extraction status for an analysis. + """Get the Analysis log - Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Returns every log line recorded for the Analysis, oldest first, merged from every source that has written one. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param analysis_id: Analysis ID (required) :type analysis_id: int @@ -8812,7 +8714,7 @@ def v3_get_analysis_strings_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_analysis_strings_status_serialize( + _param = self._v3_get_analysis_logs_serialize( analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, @@ -8821,7 +8723,7 @@ def v3_get_analysis_strings_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetAnalysisStringsStatusOutputBody", + '200': "GetAnalysisLogsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -8834,7 +8736,7 @@ def v3_get_analysis_strings_status_without_preload_content( return response_data.response - def _v3_get_analysis_strings_status_serialize( + def _v3_get_analysis_logs_serialize( self, analysis_id, _request_auth, @@ -8883,7 +8785,7 @@ def _v3_get_analysis_strings_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/{analysis_id}/functions/strings/status', + resource_path='/v3/analyses/{analysis_id}/logs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8900,20 +8802,9 @@ def _v3_get_analysis_strings_status_serialize( @validate_call - def v3_list_analyses( + def v3_get_analysis_operation( self, - search_term: Optional[StrictStr] = None, - analysis_scope: Annotated[Optional[List[StrictStr]], Field(description="Leave empty to search your own, your team's and all public analyses")] = None, - status: Optional[List[StrictStr]] = None, - model_name: Optional[List[Optional[StrictStr]]] = None, - usernames: Optional[List[Optional[StrictStr]]] = None, - sha256_hash: Optional[StrictStr] = None, - platform: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter")] = None, - architecture: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter")] = None, - page_size: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, - next_page_token: Annotated[Optional[StrictStr], Field(description="Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination).")] = None, - order_by: Optional[StrictStr] = None, - order: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8926,35 +8817,13 @@ def v3_list_analyses( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListAnalysesOutputBody: - """List analyses + ) -> OperationCreateMetadataCreateResult: + """Get an Analysis-creation operation - Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param search_term: - :type search_term: str - :param analysis_scope: Leave empty to search your own, your team's and all public analyses - :type analysis_scope: List[str] - :param status: - :type status: List[str] - :param model_name: - :type model_name: List[Optional[str]] - :param usernames: - :type usernames: List[Optional[str]] - :param sha256_hash: - :type sha256_hash: str - :param platform: Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter - :type platform: List[str] - :param architecture: Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter - :type architecture: List[str] - :param page_size: - :type page_size: int - :param next_page_token: Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). - :type next_page_token: str - :param order_by: - :type order_by: str - :param order: - :type order: str + :param analysis_id: Analysis ID (required) + :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8977,19 +8846,8 @@ def v3_list_analyses( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_analyses_serialize( - search_term=search_term, - analysis_scope=analysis_scope, - status=status, - model_name=model_name, - usernames=usernames, - sha256_hash=sha256_hash, - platform=platform, - architecture=architecture, - page_size=page_size, - next_page_token=next_page_token, - order_by=order_by, - order=order, + _param = self._v3_get_analysis_operation_serialize( + analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8997,8 +8855,9 @@ def v3_list_analyses( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysesOutputBody", - '400': "APIError", + '200': "OperationCreateMetadataCreateResult", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -9014,20 +8873,9 @@ def v3_list_analyses( @validate_call - def v3_list_analyses_with_http_info( + def v3_get_analysis_operation_with_http_info( self, - search_term: Optional[StrictStr] = None, - analysis_scope: Annotated[Optional[List[StrictStr]], Field(description="Leave empty to search your own, your team's and all public analyses")] = None, - status: Optional[List[StrictStr]] = None, - model_name: Optional[List[Optional[StrictStr]]] = None, - usernames: Optional[List[Optional[StrictStr]]] = None, - sha256_hash: Optional[StrictStr] = None, - platform: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter")] = None, - architecture: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter")] = None, - page_size: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, - next_page_token: Annotated[Optional[StrictStr], Field(description="Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination).")] = None, - order_by: Optional[StrictStr] = None, - order: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9040,35 +8888,13 @@ def v3_list_analyses_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListAnalysesOutputBody]: - """List analyses + ) -> ApiResponse[OperationCreateMetadataCreateResult]: + """Get an Analysis-creation operation - Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param search_term: - :type search_term: str - :param analysis_scope: Leave empty to search your own, your team's and all public analyses - :type analysis_scope: List[str] - :param status: - :type status: List[str] - :param model_name: - :type model_name: List[Optional[str]] - :param usernames: - :type usernames: List[Optional[str]] - :param sha256_hash: - :type sha256_hash: str - :param platform: Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter - :type platform: List[str] - :param architecture: Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter - :type architecture: List[str] - :param page_size: - :type page_size: int - :param next_page_token: Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). - :type next_page_token: str - :param order_by: - :type order_by: str - :param order: - :type order: str + :param analysis_id: Analysis ID (required) + :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9091,19 +8917,8 @@ def v3_list_analyses_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_analyses_serialize( - search_term=search_term, - analysis_scope=analysis_scope, - status=status, - model_name=model_name, - usernames=usernames, - sha256_hash=sha256_hash, - platform=platform, - architecture=architecture, - page_size=page_size, - next_page_token=next_page_token, - order_by=order_by, - order=order, + _param = self._v3_get_analysis_operation_serialize( + analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9111,8 +8926,9 @@ def v3_list_analyses_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysesOutputBody", - '400': "APIError", + '200': "OperationCreateMetadataCreateResult", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -9128,20 +8944,9 @@ def v3_list_analyses_with_http_info( @validate_call - def v3_list_analyses_without_preload_content( + def v3_get_analysis_operation_without_preload_content( self, - search_term: Optional[StrictStr] = None, - analysis_scope: Annotated[Optional[List[StrictStr]], Field(description="Leave empty to search your own, your team's and all public analyses")] = None, - status: Optional[List[StrictStr]] = None, - model_name: Optional[List[Optional[StrictStr]]] = None, - usernames: Optional[List[Optional[StrictStr]]] = None, - sha256_hash: Optional[StrictStr] = None, - platform: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter")] = None, - architecture: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter")] = None, - page_size: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, - next_page_token: Annotated[Optional[StrictStr], Field(description="Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination).")] = None, - order_by: Optional[StrictStr] = None, - order: Optional[StrictStr] = None, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9155,34 +8960,12 @@ def v3_list_analyses_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List analyses + """Get an Analysis-creation operation - Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + Polls the status of an Analysis-creation operation. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - :param search_term: - :type search_term: str - :param analysis_scope: Leave empty to search your own, your team's and all public analyses - :type analysis_scope: List[str] - :param status: - :type status: List[str] - :param model_name: - :type model_name: List[Optional[str]] - :param usernames: - :type usernames: List[Optional[str]] - :param sha256_hash: - :type sha256_hash: str - :param platform: Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter - :type platform: List[str] - :param architecture: Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter - :type architecture: List[str] - :param page_size: - :type page_size: int - :param next_page_token: Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). - :type next_page_token: str - :param order_by: - :type order_by: str - :param order: - :type order: str + :param analysis_id: Analysis ID (required) + :type analysis_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9205,19 +8988,8 @@ def v3_list_analyses_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_analyses_serialize( - search_term=search_term, - analysis_scope=analysis_scope, - status=status, - model_name=model_name, - usernames=usernames, - sha256_hash=sha256_hash, - platform=platform, - architecture=architecture, - page_size=page_size, - next_page_token=next_page_token, - order_by=order_by, - order=order, + _param = self._v3_get_analysis_operation_serialize( + analysis_id=analysis_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9225,8 +8997,9 @@ def v3_list_analyses_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAnalysesOutputBody", - '400': "APIError", + '200': "OperationCreateMetadataCreateResult", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -9237,20 +9010,9 @@ def v3_list_analyses_without_preload_content( return response_data.response - def _v3_list_analyses_serialize( + def _v3_get_analysis_operation_serialize( self, - search_term, - analysis_scope, - status, - model_name, - usernames, - sha256_hash, - platform, - architecture, - page_size, - next_page_token, - order_by, - order, + analysis_id, _request_auth, _content_type, _headers, @@ -9260,12 +9022,6 @@ def _v3_list_analyses_serialize( _host = None _collection_formats: Dict[str, str] = { - 'analysis_scope': 'multi', - 'status': 'multi', - 'model_name': 'csv', - 'usernames': 'csv', - 'platform': 'csv', - 'architecture': 'csv', } _path_params: Dict[str, str] = {} @@ -9278,55 +9034,9 @@ def _v3_list_analyses_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id # process the query parameters - if search_term is not None: - - _query_params.append(('search_term', search_term)) - - if analysis_scope is not None: - - _query_params.append(('analysis_scope', analysis_scope)) - - if status is not None: - - _query_params.append(('status', status)) - - if model_name is not None: - - _query_params.append(('model_name', model_name)) - - if usernames is not None: - - _query_params.append(('usernames', usernames)) - - if sha256_hash is not None: - - _query_params.append(('sha256_hash', sha256_hash)) - - if platform is not None: - - _query_params.append(('platform', platform)) - - if architecture is not None: - - _query_params.append(('architecture', architecture)) - - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if next_page_token is not None: - - _query_params.append(('next_page_token', next_page_token)) - - if order_by is not None: - - _query_params.append(('order_by', order_by)) - - if order is not None: - - _query_params.append(('order', order)) - # process the header parameters # process the form parameters # process the body parameter @@ -9349,7 +9059,7 @@ def _v3_list_analyses_serialize( return self.api_client.param_serialize( method='GET', - resource_path='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/v3/analyses', + resource_path='/v3/operations/analyses/{analysis_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9366,8 +9076,16 @@ def _v3_list_analyses_serialize( @validate_call - def v3_list_example_analyses( + def v3_get_analysis_strings( self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + search_operator: Annotated[Optional[StrictStr], Field(description="How the search term matches string values.")] = None, + function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9380,11 +9098,27 @@ def v3_list_example_analyses( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListExampleAnalysesOutputBody: - """List example analyses + ) -> ListAnalysisStringsOutputBody: + """List strings for an analysis. - Returns the curated example Analyses. + Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **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 page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: str + :param search_operator: How the search term matches string values. + :type search_operator: str + :param function_search: Filter by function name (case-insensitive substring match). + :type function_search: str + :param order_by: Field to order results by. + :type order_by: str + :param sort_order: Sort direction. + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9407,7 +9141,15 @@ def v3_list_example_analyses( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_example_analyses_serialize( + _param = self._v3_get_analysis_strings_serialize( + analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + search_operator=search_operator, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9415,7 +9157,11 @@ def v3_list_example_analyses( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListExampleAnalysesOutputBody", + '200': "ListAnalysisStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -9429,8 +9175,16 @@ def v3_list_example_analyses( @validate_call - def v3_list_example_analyses_with_http_info( + def v3_get_analysis_strings_with_http_info( self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + search_operator: Annotated[Optional[StrictStr], Field(description="How the search term matches string values.")] = None, + function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9443,11 +9197,27 @@ def v3_list_example_analyses_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListExampleAnalysesOutputBody]: - """List example analyses + ) -> ApiResponse[ListAnalysisStringsOutputBody]: + """List strings for an analysis. - Returns the curated example Analyses. + Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **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 page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: str + :param search_operator: How the search term matches string values. + :type search_operator: str + :param function_search: Filter by function name (case-insensitive substring match). + :type function_search: str + :param order_by: Field to order results by. + :type order_by: str + :param sort_order: Sort direction. + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9470,7 +9240,15 @@ def v3_list_example_analyses_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_example_analyses_serialize( + _param = self._v3_get_analysis_strings_serialize( + analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + search_operator=search_operator, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9478,7 +9256,11 @@ def v3_list_example_analyses_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListExampleAnalysesOutputBody", + '200': "ListAnalysisStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -9492,8 +9274,16 @@ def v3_list_example_analyses_with_http_info( @validate_call - def v3_list_example_analyses_without_preload_content( + def v3_get_analysis_strings_without_preload_content( self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number (1-indexed).")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Number of results per page.")] = None, + search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by string value (case-insensitive substring match).")] = None, + search_operator: Annotated[Optional[StrictStr], Field(description="How the search term matches string values.")] = None, + function_search: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Filter by function name (case-insensitive substring match).")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by.")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="Sort direction.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9507,10 +9297,26 @@ def v3_list_example_analyses_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List example analyses + """List strings for an analysis. - Returns the curated example Analyses. + Returns the strings discovered in an analysis, combining function-level and analysis-level strings. Supports value/function-name search, sorting and pagination. **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 page: Page number (1-indexed). + :type page: int + :param page_size: Number of results per page. + :type page_size: int + :param search: Filter by string value (case-insensitive substring match). + :type search: str + :param search_operator: How the search term matches string values. + :type search_operator: str + :param function_search: Filter by function name (case-insensitive substring match). + :type function_search: str + :param order_by: Field to order results by. + :type order_by: str + :param sort_order: Sort direction. + :type sort_order: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9533,7 +9339,15 @@ def v3_list_example_analyses_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_example_analyses_serialize( + _param = self._v3_get_analysis_strings_serialize( + analysis_id=analysis_id, + page=page, + page_size=page_size, + search=search, + search_operator=search_operator, + function_search=function_search, + order_by=order_by, + sort_order=sort_order, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9541,7 +9355,11 @@ def v3_list_example_analyses_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListExampleAnalysesOutputBody", + '200': "ListAnalysisStringsOutputBody", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -9550,8 +9368,16 @@ def v3_list_example_analyses_without_preload_content( return response_data.response - def _v3_list_example_analyses_serialize( + def _v3_get_analysis_strings_serialize( self, + analysis_id, + page, + page_size, + search, + search_operator, + function_search, + order_by, + sort_order, _request_auth, _content_type, _headers, @@ -9573,7 +9399,37 @@ def _v3_list_example_analyses_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if search is not None: + + _query_params.append(('search', search)) + + if search_operator is not None: + + _query_params.append(('search_operator', search_operator)) + + if function_search is not None: + + _query_params.append(('function_search', function_search)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if sort_order is not None: + + _query_params.append(('sort_order', sort_order)) + # process the header parameters # process the form parameters # process the body parameter @@ -9596,7 +9452,2135 @@ def _v3_list_example_analyses_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/analyses/examples', + resource_path='/v3/analyses/{analysis_id}/functions/strings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_analysis_strings_status( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetAnalysisStringsStatusOutputBody: + """Get the string-extraction status for an analysis. + + Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_strings_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAnalysisStringsStatusOutputBody", + '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_strings_status_with_http_info( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetAnalysisStringsStatusOutputBody]: + """Get the string-extraction status for an analysis. + + Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_strings_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAnalysisStringsStatusOutputBody", + '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_strings_status_without_preload_content( + self, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the string-extraction status for an analysis. + + Returns the status of the string-extraction task for the binary backing the analysis. One of UNINITIALISED, PENDING, RUNNING, COMPLETED, FAILED. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param analysis_id: Analysis ID (required) + :type analysis_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_analysis_strings_status_serialize( + analysis_id=analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAnalysisStringsStatusOutputBody", + '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_strings_status_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/{analysis_id}/functions/strings/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def v3_get_binary_export_operation( + self, + task_id: Annotated[StrictStr, Field(description="Task ID returned by queueing the export")], + _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, + ) -> OperationBinaryExportMetadataBinaryExportResult: + """Get a binary export operation + + Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param task_id: Task ID returned by queueing the export (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_export_operation_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperationBinaryExportMetadataBinaryExportResult", + '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_export_operation_with_http_info( + self, + task_id: Annotated[StrictStr, Field(description="Task ID returned by queueing the export")], + _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[OperationBinaryExportMetadataBinaryExportResult]: + """Get a binary export operation + + Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param task_id: Task ID returned by queueing the export (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_export_operation_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperationBinaryExportMetadataBinaryExportResult", + '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_export_operation_without_preload_content( + self, + task_id: Annotated[StrictStr, Field(description="Task ID returned by queueing the export")], + _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 a binary export operation + + Returns the current state of the export started for this task ID. `done` is the only readiness signal: while false, poll again; once true, exactly one of `response` or `error` is set. A task ID the platform no longer recognises -- whether it never existed or its history has expired -- resolves to a failed operation, since either way the caller must export again. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + + :param task_id: Task ID returned by queueing the export (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._v3_get_binary_export_operation_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperationBinaryExportMetadataBinaryExportResult", + '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_export_operation_serialize( + self, + task_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 task_id is not None: + _path_params['task_id'] = task_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/operations/binary-export/{task_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_list_analyses( + self, + search_term: Optional[StrictStr] = None, + analysis_scope: Annotated[Optional[List[StrictStr]], Field(description="Leave empty to search your own, your team's and all public analyses")] = None, + status: Optional[List[StrictStr]] = None, + model_name: Optional[List[Optional[StrictStr]]] = None, + usernames: Optional[List[Optional[StrictStr]]] = None, + sha256_hash: Optional[StrictStr] = None, + binary_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort")] = None, + platform: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter")] = None, + architecture: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter")] = None, + page_size: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, + next_page_token: Annotated[Optional[StrictStr], Field(description="Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination).")] = None, + order_by: Optional[StrictStr] = None, + order: Optional[StrictStr] = 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, + ) -> ListAnalysesOutputBody: + """List analyses + + Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param search_term: + :type search_term: str + :param analysis_scope: Leave empty to search your own, your team's and all public analyses + :type analysis_scope: List[str] + :param status: + :type status: List[str] + :param model_name: + :type model_name: List[Optional[str]] + :param usernames: + :type usernames: List[Optional[str]] + :param sha256_hash: + :type sha256_hash: str + :param binary_id: Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort + :type binary_id: int + :param platform: Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter + :type platform: List[str] + :param architecture: Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter + :type architecture: List[str] + :param page_size: + :type page_size: int + :param next_page_token: Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). + :type next_page_token: str + :param order_by: + :type order_by: str + :param order: + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_analyses_serialize( + search_term=search_term, + analysis_scope=analysis_scope, + status=status, + model_name=model_name, + usernames=usernames, + sha256_hash=sha256_hash, + binary_id=binary_id, + platform=platform, + architecture=architecture, + page_size=page_size, + next_page_token=next_page_token, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysesOutputBody", + '400': "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_analyses_with_http_info( + self, + search_term: Optional[StrictStr] = None, + analysis_scope: Annotated[Optional[List[StrictStr]], Field(description="Leave empty to search your own, your team's and all public analyses")] = None, + status: Optional[List[StrictStr]] = None, + model_name: Optional[List[Optional[StrictStr]]] = None, + usernames: Optional[List[Optional[StrictStr]]] = None, + sha256_hash: Optional[StrictStr] = None, + binary_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort")] = None, + platform: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter")] = None, + architecture: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter")] = None, + page_size: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, + next_page_token: Annotated[Optional[StrictStr], Field(description="Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination).")] = None, + order_by: Optional[StrictStr] = None, + order: Optional[StrictStr] = 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[ListAnalysesOutputBody]: + """List analyses + + Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param search_term: + :type search_term: str + :param analysis_scope: Leave empty to search your own, your team's and all public analyses + :type analysis_scope: List[str] + :param status: + :type status: List[str] + :param model_name: + :type model_name: List[Optional[str]] + :param usernames: + :type usernames: List[Optional[str]] + :param sha256_hash: + :type sha256_hash: str + :param binary_id: Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort + :type binary_id: int + :param platform: Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter + :type platform: List[str] + :param architecture: Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter + :type architecture: List[str] + :param page_size: + :type page_size: int + :param next_page_token: Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). + :type next_page_token: str + :param order_by: + :type order_by: str + :param order: + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_analyses_serialize( + search_term=search_term, + analysis_scope=analysis_scope, + status=status, + model_name=model_name, + usernames=usernames, + sha256_hash=sha256_hash, + binary_id=binary_id, + platform=platform, + architecture=architecture, + page_size=page_size, + next_page_token=next_page_token, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysesOutputBody", + '400': "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_analyses_without_preload_content( + self, + search_term: Optional[StrictStr] = None, + analysis_scope: Annotated[Optional[List[StrictStr]], Field(description="Leave empty to search your own, your team's and all public analyses")] = None, + status: Optional[List[StrictStr]] = None, + model_name: Optional[List[Optional[StrictStr]]] = None, + usernames: Optional[List[Optional[StrictStr]]] = None, + sha256_hash: Optional[StrictStr] = None, + binary_id: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort")] = None, + platform: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter")] = None, + architecture: Annotated[Optional[List[StrictStr]], Field(description="Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter")] = None, + page_size: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, + next_page_token: Annotated[Optional[StrictStr], Field(description="Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination).")] = None, + order_by: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List analyses + + Returns a page of analyses visible to the caller, filtered and ordered by the query parameters. **Error codes:** - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request + + :param search_term: + :type search_term: str + :param analysis_scope: Leave empty to search your own, your team's and all public analyses + :type analysis_scope: List[str] + :param status: + :type status: List[str] + :param model_name: + :type model_name: List[Optional[str]] + :param usernames: + :type usernames: List[Optional[str]] + :param sha256_hash: + :type sha256_hash: str + :param binary_id: Restrict to analyses of this binary. A binary can carry more than one analysis; they are returned newest first under the default sort + :type binary_id: int + :param platform: Restrict to binaries running on one of these operating-system platforms. Matches the uploader's override when they set one, the detected platform otherwise; a binary with neither is never matched. Leave empty for no filter + :type platform: List[str] + :param architecture: Restrict to binaries built for one of these instruction-set architectures. Resolved the same way as platform. Leave empty for no filter + :type architecture: List[str] + :param page_size: + :type page_size: int + :param next_page_token: Forward-pagination cursor from a prior response. When set, order_by/order are taken from the token (the sort cannot change mid-pagination). + :type next_page_token: str + :param order_by: + :type order_by: str + :param order: + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_analyses_serialize( + search_term=search_term, + analysis_scope=analysis_scope, + status=status, + model_name=model_name, + usernames=usernames, + sha256_hash=sha256_hash, + binary_id=binary_id, + platform=platform, + architecture=architecture, + page_size=page_size, + next_page_token=next_page_token, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAnalysesOutputBody", + '400': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_list_analyses_serialize( + self, + search_term, + analysis_scope, + status, + model_name, + usernames, + sha256_hash, + binary_id, + platform, + architecture, + page_size, + next_page_token, + order_by, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'analysis_scope': 'multi', + 'status': 'multi', + 'model_name': 'csv', + 'usernames': 'csv', + 'platform': 'csv', + 'architecture': '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 search_term is not None: + + _query_params.append(('search_term', search_term)) + + if analysis_scope is not None: + + _query_params.append(('analysis_scope', analysis_scope)) + + if status is not None: + + _query_params.append(('status', status)) + + if model_name is not None: + + _query_params.append(('model_name', model_name)) + + if usernames is not None: + + _query_params.append(('usernames', usernames)) + + if sha256_hash is not None: + + _query_params.append(('sha256_hash', sha256_hash)) + + if binary_id is not None: + + _query_params.append(('binary_id', binary_id)) + + if platform is not None: + + _query_params.append(('platform', platform)) + + if architecture is not None: + + _query_params.append(('architecture', architecture)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if next_page_token is not None: + + _query_params.append(('next_page_token', next_page_token)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # 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='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/v3/analyses', + 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_example_analyses( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListExampleAnalysesOutputBody: + """List example analyses + + Returns the curated example Analyses. + + :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_example_analyses_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListExampleAnalysesOutputBody", + } + 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_example_analyses_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListExampleAnalysesOutputBody]: + """List example analyses + + Returns the curated example Analyses. + + :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_example_analyses_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListExampleAnalysesOutputBody", + } + 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_example_analyses_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List example analyses + + Returns the curated example Analyses. + + :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_example_analyses_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListExampleAnalysesOutputBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_list_example_analyses_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/analyses/examples', + 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_lookup_analysis_by_binary_id( + 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, + ) -> LookupAnalysisByBinaryIDOutputBody: + """Look up the most recent analysis for a binary. + + Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :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_lookup_analysis_by_binary_id_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LookupAnalysisByBinaryIDOutputBody", + '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_lookup_analysis_by_binary_id_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[LookupAnalysisByBinaryIDOutputBody]: + """Look up the most recent analysis for a binary. + + Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :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_lookup_analysis_by_binary_id_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LookupAnalysisByBinaryIDOutputBody", + '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_lookup_analysis_by_binary_id_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: + """Look up the most recent analysis for a binary. + + Returns the ID of the most recent analysis of this binary that the caller may see (their own, their team's, or public). Returns 404 if the binary has none, whether because it has never been analysed or because every analysis of it is private to someone else. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :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_lookup_analysis_by_binary_id_serialize( + binary_id=binary_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LookupAnalysisByBinaryIDOutputBody", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_lookup_analysis_by_binary_id_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/analyses/lookup/{binary_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_queue_binary_export( + 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, + ) -> OperationBinaryExportMetadataBinaryExportResult: + """Queue a binary export + + Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **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_queue_binary_export_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]] = { + '202': "OperationBinaryExportMetadataBinaryExportResult", + '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_queue_binary_export_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[OperationBinaryExportMetadataBinaryExportResult]: + """Queue a binary export + + Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **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_queue_binary_export_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]] = { + '202': "OperationBinaryExportMetadataBinaryExportResult", + '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_queue_binary_export_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: + """Queue a binary export + + Starts an asynchronous export of the binary with its current symbols rewritten in, and returns the operation to poll for its outcome. Only the owner may call it, and it requires a subscription tier that supports symbol export. Download the result once the operation reports done. **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_queue_binary_export_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]] = { + '202': "OperationBinaryExportMetadataBinaryExportResult", + '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_queue_binary_export_serialize( + self, + analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v3/analyses/{analysis_id}/binary-export', + 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, + 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, + ) -> 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 + + :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, + ) + + + @validate_call + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update 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 + ) + 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, diff --git a/revengai/api/analyses_results_metadata_api.py b/revengai/api/analyses_results_metadata_api.py index 52aede7..438baa1 100644 --- a/revengai/api/analyses_results_metadata_api.py +++ b/revengai/api/analyses_results_metadata_api.py @@ -18,6 +18,7 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated +from revengai.models.analysis_capabilities_output_body import AnalysisCapabilitiesOutputBody 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 @@ -1235,3 +1236,277 @@ def _get_tags_serialize( ) + + + @validate_call + def v3_list_analysis_capabilities( + 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, + ) -> AnalysisCapabilitiesOutputBody: + """List the capabilities found in an analysis. + + Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities:run`. **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_capabilities_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': "AnalysisCapabilitiesOutputBody", + '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_capabilities_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[AnalysisCapabilitiesOutputBody]: + """List the capabilities found in an analysis. + + Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities:run`. **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_capabilities_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': "AnalysisCapabilitiesOutputBody", + '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_capabilities_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 capabilities found in an analysis. + + Returns the capabilities the binary-analysis pipeline attributed to the analysis' functions, ordered by function address. This is the static capability set recorded against the binary, not the AI capabilities agent's findings, which are triggered by `/v3/analyses/{analysis_id}/capabilities:run`. **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_capabilities_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': "AnalysisCapabilitiesOutputBody", + '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_capabilities_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}/capabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/revengai/api_client.py b/revengai/api_client.py index 83c0b52..30708c4 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.51.0/python' + self.user_agent = 'OpenAPI-Generator/v4.54.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 7e8abcb..cb538ff 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.51.0\n"\ - "SDK Package Version: v4.51.0".\ + "Version of the API: v4.54.0\n"\ + "SDK Package Version: v4.54.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index bc7b1ee..9bf8a16 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -22,17 +22,21 @@ from revengai.models.add_user_string_to_function_input_body import AddUserStringToFunctionInputBody from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse from revengai.models.ai_decompilation_rating import AiDecompilationRating +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 from revengai.models.analysis_bulk_add_tags_request import AnalysisBulkAddTagsRequest from revengai.models.analysis_bulk_add_tags_response import AnalysisBulkAddTagsResponse from revengai.models.analysis_bulk_add_tags_response_item import AnalysisBulkAddTagsResponseItem +from revengai.models.analysis_capabilities_output_body import AnalysisCapabilitiesOutputBody +from revengai.models.analysis_capability_body import AnalysisCapabilityBody from revengai.models.analysis_config import AnalysisConfig from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse from revengai.models.analysis_data_types_group import AnalysisDataTypesGroup from revengai.models.analysis_data_types_output_body import AnalysisDataTypesOutputBody +from revengai.models.analysis_detail_output_body import AnalysisDetailOutputBody from revengai.models.analysis_detail_response import AnalysisDetailResponse from revengai.models.analysis_function_entry import AnalysisFunctionEntry from revengai.models.analysis_function_mapping import AnalysisFunctionMapping @@ -71,6 +75,7 @@ from revengai.models.attempt_failed_event import AttemptFailedEvent from revengai.models.attempt_started_event import AttemptStartedEvent from revengai.models.auto_run_agents import AutoRunAgents +from revengai.models.auto_run_agents_body import AutoRunAgentsBody from revengai.models.auto_unstrip_status_output_body import AutoUnstripStatusOutputBody from revengai.models.base_data_type import BaseDataType from revengai.models.base_response import BaseResponse @@ -149,6 +154,8 @@ from revengai.models.binary_additional_response import BinaryAdditionalResponse from revengai.models.binary_config import BinaryConfig 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_response import BinaryExternalsResponse from revengai.models.binary_search_response import BinarySearchResponse from revengai.models.binary_search_result import BinarySearchResult @@ -156,6 +163,7 @@ from revengai.models.bitfield_data_type import BitfieldDataType from revengai.models.bulk_create_user_result import BulkCreateUserResult from revengai.models.bulk_create_users_output_body import BulkCreateUsersOutputBody +from revengai.models.bulk_delete_analyses_input_body import BulkDeleteAnalysesInputBody from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest from revengai.models.bytes_constant import BytesConstant from revengai.models.call_chain import CallChain @@ -395,6 +403,7 @@ from revengai.models.ioc import IOC from revengai.models.isa import ISA from revengai.models.icon_model import IconModel +from revengai.models.import_dynamic_execution_file_output_body import ImportDynamicExecutionFileOutputBody from revengai.models.import_model import ImportModel from revengai.models.imported_api import ImportedApi from revengai.models.imported_api_call import ImportedApiCall @@ -427,6 +436,7 @@ from revengai.models.list_users_output_body import ListUsersOutputBody from revengai.models.location_output_body import LocationOutputBody from revengai.models.logs import Logs +from revengai.models.lookup_analysis_by_binary_id_output_body import LookupAnalysisByBinaryIDOutputBody from revengai.models.mitre_technique import MITRETechnique from revengai.models.match_filters import MatchFilters from revengai.models.matched_function import MatchedFunction @@ -454,6 +464,7 @@ from revengai.models.networking_scan_metadata import NetworkingScanMetadata from revengai.models.networking_scan_result import NetworkingScanResult 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 from revengai.models.operation_crypto_explain_metadata_crypto_explain_result import OperationCryptoExplainMetadataCryptoExplainResult from revengai.models.operation_crypto_scan_metadata_crypto_scan_result import OperationCryptoScanMetadataCryptoScanResult @@ -529,6 +540,7 @@ from revengai.models.report_options import ReportOptions from revengai.models.report_reachability_status import ReportReachabilityStatus from revengai.models.report_result import ReportResult +from revengai.models.requested_config_body import RequestedConfigBody from revengai.models.resolved_entity import ResolvedEntity from revengai.models.result_body import ResultBody from revengai.models.revoke_body import RevokeBody @@ -593,6 +605,8 @@ from revengai.models.stream_ai_decompilation200_response_inner import StreamAiDecompilation200ResponseInner from revengai.models.stream_events200_response_inner import StreamEvents200ResponseInner from revengai.models.string_functions import StringFunctions +from revengai.models.string_match import StringMatch +from revengai.models.string_match_evidence import StringMatchEvidence from revengai.models.string_source import StringSource from revengai.models.struct_data_type import StructDataType from revengai.models.struct_definition import StructDefinition @@ -607,8 +621,6 @@ from revengai.models.suggested_member_view import SuggestedMemberView from revengai.models.suggested_type_view import SuggestedTypeView from revengai.models.summary_data import SummaryData -from revengai.models.suspicious_string import SuspiciousString -from revengai.models.suspicious_string_evidence import SuspiciousStringEvidence from revengai.models.symbols import Symbols from revengai.models.tag import Tag from revengai.models.tag_item import TagItem @@ -651,6 +663,7 @@ from revengai.models.union_definition import UnionDefinition from revengai.models.unknown_data_type import UnknownDataType from revengai.models.update_analysis_data_types_input_body import UpdateAnalysisDataTypesInputBody +from revengai.models.update_analysis_input_body import UpdateAnalysisInputBody from revengai.models.update_array_data_type import UpdateArrayDataType from revengai.models.update_base_data_type import UpdateBaseDataType from revengai.models.update_bitfield_data_type import UpdateBitfieldDataType diff --git a/revengai/models/analysis_access_body.py b/revengai/models/analysis_access_body.py new file mode 100644 index 0000000..5b9afb4 --- /dev/null +++ b/revengai/models/analysis_access_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, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisAccessBody(BaseModel): + """ + AnalysisAccessBody + """ # noqa: E501 + owner: StrictBool = Field(description="True when the caller owns this analysis") + username: StrictStr = Field(description="Username of the analysis owner") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["owner", "username"] + + 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 AnalysisAccessBody 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 AnalysisAccessBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "owner": obj.get("owner"), + "username": obj.get("username") + }) + # 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_capabilities_output_body.py b/revengai/models/analysis_capabilities_output_body.py new file mode 100644 index 0000000..9c3a171 --- /dev/null +++ b/revengai/models/analysis_capabilities_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.analysis_capability_body import AnalysisCapabilityBody +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisCapabilitiesOutputBody(BaseModel): + """ + AnalysisCapabilitiesOutputBody + """ # noqa: E501 + capabilities: Optional[List[AnalysisCapabilityBody]] = Field(description="Capabilities found across the binary, ordered by function address. Empty when the binary has no capability record") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["capabilities"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnalysisCapabilitiesOutputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in capabilities (list) + _items = [] + if self.capabilities: + for _item_capabilities in self.capabilities: + if _item_capabilities: + _items.append(_item_capabilities.to_dict()) + _dict['capabilities'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if capabilities (nullable) is None + # and model_fields_set contains the field + if self.capabilities is None and "capabilities" in self.model_fields_set: + _dict['capabilities'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisCapabilitiesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capabilities": [AnalysisCapabilityBody.from_dict(_item) for _item in obj["capabilities"]] if obj.get("capabilities") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_capability_body.py b/revengai/models/analysis_capability_body.py new file mode 100644 index 0000000..b16d4e0 --- /dev/null +++ b/revengai/models/analysis_capability_body.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisCapabilityBody(BaseModel): + """ + AnalysisCapabilityBody + """ # noqa: E501 + capabilities: Optional[List[StrictStr]] = Field(description="Capabilities attributed to the function") + function_name: StrictStr = Field(description="Name of the function the capability was found in") + function_vaddr: StrictInt = Field(description="Virtual address of that function") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["capabilities", "function_name", "function_vaddr"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnalysisCapabilityBody 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 capabilities (nullable) is None + # and model_fields_set contains the field + if self.capabilities is None and "capabilities" in self.model_fields_set: + _dict['capabilities'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisCapabilityBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capabilities": obj.get("capabilities"), + "function_name": obj.get("function_name"), + "function_vaddr": obj.get("function_vaddr") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/analysis_detail_output_body.py b/revengai/models/analysis_detail_output_body.py new file mode 100644 index 0000000..5f5b043 --- /dev/null +++ b/revengai/models/analysis_detail_output_body.py @@ -0,0 +1,148 @@ +# 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 revengai.models.analysis_access_body import AnalysisAccessBody +from revengai.models.auto_run_agents_body import AutoRunAgentsBody +from revengai.models.requested_config_body import RequestedConfigBody +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisDetailOutputBody(BaseModel): + """ + AnalysisDetailOutputBody + """ # noqa: E501 + access: AnalysisAccessBody + analysis_id: StrictInt + analysis_scope: StrictStr + architecture: StrictStr + auto_run_agents: AutoRunAgentsBody + binary_dynamic: StrictBool + binary_format: StrictStr + binary_name: StrictStr + binary_size: StrictInt + binary_type: StrictStr + creation: StrictStr + dashboard_url: StrictStr = Field(description="URL to view this analysis in the dashboard") + debug: StrictBool + model_name: StrictStr + requested_config: RequestedConfigBody = Field(description="Snapshot of the configuration the analysis was submitted with") + sha_256_hash: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["access", "analysis_id", "analysis_scope", "architecture", "auto_run_agents", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "requested_config", "sha_256_hash"] + + @field_validator('analysis_scope') + def analysis_scope_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PUBLIC', 'PRIVATE', 'TEAM', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('PUBLIC', 'PRIVATE', '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 AnalysisDetailOutputBody 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 access + if self.access: + _dict['access'] = self.access.to_dict() + # override the default output from pydantic by calling `to_dict()` of auto_run_agents + if self.auto_run_agents: + _dict['auto_run_agents'] = self.auto_run_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of requested_config + if self.requested_config: + _dict['requested_config'] = self.requested_config.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 AnalysisDetailOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "access": AnalysisAccessBody.from_dict(obj["access"]) if obj.get("access") is not None else None, + "analysis_id": obj.get("analysis_id"), + "analysis_scope": obj.get("analysis_scope"), + "architecture": obj.get("architecture"), + "auto_run_agents": AutoRunAgentsBody.from_dict(obj["auto_run_agents"]) if obj.get("auto_run_agents") is not None else None, + "binary_dynamic": obj.get("binary_dynamic"), + "binary_format": obj.get("binary_format"), + "binary_name": obj.get("binary_name"), + "binary_size": obj.get("binary_size"), + "binary_type": obj.get("binary_type"), + "creation": obj.get("creation"), + "dashboard_url": obj.get("dashboard_url"), + "debug": obj.get("debug"), + "model_name": obj.get("model_name"), + "requested_config": RequestedConfigBody.from_dict(obj["requested_config"]) if obj.get("requested_config") is not None else None, + "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/auto_run_agents_body.py b/revengai/models/auto_run_agents_body.py new file mode 100644 index 0000000..65d8e06 --- /dev/null +++ b/revengai/models/auto_run_agents_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, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AutoRunAgentsBody(BaseModel): + """ + AutoRunAgentsBody + """ # noqa: E501 + triage: StrictBool = Field(description="Whether the triage agent ran automatically once the functions pipeline finished") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["triage"] + + 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 AutoRunAgentsBody 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 AutoRunAgentsBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "triage": obj.get("triage") + }) + # 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.py b/revengai/models/binary.py index 516692c..7f4ff2e 100644 --- a/revengai/models/binary.py +++ b/revengai/models/binary.py @@ -17,7 +17,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +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 @@ -30,11 +30,16 @@ class Binary(BaseModel): binary_id: StrictInt binary_name: StrictStr created_at: datetime + detected_architecture: StrictStr = Field(description="Detected instruction-set architecture; empty when unavailable") + detected_binary_type: StrictStr = Field(description="Detected operating-system platform; empty when unavailable") is_system_analysis: StrictBool + model_name: StrictStr = Field(description="Name of the model the analysis ran on") owner_id: StrictInt sha_256_hash: StrictStr + supplied_architecture: StrictStr = Field(description="User-supplied instruction-set architecture; \"AUTO\" when not overridden") + supplied_binary_type: StrictStr = Field(description="User-supplied operating-system platform; \"AUTO\" when not overridden") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["analysis_id", "binary_id", "binary_name", "created_at", "is_system_analysis", "owner_id", "sha_256_hash"] + __properties: ClassVar[List[str]] = ["analysis_id", "binary_id", "binary_name", "created_at", "detected_architecture", "detected_binary_type", "is_system_analysis", "model_name", "owner_id", "sha_256_hash", "supplied_architecture", "supplied_binary_type"] model_config = ConfigDict( populate_by_name=True, @@ -98,9 +103,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "binary_id": obj.get("binary_id"), "binary_name": obj.get("binary_name"), "created_at": obj.get("created_at"), + "detected_architecture": obj.get("detected_architecture"), + "detected_binary_type": obj.get("detected_binary_type"), "is_system_analysis": obj.get("is_system_analysis"), + "model_name": obj.get("model_name"), "owner_id": obj.get("owner_id"), - "sha_256_hash": obj.get("sha_256_hash") + "sha_256_hash": obj.get("sha_256_hash"), + "supplied_architecture": obj.get("supplied_architecture"), + "supplied_binary_type": obj.get("supplied_binary_type") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/binary_export_metadata.py b/revengai/models/binary_export_metadata.py new file mode 100644 index 0000000..c963b28 --- /dev/null +++ b/revengai/models/binary_export_metadata.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 BinaryExportMetadata(BaseModel): + """ + BinaryExportMetadata + """ # noqa: E501 + analysis_id: StrictInt = Field(description="Analysis ID") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["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 BinaryExportMetadata 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 BinaryExportMetadata 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") + }) + # 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_export_result.py b/revengai/models/binary_export_result.py new file mode 100644 index 0000000..f120e43 --- /dev/null +++ b/revengai/models/binary_export_result.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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class BinaryExportResult(BaseModel): + """ + BinaryExportResult + """ # noqa: E501 + file_name: StrictStr = Field(description="Name to give the downloaded file") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["file_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BinaryExportResult 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 BinaryExportResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file_name": obj.get("file_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/bulk_delete_analyses_input_body.py b/revengai/models/bulk_delete_analyses_input_body.py new file mode 100644 index 0000000..9757eeb --- /dev/null +++ b/revengai/models/bulk_delete_analyses_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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class BulkDeleteAnalysesInputBody(BaseModel): + """ + BulkDeleteAnalysesInputBody + """ # noqa: E501 + analysis_ids: Optional[Annotated[List[StrictInt], Field(min_length=1, max_length=100)]] = Field(description="IDs of the analyses to delete. The caller must own every one, or none are deleted") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_ids"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BulkDeleteAnalysesInputBody 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 + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkDeleteAnalysesInputBody 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") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/disassembly_output_body.py b/revengai/models/disassembly_output_body.py index 618d59d..1d0e06f 100644 --- a/revengai/models/disassembly_output_body.py +++ b/revengai/models/disassembly_output_body.py @@ -101,11 +101,6 @@ def to_dict(self) -> Dict[str, Any]: if self.params is None and "params" in self.model_fields_set: _dict['params'] = None - # set to None if return_type (nullable) is None - # and model_fields_set contains the field - if self.return_type is None and "return_type" in self.model_fields_set: - _dict['return_type'] = None - return _dict @classmethod diff --git a/revengai/models/finding_evidence_inner.py b/revengai/models/finding_evidence_inner.py index 0dcbe1a..cc6ceb8 100644 --- a/revengai/models/finding_evidence_inner.py +++ b/revengai/models/finding_evidence_inner.py @@ -25,12 +25,12 @@ from revengai.models.known_constant_evidence import KnownConstantEvidence from revengai.models.model_interpretation_evidence import ModelInterpretationEvidence from revengai.models.referenced_constant_evidence import ReferencedConstantEvidence -from revengai.models.suspicious_string_evidence import SuspiciousStringEvidence +from revengai.models.string_match_evidence import StringMatchEvidence from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -FINDINGEVIDENCEINNER_ONE_OF_SCHEMAS = ["ApiCombinationEvidence", "CallChainEvidence", "DecompilerSummaryEvidence", "FunctionSimilarityEvidence", "HardcodedSecretEvidence", "ImportedApiCallEvidence", "KnownConstantEvidence", "ModelInterpretationEvidence", "ReferencedConstantEvidence", "SuspiciousStringEvidence"] +FINDINGEVIDENCEINNER_ONE_OF_SCHEMAS = ["ApiCombinationEvidence", "CallChainEvidence", "DecompilerSummaryEvidence", "FunctionSimilarityEvidence", "HardcodedSecretEvidence", "ImportedApiCallEvidence", "KnownConstantEvidence", "ModelInterpretationEvidence", "ReferencedConstantEvidence", "StringMatchEvidence"] class FindingEvidenceInner(BaseModel): """ @@ -42,8 +42,8 @@ class FindingEvidenceInner(BaseModel): oneof_schema_2_validator: Optional[ReferencedConstantEvidence] = None # data type: ImportedApiCallEvidence oneof_schema_3_validator: Optional[ImportedApiCallEvidence] = None - # data type: SuspiciousStringEvidence - oneof_schema_4_validator: Optional[SuspiciousStringEvidence] = None + # data type: StringMatchEvidence + oneof_schema_4_validator: Optional[StringMatchEvidence] = None # data type: FunctionSimilarityEvidence oneof_schema_5_validator: Optional[FunctionSimilarityEvidence] = None # data type: ApiCombinationEvidence @@ -56,8 +56,8 @@ class FindingEvidenceInner(BaseModel): oneof_schema_9_validator: Optional[KnownConstantEvidence] = None # data type: HardcodedSecretEvidence oneof_schema_10_validator: Optional[HardcodedSecretEvidence] = None - actual_instance: Optional[Union[ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence]] = None - one_of_schemas: Set[str] = { "ApiCombinationEvidence", "CallChainEvidence", "DecompilerSummaryEvidence", "FunctionSimilarityEvidence", "HardcodedSecretEvidence", "ImportedApiCallEvidence", "KnownConstantEvidence", "ModelInterpretationEvidence", "ReferencedConstantEvidence", "SuspiciousStringEvidence" } + actual_instance: Optional[Union[ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence]] = None + one_of_schemas: Set[str] = { "ApiCombinationEvidence", "CallChainEvidence", "DecompilerSummaryEvidence", "FunctionSimilarityEvidence", "HardcodedSecretEvidence", "ImportedApiCallEvidence", "KnownConstantEvidence", "ModelInterpretationEvidence", "ReferencedConstantEvidence", "StringMatchEvidence" } model_config = ConfigDict( validate_assignment=True, @@ -98,9 +98,9 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `ImportedApiCallEvidence`") else: match += 1 - # validate data type: SuspiciousStringEvidence - if not isinstance(v, SuspiciousStringEvidence): - error_messages.append(f"Error! Input type `{type(v)}` is not `SuspiciousStringEvidence`") + # validate data type: StringMatchEvidence + if not isinstance(v, StringMatchEvidence): + error_messages.append(f"Error! Input type `{type(v)}` is not `StringMatchEvidence`") else: match += 1 # validate data type: FunctionSimilarityEvidence @@ -135,10 +135,10 @@ def actual_instance_must_validate_oneof(cls, v): match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. Details: " + ", ".join(error_messages)) else: return v @@ -171,9 +171,9 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into SuspiciousStringEvidence + # deserialize data into StringMatchEvidence try: - instance.actual_instance = SuspiciousStringEvidence.from_json(json_str) + instance.actual_instance = StringMatchEvidence.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) @@ -216,10 +216,10 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into FindingEvidenceInner with oneOf schemas: ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence. Details: " + ", ".join(error_messages)) else: return instance @@ -233,7 +233,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, SuspiciousStringEvidence]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], ApiCombinationEvidence, CallChainEvidence, DecompilerSummaryEvidence, FunctionSimilarityEvidence, HardcodedSecretEvidence, ImportedApiCallEvidence, KnownConstantEvidence, ModelInterpretationEvidence, ReferencedConstantEvidence, StringMatchEvidence]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/revengai/models/import_dynamic_execution_file_output_body.py b/revengai/models/import_dynamic_execution_file_output_body.py new file mode 100644 index 0000000..916ad74 --- /dev/null +++ b/revengai/models/import_dynamic_execution_file_output_body.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ImportDynamicExecutionFileOutputBody(BaseModel): + """ + ImportDynamicExecutionFileOutputBody + """ # noqa: E501 + can_extract: StrictBool = Field(description="Whether the firmware/extraction flow can accept this file.") + can_sandbox: StrictBool = Field(description="Whether the file can be extracted and run in the Windows sandbox.") + is_archive: StrictBool = Field(description="Whether the detected format is a container/compression archive.") + mime: StrictStr = Field(description="The MIME type detected from the file's contents.") + sha_256_hash: StrictStr = Field(description="SHA-256 hash the file is stored under; the storage key for every subsequent reference to it.") + size: StrictInt = Field(description="Size of the file in bytes.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["can_extract", "can_sandbox", "is_archive", "mime", "sha_256_hash", "size"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImportDynamicExecutionFileOutputBody 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 ImportDynamicExecutionFileOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_extract": obj.get("can_extract"), + "can_sandbox": obj.get("can_sandbox"), + "is_archive": obj.get("is_archive"), + "mime": obj.get("mime"), + "sha_256_hash": obj.get("sha_256_hash"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/lookup_analysis_by_binary_id_output_body.py b/revengai/models/lookup_analysis_by_binary_id_output_body.py new file mode 100644 index 0000000..1eaad3b --- /dev/null +++ b/revengai/models/lookup_analysis_by_binary_id_output_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 LookupAnalysisByBinaryIDOutputBody(BaseModel): + """ + LookupAnalysisByBinaryIDOutputBody + """ # noqa: E501 + analysis_id: StrictInt = Field(description="Most recent analysis for this binary that the caller may see") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["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 LookupAnalysisByBinaryIDOutputBody 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 LookupAnalysisByBinaryIDOutputBody 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") + }) + # 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/operation_binary_export_metadata_binary_export_result.py b/revengai/models/operation_binary_export_metadata_binary_export_result.py new file mode 100644 index 0000000..1fbf86c --- /dev/null +++ b/revengai/models/operation_binary_export_metadata_binary_export_result.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.binary_export_metadata import BinaryExportMetadata +from revengai.models.binary_export_result import BinaryExportResult +from revengai.models.status import Status +from typing import Optional, Set +from typing_extensions import Self + +class OperationBinaryExportMetadataBinaryExportResult(BaseModel): + """ + OperationBinaryExportMetadataBinaryExportResult + """ # noqa: E501 + done: StrictBool = Field(description="Whether the operation has reached a terminal state.") + error: Optional[Status] = Field(default=None, description="Failure detail, populated only when done is true and the operation failed.") + metadata: Optional[BinaryExportMetadata] = Field(default=None, description="In-flight information and details.") + name: StrictStr = Field(description="API resource name.") + response: Optional[BinaryExportResult] = Field(default=None, description="Result, set only when done is true and the operation succeeded.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["done", "error", "metadata", "name", "response"] + + 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 OperationBinaryExportMetadataBinaryExportResult 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 error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of response + if self.response: + _dict['response'] = self.response.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 OperationBinaryExportMetadataBinaryExportResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "done": obj.get("done"), + "error": Status.from_dict(obj["error"]) if obj.get("error") is not None else None, + "metadata": BinaryExportMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "response": BinaryExportResult.from_dict(obj["response"]) if obj.get("response") 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/requested_config_body.py b/revengai/models/requested_config_body.py new file mode 100644 index 0000000..3f1eda7 --- /dev/null +++ b/revengai/models/requested_config_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, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RequestedConfigBody(BaseModel): + """ + RequestedConfigBody + """ # noqa: E501 + capabilities: StrictBool = Field(description="Whether the capabilities agent was requested") + functions: StrictBool = Field(description="Whether the functions pipeline was requested") + sandbox: StrictBool = Field(description="Whether dynamic execution (sandbox) was requested") + scrape: StrictBool = Field(description="Whether external-source scraping was requested") + triage: StrictBool = Field(description="Whether the triage agent was requested") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["capabilities", "functions", "sandbox", "scrape", "triage"] + + 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 RequestedConfigBody 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 RequestedConfigBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capabilities": obj.get("capabilities"), + "functions": obj.get("functions"), + "sandbox": obj.get("sandbox"), + "scrape": obj.get("scrape"), + "triage": obj.get("triage") + }) + # 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/suspicious_string.py b/revengai/models/string_match.py similarity index 95% rename from revengai/models/suspicious_string.py rename to revengai/models/string_match.py index a9bf14d..4a8d98f 100644 --- a/revengai/models/suspicious_string.py +++ b/revengai/models/string_match.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SuspiciousString(BaseModel): +class StringMatch(BaseModel): """ - SuspiciousString + StringMatch """ # noqa: E501 value: Annotated[str, Field(min_length=1, strict=True)] subject: Optional[Subject] = None @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SuspiciousString from a JSON string""" + """Create an instance of StringMatch from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -90,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SuspiciousString from a dict""" + """Create an instance of StringMatch from a dict""" if obj is None: return None diff --git a/revengai/models/suspicious_string_evidence.py b/revengai/models/string_match_evidence.py similarity index 85% rename from revengai/models/suspicious_string_evidence.py rename to revengai/models/string_match_evidence.py index 5fe771d..58a8d78 100644 --- a/revengai/models/suspicious_string_evidence.py +++ b/revengai/models/string_match_evidence.py @@ -20,19 +20,19 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from revengai.models.evidence_effect import EvidenceEffect -from revengai.models.suspicious_string import SuspiciousString +from revengai.models.string_match import StringMatch from typing import Optional, Set from typing_extensions import Self -class SuspiciousStringEvidence(BaseModel): +class StringMatchEvidence(BaseModel): """ - Suspicious strings without demonstrated semantic use. + String matches without demonstrated semantic use. """ # noqa: E501 - evidence_kind: Optional[StrictStr] = 'suspicious_string' + evidence_kind: Optional[StrictStr] = 'string_match' kind: Optional[StrictStr] = 'deterministic_derivation' effect: EvidenceEffect strength: Optional[StrictStr] = 'indirect' - strings: Annotated[List[SuspiciousString], Field(min_length=1)] + strings: Annotated[List[StringMatch], Field(min_length=1)] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["evidence_kind", "kind", "effect", "strength", "strings"] @@ -42,8 +42,8 @@ def evidence_kind_validate_enum(cls, value): if value is None: return value - if value not in set(['suspicious_string', 'unknown_default_open_api']): - raise ValueError("must be one of enum values ('suspicious_string', 'unknown_default_open_api')") + if value not in set(['string_match', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('string_match', 'unknown_default_open_api')") return value @field_validator('kind') @@ -84,7 +84,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SuspiciousStringEvidence from a JSON string""" + """Create an instance of StringMatchEvidence from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -123,7 +123,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SuspiciousStringEvidence from a dict""" + """Create an instance of StringMatchEvidence from a dict""" if obj is None: return None @@ -131,11 +131,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "evidence_kind": obj.get("evidence_kind") if obj.get("evidence_kind") is not None else 'suspicious_string', + "evidence_kind": obj.get("evidence_kind") if obj.get("evidence_kind") is not None else 'string_match', "kind": obj.get("kind") if obj.get("kind") is not None else 'deterministic_derivation', "effect": obj.get("effect"), "strength": obj.get("strength") if obj.get("strength") is not None else 'indirect', - "strings": [SuspiciousString.from_dict(_item) for _item in obj["strings"]] if obj.get("strings") is not None else None + "strings": [StringMatch.from_dict(_item) for _item in obj["strings"]] if obj.get("strings") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/update_analysis_input_body.py b/revengai/models/update_analysis_input_body.py new file mode 100644 index 0000000..8087353 --- /dev/null +++ b/revengai/models/update_analysis_input_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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpdateAnalysisInputBody(BaseModel): + """ + UpdateAnalysisInputBody + """ # noqa: E501 + analysis_scope: Optional[StrictStr] = Field(default=None, description="The analysis' visibility. Changing to a non-PUBLIC scope requires a subscription tier that supports private analyses") + binary_name: Optional[StrictStr] = Field(default=None, description="Renames the analysis' binary. Empty or whitespace-only is rejected") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["analysis_scope", "binary_name"] + + @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(['PUBLIC', 'PRIVATE', 'TEAM', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('PUBLIC', 'PRIVATE', '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 UpdateAnalysisInputBody 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 UpdateAnalysisInputBody 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"), + "binary_name": obj.get("binary_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + +