diff --git a/.sdk-version b/.sdk-version index dcc0d4e..aed1eb7 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.84.6 +v2.86.0 diff --git a/README.md b/README.md index 68ad80a..b20799e 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,11 @@ Class | Method | HTTP request | Description *AuthenticationUsersApi* | [**login_user**](docs/AuthenticationUsersApi.md#login_user) | **POST** /v2/auth/login | Authenticate a user *BinariesApi* | [**download_zipped_binary**](docs/BinariesApi.md#download_zipped_binary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection *BinariesApi* | [**get_binary_additional_details**](docs/BinariesApi.md#get_binary_additional_details) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary +*BinariesApi* | [**get_binary_additional_details_status**](docs/BinariesApi.md#get_binary_additional_details_status) | **GET** /v2/binaries/{binary_id}/additional-details/status | Gets the status of the additional details task for a binary *BinariesApi* | [**get_binary_details**](docs/BinariesApi.md#get_binary_details) | **GET** /v2/binaries/{binary_id}/details | Gets the details of a binary *BinariesApi* | [**get_binary_die_info**](docs/BinariesApi.md#get_binary_die_info) | **GET** /v2/binaries/{binary_id}/die-info | Gets the die info of a binary *BinariesApi* | [**get_binary_externals**](docs/BinariesApi.md#get_binary_externals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary +*BinariesApi* | [**get_binary_related_status**](docs/BinariesApi.md#get_binary_related_status) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary *BinariesApi* | [**get_related_binaries**](docs/BinariesApi.md#get_related_binaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. *CollectionsApi* | [**create_collection**](docs/CollectionsApi.md#create_collection) | **POST** /v2/collections | Creates new collection information *CollectionsApi* | [**delete_collection**](docs/CollectionsApi.md#delete_collection) | **DELETE** /v2/collections/{collection_id} | Deletes a collection @@ -147,6 +149,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AdditionalDetailsStatusResponse](docs/AdditionalDetailsStatusResponse.md) - [Addr](docs/Addr.md) - [AiDecompilationRating](docs/AiDecompilationRating.md) - [AiUnstripRequest](docs/AiUnstripRequest.md) @@ -177,6 +180,7 @@ Class | Method | HTTP request | Description - [AutoUnstripRequest](docs/AutoUnstripRequest.md) - [AutoUnstripResponse](docs/AutoUnstripResponse.md) - [BaseResponse](docs/BaseResponse.md) + - [BaseResponseAdditionalDetailsStatusResponse](docs/BaseResponseAdditionalDetailsStatusResponse.md) - [BaseResponseAnalysisCreateResponse](docs/BaseResponseAnalysisCreateResponse.md) - [BaseResponseAnalysisDetailResponse](docs/BaseResponseAnalysisDetailResponse.md) - [BaseResponseAnalysisFunctionMapping](docs/BaseResponseAnalysisFunctionMapping.md) @@ -187,6 +191,7 @@ Class | Method | HTTP request | Description - [BaseResponseAnalysisTags](docs/BaseResponseAnalysisTags.md) - [BaseResponseAnalysisUpdateTagsResponse](docs/BaseResponseAnalysisUpdateTagsResponse.md) - [BaseResponseBasic](docs/BaseResponseBasic.md) + - [BaseResponseBinariesRelatedStatusResponse](docs/BaseResponseBinariesRelatedStatusResponse.md) - [BaseResponseBinaryAdditionalResponse](docs/BaseResponseBinaryAdditionalResponse.md) - [BaseResponseBinaryDetailsResponse](docs/BaseResponseBinaryDetailsResponse.md) - [BaseResponseBinaryExternalsResponse](docs/BaseResponseBinaryExternalsResponse.md) @@ -247,6 +252,7 @@ Class | Method | HTTP request | Description - [BaseResponseUploadResponse](docs/BaseResponseUploadResponse.md) - [BaseResponseVulnerabilities](docs/BaseResponseVulnerabilities.md) - [Basic](docs/Basic.md) + - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [BinaryAdditionalDetailsDataResponse](docs/BinaryAdditionalDetailsDataResponse.md) - [BinaryAdditionalResponse](docs/BinaryAdditionalResponse.md) diff --git a/docs/AdditionalDetailsStatusResponse.md b/docs/AdditionalDetailsStatusResponse.md new file mode 100644 index 0000000..1e5d05e --- /dev/null +++ b/docs/AdditionalDetailsStatusResponse.md @@ -0,0 +1,29 @@ +# AdditionalDetailsStatusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | The current status of the additional details task | + +## Example + +```python +from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AdditionalDetailsStatusResponse from a JSON string +additional_details_status_response_instance = AdditionalDetailsStatusResponse.from_json(json) +# print the JSON string representation of the object +print(AdditionalDetailsStatusResponse.to_json()) + +# convert the object into a dict +additional_details_status_response_dict = additional_details_status_response_instance.to_dict() +# create an instance of AdditionalDetailsStatusResponse from a dict +additional_details_status_response_from_dict = AdditionalDetailsStatusResponse.from_dict(additional_details_status_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BaseResponseAdditionalDetailsStatusResponse.md b/docs/BaseResponseAdditionalDetailsStatusResponse.md new file mode 100644 index 0000000..021f0cb --- /dev/null +++ b/docs/BaseResponseAdditionalDetailsStatusResponse.md @@ -0,0 +1,33 @@ +# BaseResponseAdditionalDetailsStatusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] +**data** | [**AdditionalDetailsStatusResponse**](AdditionalDetailsStatusResponse.md) | | [optional] +**message** | **str** | | [optional] +**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] +**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] + +## Example + +```python +from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResponseAdditionalDetailsStatusResponse from a JSON string +base_response_additional_details_status_response_instance = BaseResponseAdditionalDetailsStatusResponse.from_json(json) +# print the JSON string representation of the object +print(BaseResponseAdditionalDetailsStatusResponse.to_json()) + +# convert the object into a dict +base_response_additional_details_status_response_dict = base_response_additional_details_status_response_instance.to_dict() +# create an instance of BaseResponseAdditionalDetailsStatusResponse from a dict +base_response_additional_details_status_response_from_dict = BaseResponseAdditionalDetailsStatusResponse.from_dict(base_response_additional_details_status_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BaseResponseBinariesRelatedStatusResponse.md b/docs/BaseResponseBinariesRelatedStatusResponse.md new file mode 100644 index 0000000..61a3e2b --- /dev/null +++ b/docs/BaseResponseBinariesRelatedStatusResponse.md @@ -0,0 +1,33 @@ +# BaseResponseBinariesRelatedStatusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] +**data** | [**BinariesRelatedStatusResponse**](BinariesRelatedStatusResponse.md) | | [optional] +**message** | **str** | | [optional] +**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] +**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] + +## Example + +```python +from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResponseBinariesRelatedStatusResponse from a JSON string +base_response_binaries_related_status_response_instance = BaseResponseBinariesRelatedStatusResponse.from_json(json) +# print the JSON string representation of the object +print(BaseResponseBinariesRelatedStatusResponse.to_json()) + +# convert the object into a dict +base_response_binaries_related_status_response_dict = base_response_binaries_related_status_response_instance.to_dict() +# create an instance of BaseResponseBinariesRelatedStatusResponse from a dict +base_response_binaries_related_status_response_from_dict = BaseResponseBinariesRelatedStatusResponse.from_dict(base_response_binaries_related_status_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BinariesApi.md b/docs/BinariesApi.md index f26677b..26ebdfc 100644 --- a/docs/BinariesApi.md +++ b/docs/BinariesApi.md @@ -6,9 +6,11 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**download_zipped_binary**](BinariesApi.md#download_zipped_binary) | **GET** /v2/binaries/{binary_id}/download-zipped | Downloads a zipped binary with password protection [**get_binary_additional_details**](BinariesApi.md#get_binary_additional_details) | **GET** /v2/binaries/{binary_id}/additional-details | Gets the additional details of a binary +[**get_binary_additional_details_status**](BinariesApi.md#get_binary_additional_details_status) | **GET** /v2/binaries/{binary_id}/additional-details/status | Gets the status of the additional details task for a binary [**get_binary_details**](BinariesApi.md#get_binary_details) | **GET** /v2/binaries/{binary_id}/details | Gets the details of a binary [**get_binary_die_info**](BinariesApi.md#get_binary_die_info) | **GET** /v2/binaries/{binary_id}/die-info | Gets the die info of a binary [**get_binary_externals**](BinariesApi.md#get_binary_externals) | **GET** /v2/binaries/{binary_id}/externals | Gets the external details of a binary +[**get_binary_related_status**](BinariesApi.md#get_binary_related_status) | **GET** /v2/binaries/{binary_id}/related/status | Gets the status of the unpack binary task for a binary [**get_related_binaries**](BinariesApi.md#get_related_binaries) | **GET** /v2/binaries/{binary_id}/related | Gets the related binaries of a binary. @@ -167,6 +169,84 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_binary_additional_details_status** +> BaseResponseAdditionalDetailsStatusResponse get_binary_additional_details_status(binary_id) + +Gets the status of the additional details task for a binary + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse +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.BinariesApi(api_client) + binary_id = 56 # int | + + try: + # Gets the status of the additional details task for a binary + api_response = api_instance.get_binary_additional_details_status(binary_id) + print("The response of BinariesApi->get_binary_additional_details_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->get_binary_additional_details_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| | + +### Return type + +[**BaseResponseAdditionalDetailsStatusResponse**](BaseResponseAdditionalDetailsStatusResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_binary_details** > BaseResponseBinaryDetailsResponse get_binary_details(binary_id) @@ -401,6 +481,84 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_binary_related_status** +> BaseResponseBinariesRelatedStatusResponse get_binary_related_status(binary_id) + +Gets the status of the unpack binary task for a binary + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse +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.BinariesApi(api_client) + binary_id = 56 # int | + + try: + # Gets the status of the unpack binary task for a binary + api_response = api_instance.get_binary_related_status(binary_id) + print("The response of BinariesApi->get_binary_related_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinariesApi->get_binary_related_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **binary_id** | **int**| | + +### Return type + +[**BaseResponseBinariesRelatedStatusResponse**](BaseResponseBinariesRelatedStatusResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_related_binaries** > BaseResponseChildBinariesResponse get_related_binaries(binary_id) diff --git a/docs/BinariesRelatedStatusResponse.md b/docs/BinariesRelatedStatusResponse.md new file mode 100644 index 0000000..4a6625f --- /dev/null +++ b/docs/BinariesRelatedStatusResponse.md @@ -0,0 +1,29 @@ +# BinariesRelatedStatusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | The current status of the unpack binary task | + +## Example + +```python +from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BinariesRelatedStatusResponse from a JSON string +binaries_related_status_response_instance = BinariesRelatedStatusResponse.from_json(json) +# print the JSON string representation of the object +print(BinariesRelatedStatusResponse.to_json()) + +# convert the object into a dict +binaries_related_status_response_dict = binaries_related_status_response_instance.to_dict() +# create an instance of BinariesRelatedStatusResponse from a dict +binaries_related_status_response_from_dict = BinariesRelatedStatusResponse.from_dict(binaries_related_status_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/revengai/__init__.py b/revengai/__init__.py index 110a1cc..dc03fcb 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v2.84.6" +__version__ = "v2.86.0" # Define package exports __all__ = [ @@ -44,6 +44,7 @@ "ApiKeyError", "ApiAttributeError", "ApiException", + "AdditionalDetailsStatusResponse", "Addr", "AiDecompilationRating", "AiUnstripRequest", @@ -74,6 +75,7 @@ "AutoUnstripRequest", "AutoUnstripResponse", "BaseResponse", + "BaseResponseAdditionalDetailsStatusResponse", "BaseResponseAnalysisCreateResponse", "BaseResponseAnalysisDetailResponse", "BaseResponseAnalysisFunctionMapping", @@ -84,6 +86,7 @@ "BaseResponseAnalysisTags", "BaseResponseAnalysisUpdateTagsResponse", "BaseResponseBasic", + "BaseResponseBinariesRelatedStatusResponse", "BaseResponseBinaryAdditionalResponse", "BaseResponseBinaryDetailsResponse", "BaseResponseBinaryExternalsResponse", @@ -144,6 +147,7 @@ "BaseResponseUploadResponse", "BaseResponseVulnerabilities", "Basic", + "BinariesRelatedStatusResponse", "BinariesTaskStatus", "BinaryAdditionalDetailsDataResponse", "BinaryAdditionalResponse", @@ -364,6 +368,7 @@ from revengai.exceptions import ApiException as ApiException # import models into sdk package +from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse as AdditionalDetailsStatusResponse from revengai.models.addr import Addr as Addr from revengai.models.ai_decompilation_rating import AiDecompilationRating as AiDecompilationRating from revengai.models.ai_unstrip_request import AiUnstripRequest as AiUnstripRequest @@ -394,6 +399,7 @@ from revengai.models.auto_unstrip_request import AutoUnstripRequest as AutoUnstripRequest from revengai.models.auto_unstrip_response import AutoUnstripResponse as AutoUnstripResponse from revengai.models.base_response import BaseResponse as BaseResponse +from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse as BaseResponseAdditionalDetailsStatusResponse from revengai.models.base_response_analysis_create_response import BaseResponseAnalysisCreateResponse as BaseResponseAnalysisCreateResponse from revengai.models.base_response_analysis_detail_response import BaseResponseAnalysisDetailResponse as BaseResponseAnalysisDetailResponse from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping as BaseResponseAnalysisFunctionMapping @@ -404,6 +410,7 @@ from revengai.models.base_response_analysis_tags import BaseResponseAnalysisTags as BaseResponseAnalysisTags from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse as BaseResponseAnalysisUpdateTagsResponse from revengai.models.base_response_basic import BaseResponseBasic as BaseResponseBasic +from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse as BaseResponseBinariesRelatedStatusResponse from revengai.models.base_response_binary_additional_response import BaseResponseBinaryAdditionalResponse as BaseResponseBinaryAdditionalResponse from revengai.models.base_response_binary_details_response import BaseResponseBinaryDetailsResponse as BaseResponseBinaryDetailsResponse from revengai.models.base_response_binary_externals_response import BaseResponseBinaryExternalsResponse as BaseResponseBinaryExternalsResponse @@ -464,6 +471,7 @@ from revengai.models.base_response_upload_response import BaseResponseUploadResponse as BaseResponseUploadResponse from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities as BaseResponseVulnerabilities from revengai.models.basic import Basic as Basic +from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse as BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus as BinariesTaskStatus from revengai.models.binary_additional_details_data_response import BinaryAdditionalDetailsDataResponse as BinaryAdditionalDetailsDataResponse from revengai.models.binary_additional_response import BinaryAdditionalResponse as BinaryAdditionalResponse diff --git a/revengai/api/binaries_api.py b/revengai/api/binaries_api.py index c5f152b..07d5d48 100644 --- a/revengai/api/binaries_api.py +++ b/revengai/api/binaries_api.py @@ -17,6 +17,8 @@ from pydantic import StrictInt from typing import Any +from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse +from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse from revengai.models.base_response_binary_additional_response import BaseResponseBinaryAdditionalResponse from revengai.models.base_response_binary_details_response import BaseResponseBinaryDetailsResponse from revengai.models.base_response_binary_externals_response import BaseResponseBinaryExternalsResponse @@ -563,6 +565,267 @@ def _get_binary_additional_details_serialize( + @validate_call + def get_binary_additional_details_status( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseAdditionalDetailsStatusResponse: + """Gets the status of the additional details task for a binary + + + :param binary_id: (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_binary_additional_details_status_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': "BaseResponseAdditionalDetailsStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_binary_additional_details_status_with_http_info( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseAdditionalDetailsStatusResponse]: + """Gets the status of the additional details task for a binary + + + :param binary_id: (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_binary_additional_details_status_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': "BaseResponseAdditionalDetailsStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_binary_additional_details_status_without_preload_content( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets the status of the additional details task for a binary + + + :param binary_id: (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_binary_additional_details_status_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': "BaseResponseAdditionalDetailsStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_binary_additional_details_status_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' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/binaries/{binary_id}/additional-details/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 get_binary_details( self, @@ -1346,6 +1609,267 @@ def _get_binary_externals_serialize( + @validate_call + def get_binary_related_status( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseResponseBinariesRelatedStatusResponse: + """Gets the status of the unpack binary task for a binary + + + :param binary_id: (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_binary_related_status_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': "BaseResponseBinariesRelatedStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_binary_related_status_with_http_info( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseResponseBinariesRelatedStatusResponse]: + """Gets the status of the unpack binary task for a binary + + + :param binary_id: (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_binary_related_status_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': "BaseResponseBinariesRelatedStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_binary_related_status_without_preload_content( + self, + binary_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets the status of the unpack binary task for a binary + + + :param binary_id: (required) + :type binary_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_binary_related_status_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': "BaseResponseBinariesRelatedStatusResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_binary_related_status_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' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/binaries/{binary_id}/related/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 get_related_binaries( self, diff --git a/revengai/api_client.py b/revengai/api_client.py index 5df6784..e058719 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/v2.84.6/python' + self.user_agent = 'OpenAPI-Generator/v2.86.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index ea25186..3595d90 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: v2.84.6\n"\ - "SDK Package Version: v2.84.6".\ + "Version of the API: v2.86.0\n"\ + "SDK Package Version: v2.86.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 57bb83f..d7e2be9 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -12,6 +12,7 @@ """ # noqa: E501 # import models into model package +from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse from revengai.models.addr import Addr from revengai.models.ai_decompilation_rating import AiDecompilationRating from revengai.models.ai_unstrip_request import AiUnstripRequest @@ -42,6 +43,7 @@ from revengai.models.auto_unstrip_request import AutoUnstripRequest from revengai.models.auto_unstrip_response import AutoUnstripResponse from revengai.models.base_response import BaseResponse +from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse from revengai.models.base_response_analysis_create_response import BaseResponseAnalysisCreateResponse from revengai.models.base_response_analysis_detail_response import BaseResponseAnalysisDetailResponse from revengai.models.base_response_analysis_function_mapping import BaseResponseAnalysisFunctionMapping @@ -52,6 +54,7 @@ from revengai.models.base_response_analysis_tags import BaseResponseAnalysisTags from revengai.models.base_response_analysis_update_tags_response import BaseResponseAnalysisUpdateTagsResponse from revengai.models.base_response_basic import BaseResponseBasic +from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse from revengai.models.base_response_binary_additional_response import BaseResponseBinaryAdditionalResponse from revengai.models.base_response_binary_details_response import BaseResponseBinaryDetailsResponse from revengai.models.base_response_binary_externals_response import BaseResponseBinaryExternalsResponse @@ -112,6 +115,7 @@ from revengai.models.base_response_upload_response import BaseResponseUploadResponse from revengai.models.base_response_vulnerabilities import BaseResponseVulnerabilities from revengai.models.basic import Basic +from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus from revengai.models.binary_additional_details_data_response import BinaryAdditionalDetailsDataResponse from revengai.models.binary_additional_response import BinaryAdditionalResponse diff --git a/revengai/models/additional_details_status_response.py b/revengai/models/additional_details_status_response.py new file mode 100644 index 0000000..2b184c6 --- /dev/null +++ b/revengai/models/additional_details_status_response.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + 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 AdditionalDetailsStatusResponse(BaseModel): + """ + AdditionalDetailsStatusResponse + """ # noqa: E501 + status: StrictStr = Field(description="The current status of the additional details task") + __properties: ClassVar[List[str]] = ["status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdditionalDetailsStatusResponse 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 AdditionalDetailsStatusResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") + }) + return _obj + + diff --git a/revengai/models/base_response_additional_details_status_response.py b/revengai/models/base_response_additional_details_status_response.py new file mode 100644 index 0000000..ffe6a05 --- /dev/null +++ b/revengai/models/base_response_additional_details_status_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + 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.additional_details_status_response import AdditionalDetailsStatusResponse +from revengai.models.error_model import ErrorModel +from revengai.models.meta_model import MetaModel +from typing import Optional, Set +from typing_extensions import Self + +class BaseResponseAdditionalDetailsStatusResponse(BaseModel): + """ + BaseResponseAdditionalDetailsStatusResponse + """ # noqa: E501 + status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") + data: Optional[AdditionalDetailsStatusResponse] = None + message: Optional[StrictStr] = None + errors: Optional[List[ErrorModel]] = None + meta: Optional[MetaModel] = Field(default=None, description="Metadata") + __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BaseResponseAdditionalDetailsStatusResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if message (nullable) is None + # and model_fields_set contains the field + if self.message is None and "message" in self.model_fields_set: + _dict['message'] = None + + # set to None if errors (nullable) is None + # and model_fields_set contains the field + if self.errors is None and "errors" in self.model_fields_set: + _dict['errors'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BaseResponseAdditionalDetailsStatusResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") if obj.get("status") is not None else True, + "data": AdditionalDetailsStatusResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, + "message": obj.get("message"), + "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, + "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/revengai/models/base_response_binaries_related_status_response.py b/revengai/models/base_response_binaries_related_status_response.py new file mode 100644 index 0000000..a8392a4 --- /dev/null +++ b/revengai/models/base_response_binaries_related_status_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + 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.binaries_related_status_response import BinariesRelatedStatusResponse +from revengai.models.error_model import ErrorModel +from revengai.models.meta_model import MetaModel +from typing import Optional, Set +from typing_extensions import Self + +class BaseResponseBinariesRelatedStatusResponse(BaseModel): + """ + BaseResponseBinariesRelatedStatusResponse + """ # noqa: E501 + status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") + data: Optional[BinariesRelatedStatusResponse] = None + message: Optional[StrictStr] = None + errors: Optional[List[ErrorModel]] = None + meta: Optional[MetaModel] = Field(default=None, description="Metadata") + __properties: ClassVar[List[str]] = ["status", "data", "message", "errors", "meta"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BaseResponseBinariesRelatedStatusResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if message (nullable) is None + # and model_fields_set contains the field + if self.message is None and "message" in self.model_fields_set: + _dict['message'] = None + + # set to None if errors (nullable) is None + # and model_fields_set contains the field + if self.errors is None and "errors" in self.model_fields_set: + _dict['errors'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BaseResponseBinariesRelatedStatusResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") if obj.get("status") is not None else True, + "data": BinariesRelatedStatusResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, + "message": obj.get("message"), + "errors": [ErrorModel.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, + "meta": MetaModel.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/revengai/models/binaries_related_status_response.py b/revengai/models/binaries_related_status_response.py new file mode 100644 index 0000000..3b07b45 --- /dev/null +++ b/revengai/models/binaries_related_status_response.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + 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 BinariesRelatedStatusResponse(BaseModel): + """ + BinariesRelatedStatusResponse + """ # noqa: E501 + status: StrictStr = Field(description="The current status of the unpack binary task") + __properties: ClassVar[List[str]] = ["status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BinariesRelatedStatusResponse 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 BinariesRelatedStatusResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") + }) + return _obj + + diff --git a/test/test_additional_details_status_response.py b/test/test_additional_details_status_response.py new file mode 100644 index 0000000..7e6bf52 --- /dev/null +++ b/test/test_additional_details_status_response.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.additional_details_status_response import AdditionalDetailsStatusResponse + +class TestAdditionalDetailsStatusResponse(unittest.TestCase): + """AdditionalDetailsStatusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdditionalDetailsStatusResponse: + """Test AdditionalDetailsStatusResponse + 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 `AdditionalDetailsStatusResponse` + """ + model = AdditionalDetailsStatusResponse() + if include_optional: + return AdditionalDetailsStatusResponse( + status = '' + ) + else: + return AdditionalDetailsStatusResponse( + status = '', + ) + """ + + def testAdditionalDetailsStatusResponse(self): + """Test AdditionalDetailsStatusResponse""" + # 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_base_response_additional_details_status_response.py b/test/test_base_response_additional_details_status_response.py new file mode 100644 index 0000000..0d933d4 --- /dev/null +++ b/test/test_base_response_additional_details_status_response.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.base_response_additional_details_status_response import BaseResponseAdditionalDetailsStatusResponse + +class TestBaseResponseAdditionalDetailsStatusResponse(unittest.TestCase): + """BaseResponseAdditionalDetailsStatusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResponseAdditionalDetailsStatusResponse: + """Test BaseResponseAdditionalDetailsStatusResponse + 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 `BaseResponseAdditionalDetailsStatusResponse` + """ + model = BaseResponseAdditionalDetailsStatusResponse() + if include_optional: + return BaseResponseAdditionalDetailsStatusResponse( + status = True, + data = revengai.models.additional_details_status_response.AdditionalDetailsStatusResponse( + status = '', ), + message = '', + errors = [ + revengai.models.error_model.ErrorModel( + code = '', + message = '', ) + ], + meta = revengai.models.meta_model.MetaModel( + pagination = revengai.models.pagination_model.PaginationModel( + page_size = 56, + page_number = 56, + has_next_page = True, ), ) + ) + else: + return BaseResponseAdditionalDetailsStatusResponse( + ) + """ + + def testBaseResponseAdditionalDetailsStatusResponse(self): + """Test BaseResponseAdditionalDetailsStatusResponse""" + # 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_base_response_binaries_related_status_response.py b/test/test_base_response_binaries_related_status_response.py new file mode 100644 index 0000000..945176b --- /dev/null +++ b/test/test_base_response_binaries_related_status_response.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.base_response_binaries_related_status_response import BaseResponseBinariesRelatedStatusResponse + +class TestBaseResponseBinariesRelatedStatusResponse(unittest.TestCase): + """BaseResponseBinariesRelatedStatusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResponseBinariesRelatedStatusResponse: + """Test BaseResponseBinariesRelatedStatusResponse + 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 `BaseResponseBinariesRelatedStatusResponse` + """ + model = BaseResponseBinariesRelatedStatusResponse() + if include_optional: + return BaseResponseBinariesRelatedStatusResponse( + status = True, + data = revengai.models.binaries_related_status_response.BinariesRelatedStatusResponse( + status = '', ), + message = '', + errors = [ + revengai.models.error_model.ErrorModel( + code = '', + message = '', ) + ], + meta = revengai.models.meta_model.MetaModel( + pagination = revengai.models.pagination_model.PaginationModel( + page_size = 56, + page_number = 56, + has_next_page = True, ), ) + ) + else: + return BaseResponseBinariesRelatedStatusResponse( + ) + """ + + def testBaseResponseBinariesRelatedStatusResponse(self): + """Test BaseResponseBinariesRelatedStatusResponse""" + # 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_binaries_api.py b/test/test_binaries_api.py index af17014..c35643a 100644 --- a/test/test_binaries_api.py +++ b/test/test_binaries_api.py @@ -39,6 +39,13 @@ def test_get_binary_additional_details(self) -> None: """ pass + def test_get_binary_additional_details_status(self) -> None: + """Test case for get_binary_additional_details_status + + Gets the status of the additional details task for a binary + """ + pass + def test_get_binary_details(self) -> None: """Test case for get_binary_details @@ -60,6 +67,13 @@ def test_get_binary_externals(self) -> None: """ pass + def test_get_binary_related_status(self) -> None: + """Test case for get_binary_related_status + + Gets the status of the unpack binary task for a binary + """ + pass + def test_get_related_binaries(self) -> None: """Test case for get_related_binaries diff --git a/test/test_binaries_related_status_response.py b/test/test_binaries_related_status_response.py new file mode 100644 index 0000000..7c4bc67 --- /dev/null +++ b/test/test_binaries_related_status_response.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is Similarity Search Engine for executable binaries + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse + +class TestBinariesRelatedStatusResponse(unittest.TestCase): + """BinariesRelatedStatusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BinariesRelatedStatusResponse: + """Test BinariesRelatedStatusResponse + 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 `BinariesRelatedStatusResponse` + """ + model = BinariesRelatedStatusResponse() + if include_optional: + return BinariesRelatedStatusResponse( + status = '' + ) + else: + return BinariesRelatedStatusResponse( + status = '', + ) + """ + + def testBinariesRelatedStatusResponse(self): + """Test BinariesRelatedStatusResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()