From 404af7c62b232b08ef92c53fff1a0d4025f2267e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Apr 2026 06:36:00 +0000 Subject: [PATCH] Update SDK to version v3.58.0 - Generated from OpenAPI spec version v3.58.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 2 + docs/AnalysesCoreApi.md | 96 +++++ docs/BulkDeleteAnalysesRequest.md | 29 ++ revengai/__init__.py | 4 +- revengai/api/analyses_core_api.py | 386 ++++++++++++++++++ revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 1 + .../models/bulk_delete_analyses_request.py | 86 ++++ test/test_analyses_core_api.py | 7 + test/test_analysis_detail_response.py | 4 +- ..._base_response_analysis_detail_response.py | 4 +- ...ase_response_binary_additional_response.py | 16 +- ...base_response_binary_externals_response.py | 8 +- test/test_base_response_dict.py | 4 +- test/test_base_response_external_response.py | 4 +- ...binary_additional_details_data_response.py | 16 +- test/test_binary_additional_response.py | 32 +- test/test_binary_externals_response.py | 16 +- test/test_bulk_delete_analyses_request.py | 55 +++ test/test_elf_model.py | 28 +- test/test_external_response.py | 8 +- test/test_pe_model.py | 8 +- 24 files changed, 707 insertions(+), 115 deletions(-) create mode 100644 docs/BulkDeleteAnalysesRequest.md create mode 100644 revengai/models/bulk_delete_analyses_request.py create mode 100644 test/test_bulk_delete_analyses_request.py diff --git a/.sdk-version b/.sdk-version index 1a5a13a..6d07408 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.57.2 +v3.58.0 diff --git a/README.md b/README.md index ed73394..fc3a1c1 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description *AnalysesCommentsApi* | [**get_analysis_comments**](docs/AnalysesCommentsApi.md#get_analysis_comments) | **GET** /v2/analyses/{analysis_id}/comments | Get comments for this analysis *AnalysesCommentsApi* | [**update_analysis_comment**](docs/AnalysesCommentsApi.md#update_analysis_comment) | **PATCH** /v2/analyses/{analysis_id}/comments/{comment_id} | Update a comment *AnalysesCoreApi* | [**bulk_add_analysis_tags**](docs/AnalysesCoreApi.md#bulk_add_analysis_tags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags +*AnalysesCoreApi* | [**bulk_delete_analyses**](docs/AnalysesCoreApi.md#bulk_delete_analyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses *AnalysesCoreApi* | [**create_analysis**](docs/AnalysesCoreApi.md#create_analysis) | **POST** /v2/analyses | Create Analysis *AnalysesCoreApi* | [**delete_analysis**](docs/AnalysesCoreApi.md#delete_analysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis *AnalysesCoreApi* | [**get_analysis_basic_info**](docs/AnalysesCoreApi.md#get_analysis_basic_info) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information @@ -285,6 +286,7 @@ Class | Method | HTTP request | Description - [BinaryTaskStatus](docs/BinaryTaskStatus.md) - [Block](docs/Block.md) - [BlockCommentsGenerationForFunctionResponse](docs/BlockCommentsGenerationForFunctionResponse.md) + - [BulkDeleteAnalysesRequest](docs/BulkDeleteAnalysesRequest.md) - [CalleeFunctionInfo](docs/CalleeFunctionInfo.md) - [CalleesCallerFunctionsResponse](docs/CalleesCallerFunctionsResponse.md) - [CallerFunctionInfo](docs/CallerFunctionInfo.md) diff --git a/docs/AnalysesCoreApi.md b/docs/AnalysesCoreApi.md index 0e9d4b3..55c9754 100644 --- a/docs/AnalysesCoreApi.md +++ b/docs/AnalysesCoreApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- [**bulk_add_analysis_tags**](AnalysesCoreApi.md#bulk_add_analysis_tags) | **PATCH** /v2/analyses/tags/add | Bulk Add Analysis Tags +[**bulk_delete_analyses**](AnalysesCoreApi.md#bulk_delete_analyses) | **PATCH** /v2/analyses/delete | Bulk Delete Analyses [**create_analysis**](AnalysesCoreApi.md#create_analysis) | **POST** /v2/analyses | Create Analysis [**delete_analysis**](AnalysesCoreApi.md#delete_analysis) | **DELETE** /v2/analyses/{analysis_id} | Delete Analysis [**get_analysis_basic_info**](AnalysesCoreApi.md#get_analysis_basic_info) | **GET** /v2/analyses/{analysis_id}/basic | Gets basic analysis information @@ -115,6 +116,101 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **bulk_delete_analyses** +> BaseResponseDict bulk_delete_analyses(bulk_delete_analyses_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) + +Bulk Delete Analyses + +Deletes multiple analyses. User must be the owner of all analyses. + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_dict import BaseResponseDict +from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.AnalysesCoreApi(api_client) + bulk_delete_analyses_request = revengai.BulkDeleteAnalysesRequest() # BulkDeleteAnalysesRequest | + endpoint_url = 'endpoint_url_example' # str | (optional) + local_cache_dir = 'local_cache_dir_example' # str | (optional) + local_cache_max_size_mb = 56 # int | (optional) + customer_samples_bucket = 'customer_samples_bucket_example' # str | (optional) + firmware_samples_bucket = 'firmware_samples_bucket_example' # str | (optional) + max_retry_attempts = 5 # int | (optional) (default to 5) + + try: + # Bulk Delete Analyses + api_response = api_instance.bulk_delete_analyses(bulk_delete_analyses_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts) + print("The response of AnalysesCoreApi->bulk_delete_analyses:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesCoreApi->bulk_delete_analyses: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bulk_delete_analyses_request** | [**BulkDeleteAnalysesRequest**](BulkDeleteAnalysesRequest.md)| | + **endpoint_url** | **str**| | [optional] + **local_cache_dir** | **str**| | [optional] + **local_cache_max_size_mb** | **int**| | [optional] + **customer_samples_bucket** | **str**| | [optional] + **firmware_samples_bucket** | **str**| | [optional] + **max_retry_attempts** | **int**| | [optional] [default to 5] + +### Return type + +[**BaseResponseDict**](BaseResponseDict.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | +**404** | Not Found | - | +**403** | Forbidden | - | + +[[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) + # **create_analysis** > BaseResponseAnalysisCreateResponse create_analysis(analysis_create_request, endpoint_url=endpoint_url, local_cache_dir=local_cache_dir, local_cache_max_size_mb=local_cache_max_size_mb, customer_samples_bucket=customer_samples_bucket, firmware_samples_bucket=firmware_samples_bucket, max_retry_attempts=max_retry_attempts, x_rev_eng_application=x_rev_eng_application) diff --git a/docs/BulkDeleteAnalysesRequest.md b/docs/BulkDeleteAnalysesRequest.md new file mode 100644 index 0000000..f6a5f74 --- /dev/null +++ b/docs/BulkDeleteAnalysesRequest.md @@ -0,0 +1,29 @@ +# BulkDeleteAnalysesRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysis_ids** | **List[int]** | | + +## Example + +```python +from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of BulkDeleteAnalysesRequest from a JSON string +bulk_delete_analyses_request_instance = BulkDeleteAnalysesRequest.from_json(json) +# print the JSON string representation of the object +print(BulkDeleteAnalysesRequest.to_json()) + +# convert the object into a dict +bulk_delete_analyses_request_dict = bulk_delete_analyses_request_instance.to_dict() +# create an instance of BulkDeleteAnalysesRequest from a dict +bulk_delete_analyses_request_from_dict = BulkDeleteAnalysesRequest.from_dict(bulk_delete_analyses_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index 93f86e9..65c5dec 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.57.2" +__version__ = "v3.58.0" # Define package exports __all__ = [ @@ -176,6 +176,7 @@ "BinaryTaskStatus", "Block", "BlockCommentsGenerationForFunctionResponse", + "BulkDeleteAnalysesRequest", "CalleeFunctionInfo", "CalleesCallerFunctionsResponse", "CallerFunctionInfo", @@ -528,6 +529,7 @@ from revengai.models.binary_task_status import BinaryTaskStatus as BinaryTaskStatus from revengai.models.block import Block as Block from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse as BlockCommentsGenerationForFunctionResponse +from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest as BulkDeleteAnalysesRequest from revengai.models.callee_function_info import CalleeFunctionInfo as CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse as CalleesCallerFunctionsResponse from revengai.models.caller_function_info import CallerFunctionInfo as CallerFunctionInfo diff --git a/revengai/api/analyses_core_api.py b/revengai/api/analyses_core_api.py index 9d3e06e..460a554 100644 --- a/revengai/api/analyses_core_api.py +++ b/revengai/api/analyses_core_api.py @@ -37,6 +37,7 @@ from revengai.models.base_response_recent import BaseResponseRecent from revengai.models.base_response_status import BaseResponseStatus from revengai.models.base_response_upload_response import BaseResponseUploadResponse +from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest from revengai.models.dynamic_execution_status_input import DynamicExecutionStatusInput from revengai.models.insert_analysis_log_request import InsertAnalysisLogRequest from revengai.models.model_name import ModelName @@ -444,6 +445,391 @@ def _bulk_add_analysis_tags_serialize( + @validate_call + def bulk_delete_analyses( + self, + bulk_delete_analyses_request: BulkDeleteAnalysesRequest, + endpoint_url: Optional[StrictStr] = None, + local_cache_dir: Optional[StrictStr] = None, + local_cache_max_size_mb: Optional[StrictInt] = None, + customer_samples_bucket: Optional[StrictStr] = None, + firmware_samples_bucket: Optional[StrictStr] = None, + max_retry_attempts: Optional[StrictInt] = 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, + ) -> BaseResponseDict: + """Bulk Delete Analyses + + Deletes multiple analyses. User must be the owner of all analyses. + + :param bulk_delete_analyses_request: (required) + :type bulk_delete_analyses_request: BulkDeleteAnalysesRequest + :param endpoint_url: + :type endpoint_url: str + :param local_cache_dir: + :type local_cache_dir: str + :param local_cache_max_size_mb: + :type local_cache_max_size_mb: int + :param customer_samples_bucket: + :type customer_samples_bucket: str + :param firmware_samples_bucket: + :type firmware_samples_bucket: str + :param max_retry_attempts: + :type max_retry_attempts: 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._bulk_delete_analyses_serialize( + bulk_delete_analyses_request=bulk_delete_analyses_request, + endpoint_url=endpoint_url, + local_cache_dir=local_cache_dir, + local_cache_max_size_mb=local_cache_max_size_mb, + customer_samples_bucket=customer_samples_bucket, + firmware_samples_bucket=firmware_samples_bucket, + max_retry_attempts=max_retry_attempts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseDict", + '422': "BaseResponse", + '404': "BaseResponse", + '403': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bulk_delete_analyses_with_http_info( + self, + bulk_delete_analyses_request: BulkDeleteAnalysesRequest, + endpoint_url: Optional[StrictStr] = None, + local_cache_dir: Optional[StrictStr] = None, + local_cache_max_size_mb: Optional[StrictInt] = None, + customer_samples_bucket: Optional[StrictStr] = None, + firmware_samples_bucket: Optional[StrictStr] = None, + max_retry_attempts: Optional[StrictInt] = 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[BaseResponseDict]: + """Bulk Delete Analyses + + Deletes multiple analyses. User must be the owner of all analyses. + + :param bulk_delete_analyses_request: (required) + :type bulk_delete_analyses_request: BulkDeleteAnalysesRequest + :param endpoint_url: + :type endpoint_url: str + :param local_cache_dir: + :type local_cache_dir: str + :param local_cache_max_size_mb: + :type local_cache_max_size_mb: int + :param customer_samples_bucket: + :type customer_samples_bucket: str + :param firmware_samples_bucket: + :type firmware_samples_bucket: str + :param max_retry_attempts: + :type max_retry_attempts: 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._bulk_delete_analyses_serialize( + bulk_delete_analyses_request=bulk_delete_analyses_request, + endpoint_url=endpoint_url, + local_cache_dir=local_cache_dir, + local_cache_max_size_mb=local_cache_max_size_mb, + customer_samples_bucket=customer_samples_bucket, + firmware_samples_bucket=firmware_samples_bucket, + max_retry_attempts=max_retry_attempts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseDict", + '422': "BaseResponse", + '404': "BaseResponse", + '403': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def bulk_delete_analyses_without_preload_content( + self, + bulk_delete_analyses_request: BulkDeleteAnalysesRequest, + endpoint_url: Optional[StrictStr] = None, + local_cache_dir: Optional[StrictStr] = None, + local_cache_max_size_mb: Optional[StrictInt] = None, + customer_samples_bucket: Optional[StrictStr] = None, + firmware_samples_bucket: Optional[StrictStr] = None, + max_retry_attempts: Optional[StrictInt] = 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: + """Bulk Delete Analyses + + Deletes multiple analyses. User must be the owner of all analyses. + + :param bulk_delete_analyses_request: (required) + :type bulk_delete_analyses_request: BulkDeleteAnalysesRequest + :param endpoint_url: + :type endpoint_url: str + :param local_cache_dir: + :type local_cache_dir: str + :param local_cache_max_size_mb: + :type local_cache_max_size_mb: int + :param customer_samples_bucket: + :type customer_samples_bucket: str + :param firmware_samples_bucket: + :type firmware_samples_bucket: str + :param max_retry_attempts: + :type max_retry_attempts: 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._bulk_delete_analyses_serialize( + bulk_delete_analyses_request=bulk_delete_analyses_request, + endpoint_url=endpoint_url, + local_cache_dir=local_cache_dir, + local_cache_max_size_mb=local_cache_max_size_mb, + customer_samples_bucket=customer_samples_bucket, + firmware_samples_bucket=firmware_samples_bucket, + max_retry_attempts=max_retry_attempts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseDict", + '422': "BaseResponse", + '404': "BaseResponse", + '403': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _bulk_delete_analyses_serialize( + self, + bulk_delete_analyses_request, + endpoint_url, + local_cache_dir, + local_cache_max_size_mb, + customer_samples_bucket, + firmware_samples_bucket, + max_retry_attempts, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if endpoint_url is not None: + + _query_params.append(('endpoint_url', endpoint_url)) + + if local_cache_dir is not None: + + _query_params.append(('local_cache_dir', local_cache_dir)) + + if local_cache_max_size_mb is not None: + + _query_params.append(('local_cache_max_size_mb', local_cache_max_size_mb)) + + if customer_samples_bucket is not None: + + _query_params.append(('customer_samples_bucket', customer_samples_bucket)) + + if firmware_samples_bucket is not None: + + _query_params.append(('firmware_samples_bucket', firmware_samples_bucket)) + + if max_retry_attempts is not None: + + _query_params.append(('max_retry_attempts', max_retry_attempts)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bulk_delete_analyses_request is not None: + _body_params = bulk_delete_analyses_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v2/analyses/delete', + 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 create_analysis( self, diff --git a/revengai/api_client.py b/revengai/api_client.py index a61ad04..594bdbd 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v3.57.2/python' + self.user_agent = 'OpenAPI-Generator/v3.58.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 68f1c75..59f51d2 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.57.2\n"\ - "SDK Package Version: v3.57.2".\ + "Version of the API: v3.58.0\n"\ + "SDK Package Version: v3.58.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 3565de0..49c33b8 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -141,6 +141,7 @@ from revengai.models.binary_task_status import BinaryTaskStatus from revengai.models.block import Block from revengai.models.block_comments_generation_for_function_response import BlockCommentsGenerationForFunctionResponse +from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest from revengai.models.callee_function_info import CalleeFunctionInfo from revengai.models.callees_caller_functions_response import CalleesCallerFunctionsResponse from revengai.models.caller_function_info import CallerFunctionInfo diff --git a/revengai/models/bulk_delete_analyses_request.py b/revengai/models/bulk_delete_analyses_request.py new file mode 100644 index 0000000..d3828cd --- /dev/null +++ b/revengai/models/bulk_delete_analyses_request.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class BulkDeleteAnalysesRequest(BaseModel): + """ + BulkDeleteAnalysesRequest + """ # noqa: E501 + analysis_ids: List[StrictInt] + __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 BulkDeleteAnalysesRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkDeleteAnalysesRequest 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") + }) + return _obj + + diff --git a/test/test_analyses_core_api.py b/test/test_analyses_core_api.py index acc8153..68e991b 100644 --- a/test/test_analyses_core_api.py +++ b/test/test_analyses_core_api.py @@ -32,6 +32,13 @@ def test_bulk_add_analysis_tags(self) -> None: """ pass + def test_bulk_delete_analyses(self) -> None: + """Test case for bulk_delete_analyses + + Bulk Delete Analyses + """ + pass + def test_create_analysis(self) -> None: """Test case for create_analysis diff --git a/test/test_analysis_detail_response.py b/test/test_analysis_detail_response.py index 5b57d1d..785df9d 100644 --- a/test/test_analysis_detail_response.py +++ b/test/test_analysis_detail_response.py @@ -49,9 +49,7 @@ def make_instance(self, include_optional) -> AnalysisDetailResponse: dashboard_url = '', debug = True, model_name = '', - sbom = { - 'key' : null - }, + sbom = { }, sha_256_hash = '', auto_run_agents = revengai.models.auto_run_agents.AutoRunAgents( triage = True, ) diff --git a/test/test_base_response_analysis_detail_response.py b/test/test_base_response_analysis_detail_response.py index 3d27c76..7f2ae60 100644 --- a/test/test_base_response_analysis_detail_response.py +++ b/test/test_base_response_analysis_detail_response.py @@ -51,9 +51,7 @@ def make_instance(self, include_optional) -> BaseResponseAnalysisDetailResponse: dashboard_url = '', debug = True, model_name = '', - sbom = { - 'key' : null - }, + sbom = { }, sha_256_hash = '', auto_run_agents = revengai.models.auto_run_agents.AutoRunAgents( triage = True, ), ), diff --git a/test/test_base_response_binary_additional_response.py b/test/test_base_response_binary_additional_response.py index b84af61..88b237c 100644 --- a/test/test_base_response_binary_additional_response.py +++ b/test/test_base_response_binary_additional_response.py @@ -72,9 +72,7 @@ def make_instance(self, include_optional) -> BaseResponseBinaryAdditionalRespons high_entropy = True, seh = True, bound_image = True, ), - version_info = { - 'key' : null - }, + version_info = { }, debug_info = revengai.models.pdb_debug_model.PDBDebugModel( debug_entries = [ revengai.models.single_pdb_entry_model.SinglePDBEntryModel( @@ -221,16 +219,10 @@ def make_instance(self, include_optional) -> BaseResponseBinaryAdditionalRespons value = 56, ) ], notes = [ - { - 'key' : null - } + { } ], - debug_info = { - 'key' : null - }, - version_info = { - 'key' : null - }, ), ), + debug_info = { }, + version_info = { }, ), ), creation = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), message = '', errors = [ diff --git a/test/test_base_response_binary_externals_response.py b/test/test_base_response_binary_externals_response.py index e148d0d..ce2df4b 100644 --- a/test/test_base_response_binary_externals_response.py +++ b/test/test_base_response_binary_externals_response.py @@ -37,13 +37,9 @@ def make_instance(self, include_optional) -> BaseResponseBinaryExternalsResponse status = True, data = revengai.models.binary_externals_response.BinaryExternalsResponse( sha_256_hash = '', - vt = { - 'key' : null - }, + vt = { }, vt_last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mb = { - 'key' : null - }, + mb = { }, mb_last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), message = '', errors = [ diff --git a/test/test_base_response_dict.py b/test/test_base_response_dict.py index 957e672..0cb7561 100644 --- a/test/test_base_response_dict.py +++ b/test/test_base_response_dict.py @@ -35,9 +35,7 @@ def make_instance(self, include_optional) -> BaseResponseDict: if include_optional: return BaseResponseDict( status = True, - data = { - 'key' : null - }, + data = { }, message = '', errors = [ revengai.models.error_model.ErrorModel( diff --git a/test/test_base_response_external_response.py b/test/test_base_response_external_response.py index d2c4684..1a01997 100644 --- a/test/test_base_response_external_response.py +++ b/test/test_base_response_external_response.py @@ -37,9 +37,7 @@ def make_instance(self, include_optional) -> BaseResponseExternalResponse: status = True, data = revengai.models.external_response.ExternalResponse( sha_256_hash = '', - data = { - 'key' : null - }, + data = { }, last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), message = '', errors = [ diff --git a/test/test_binary_additional_details_data_response.py b/test/test_binary_additional_details_data_response.py index 3af20dc..8f0c549 100644 --- a/test/test_binary_additional_details_data_response.py +++ b/test/test_binary_additional_details_data_response.py @@ -68,9 +68,7 @@ def make_instance(self, include_optional) -> BinaryAdditionalDetailsDataResponse high_entropy = True, seh = True, bound_image = True, ), - version_info = { - 'key' : null - }, + version_info = { }, debug_info = revengai.models.pdb_debug_model.PDBDebugModel( debug_entries = [ revengai.models.single_pdb_entry_model.SinglePDBEntryModel( @@ -217,16 +215,10 @@ def make_instance(self, include_optional) -> BinaryAdditionalDetailsDataResponse value = 56, ) ], notes = [ - { - 'key' : null - } + { } ], - debug_info = { - 'key' : null - }, - version_info = { - 'key' : null - }, ) + debug_info = { }, + version_info = { }, ) ) else: return BinaryAdditionalDetailsDataResponse( diff --git a/test/test_binary_additional_response.py b/test/test_binary_additional_response.py index af5a648..530a4ed 100644 --- a/test/test_binary_additional_response.py +++ b/test/test_binary_additional_response.py @@ -70,9 +70,7 @@ def make_instance(self, include_optional) -> BinaryAdditionalResponse: high_entropy = True, seh = True, bound_image = True, ), - version_info = { - 'key' : null - }, + version_info = { }, debug_info = revengai.models.pdb_debug_model.PDBDebugModel( debug_entries = [ revengai.models.single_pdb_entry_model.SinglePDBEntryModel( @@ -219,16 +217,10 @@ def make_instance(self, include_optional) -> BinaryAdditionalResponse: value = 56, ) ], notes = [ - { - 'key' : null - } + { } ], - debug_info = { - 'key' : null - }, - version_info = { - 'key' : null - }, ), ), + debug_info = { }, + version_info = { }, ), ), creation = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: @@ -269,9 +261,7 @@ def make_instance(self, include_optional) -> BinaryAdditionalResponse: high_entropy = True, seh = True, bound_image = True, ), - version_info = { - 'key' : null - }, + version_info = { }, debug_info = revengai.models.pdb_debug_model.PDBDebugModel( debug_entries = [ revengai.models.single_pdb_entry_model.SinglePDBEntryModel( @@ -418,16 +408,10 @@ def make_instance(self, include_optional) -> BinaryAdditionalResponse: value = 56, ) ], notes = [ - { - 'key' : null - } + { } ], - debug_info = { - 'key' : null - }, - version_info = { - 'key' : null - }, ), ), + debug_info = { }, + version_info = { }, ), ), ) """ diff --git a/test/test_binary_externals_response.py b/test/test_binary_externals_response.py index d5bd77a..79cdef0 100644 --- a/test/test_binary_externals_response.py +++ b/test/test_binary_externals_response.py @@ -35,25 +35,17 @@ def make_instance(self, include_optional) -> BinaryExternalsResponse: if include_optional: return BinaryExternalsResponse( sha_256_hash = '', - vt = { - 'key' : null - }, + vt = { }, vt_last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mb = { - 'key' : null - }, + mb = { }, mb_last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: return BinaryExternalsResponse( sha_256_hash = '', - vt = { - 'key' : null - }, + vt = { }, vt_last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mb = { - 'key' : null - }, + mb = { }, mb_last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) """ diff --git a/test/test_bulk_delete_analyses_request.py b/test/test_bulk_delete_analyses_request.py new file mode 100644 index 0000000..4327a34 --- /dev/null +++ b/test/test_bulk_delete_analyses_request.py @@ -0,0 +1,55 @@ +# 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 + + +import unittest + +from revengai.models.bulk_delete_analyses_request import BulkDeleteAnalysesRequest + +class TestBulkDeleteAnalysesRequest(unittest.TestCase): + """BulkDeleteAnalysesRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BulkDeleteAnalysesRequest: + """Test BulkDeleteAnalysesRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BulkDeleteAnalysesRequest` + """ + model = BulkDeleteAnalysesRequest() + if include_optional: + return BulkDeleteAnalysesRequest( + analysis_ids = [ + 56 + ] + ) + else: + return BulkDeleteAnalysesRequest( + analysis_ids = [ + 56 + ], + ) + """ + + def testBulkDeleteAnalysesRequest(self): + """Test BulkDeleteAnalysesRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_elf_model.py b/test/test_elf_model.py index 3ce97b3..383361f 100644 --- a/test/test_elf_model.py +++ b/test/test_elf_model.py @@ -117,16 +117,10 @@ def make_instance(self, include_optional) -> ELFModel: value = 56, ) ], notes = [ - { - 'key' : null - } - ], - debug_info = { - 'key' : null - }, - version_info = { - 'key' : null - } + { } + ], + debug_info = { }, + version_info = { } ) else: return ELFModel( @@ -213,16 +207,10 @@ def make_instance(self, include_optional) -> ELFModel: value = 56, ) ], notes = [ - { - 'key' : null - } - ], - debug_info = { - 'key' : null - }, - version_info = { - 'key' : null - }, + { } + ], + debug_info = { }, + version_info = { }, ) """ diff --git a/test/test_external_response.py b/test/test_external_response.py index df1ed78..78504a2 100644 --- a/test/test_external_response.py +++ b/test/test_external_response.py @@ -35,17 +35,13 @@ def make_instance(self, include_optional) -> ExternalResponse: if include_optional: return ExternalResponse( sha_256_hash = '', - data = { - 'key' : null - }, + data = { }, last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') ) else: return ExternalResponse( sha_256_hash = '', - data = { - 'key' : null - }, + data = { }, last_updated = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) """ diff --git a/test/test_pe_model.py b/test/test_pe_model.py index 97978b2..dcb9b61 100644 --- a/test/test_pe_model.py +++ b/test/test_pe_model.py @@ -54,9 +54,7 @@ def make_instance(self, include_optional) -> PEModel: high_entropy = True, seh = True, bound_image = True, ), - version_info = { - 'key' : null - }, + version_info = { }, debug_info = revengai.models.pdb_debug_model.PDBDebugModel( debug_entries = [ revengai.models.single_pdb_entry_model.SinglePDBEntryModel( @@ -142,9 +140,7 @@ def make_instance(self, include_optional) -> PEModel: high_entropy = True, seh = True, bound_image = True, ), - version_info = { - 'key' : null - }, + version_info = { }, debug_info = revengai.models.pdb_debug_model.PDBDebugModel( debug_entries = [ revengai.models.single_pdb_entry_model.SinglePDBEntryModel(