From 6f6fcd7aa094862dc5553e84d489c0d1e0116342 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Mar 2026 06:24:33 +0000 Subject: [PATCH] Update SDK to version v3.34.0 - Generated from OpenAPI spec version v3.34.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 2 + ...ponseListCalleesCallerFunctionsResponse.md | 33 +++ docs/FunctionMatchingFilters.md | 1 + docs/FunctionsCoreApi.md | 79 ++++++ revengai/__init__.py | 4 +- revengai/api/functions_core_api.py | 267 +++++++++++++++++- revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 1 + ..._list_callees_caller_functions_response.py | 129 +++++++++ revengai/models/function_matching_filters.py | 4 +- ...test_analysis_function_matching_request.py | 3 + ..._list_callees_caller_functions_response.py | 83 ++++++ test/test_function_matching_filters.py | 3 + test/test_function_matching_request.py | 3 + test/test_functions_core_api.py | 7 + 17 files changed, 620 insertions(+), 7 deletions(-) create mode 100644 docs/BaseResponseListCalleesCallerFunctionsResponse.md create mode 100644 revengai/models/base_response_list_callees_caller_functions_response.py create mode 100644 test/test_base_response_list_callees_caller_functions_response.py diff --git a/.sdk-version b/.sdk-version index 8204501..5ed1458 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.32.0 +v3.34.0 diff --git a/README.md b/README.md index ac6f211..0b26672 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**get_analysis_strings_status**](docs/FunctionsCoreApi.md#get_analysis_strings_status) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis *FunctionsCoreApi* | [**get_function_blocks**](docs/FunctionsCoreApi.md#get_function_blocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function *FunctionsCoreApi* | [**get_function_callees_callers**](docs/FunctionsCoreApi.md#get_function_callees_callers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function +*FunctionsCoreApi* | [**get_function_callees_callers_bulk**](docs/FunctionsCoreApi.md#get_function_callees_callers_bulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions *FunctionsCoreApi* | [**get_function_capabilities**](docs/FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities *FunctionsCoreApi* | [**get_function_details**](docs/FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details *FunctionsCoreApi* | [**get_function_strings**](docs/FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function @@ -237,6 +238,7 @@ Class | Method | HTTP request | Description - [BaseResponseGetAiDecompilationTask](docs/BaseResponseGetAiDecompilationTask.md) - [BaseResponseGetMeResponse](docs/BaseResponseGetMeResponse.md) - [BaseResponseGetPublicUserResponse](docs/BaseResponseGetPublicUserResponse.md) + - [BaseResponseListCalleesCallerFunctionsResponse](docs/BaseResponseListCalleesCallerFunctionsResponse.md) - [BaseResponseListCollectionResults](docs/BaseResponseListCollectionResults.md) - [BaseResponseListCommentResponse](docs/BaseResponseListCommentResponse.md) - [BaseResponseListDieMatch](docs/BaseResponseListDieMatch.md) diff --git a/docs/BaseResponseListCalleesCallerFunctionsResponse.md b/docs/BaseResponseListCalleesCallerFunctionsResponse.md new file mode 100644 index 0000000..8efc2ee --- /dev/null +++ b/docs/BaseResponseListCalleesCallerFunctionsResponse.md @@ -0,0 +1,33 @@ +# BaseResponseListCalleesCallerFunctionsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] +**data** | [**List[CalleesCallerFunctionsResponse]**](CalleesCallerFunctionsResponse.md) | | [optional] +**message** | **str** | | [optional] +**errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] +**meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] + +## Example + +```python +from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResponseListCalleesCallerFunctionsResponse from a JSON string +base_response_list_callees_caller_functions_response_instance = BaseResponseListCalleesCallerFunctionsResponse.from_json(json) +# print the JSON string representation of the object +print(BaseResponseListCalleesCallerFunctionsResponse.to_json()) + +# convert the object into a dict +base_response_list_callees_caller_functions_response_dict = base_response_list_callees_caller_functions_response_instance.to_dict() +# create an instance of BaseResponseListCalleesCallerFunctionsResponse from a dict +base_response_list_callees_caller_functions_response_from_dict = BaseResponseListCalleesCallerFunctionsResponse.from_dict(base_response_list_callees_caller_functions_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/FunctionMatchingFilters.md b/docs/FunctionMatchingFilters.md index 6df2261..5d22de5 100644 --- a/docs/FunctionMatchingFilters.md +++ b/docs/FunctionMatchingFilters.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **binary_ids** | **List[int]** | ID's of binaries to limit the search to, if empty, search all scoped binaries | [optional] [default to []] **collection_ids** | **List[int]** | ID's of collections to limit the search to, if empty, search all scoped collections | [optional] [default to []] **function_ids** | **List[int]** | ID's of functions to limit the search to, if empty, search all scoped functions | [optional] [default to []] +**user_ids** | **List[int]** | ID's of users to limit the search to, if empty, search all scoped users | [optional] [default to []] **debug_types** | **List[str]** | Limit the search to specific debug types, if empty, search all scoped debug & non-debug functions | [optional] [default to []] ## Example diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index b6518ad..a802cda 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -14,6 +14,7 @@ Method | HTTP request | Description [**get_analysis_strings_status**](FunctionsCoreApi.md#get_analysis_strings_status) | **GET** /v2/analyses/{analysis_id}/functions/strings/status | Get string processing state for the Analysis [**get_function_blocks**](FunctionsCoreApi.md#get_function_blocks) | **GET** /v2/functions/{function_id}/blocks | Get disassembly blocks related to the function [**get_function_callees_callers**](FunctionsCoreApi.md#get_function_callees_callers) | **GET** /v2/functions/{function_id}/callees_callers | Get list of functions that call or are called by the specified function +[**get_function_callees_callers_bulk**](FunctionsCoreApi.md#get_function_callees_callers_bulk) | **GET** /v2/functions/callees_callers | Get list of functions that call or are called for a list of functions [**get_function_capabilities**](FunctionsCoreApi.md#get_function_capabilities) | **GET** /v2/functions/{function_id}/capabilities | Retrieve a functions capabilities [**get_function_details**](FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details [**get_function_strings**](FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function @@ -840,6 +841,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_function_callees_callers_bulk** +> BaseResponseListCalleesCallerFunctionsResponse get_function_callees_callers_bulk(function_ids) + +Get list of functions that call or are called for a list of functions + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.FunctionsCoreApi(api_client) + function_ids = [56] # List[Optional[int]] | + + try: + # Get list of functions that call or are called for a list of functions + api_response = api_instance.get_function_callees_callers_bulk(function_ids) + print("The response of FunctionsCoreApi->get_function_callees_callers_bulk:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FunctionsCoreApi->get_function_callees_callers_bulk: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **function_ids** | [**List[Optional[int]]**](int.md)| | + +### Return type + +[**BaseResponseListCalleesCallerFunctionsResponse**](BaseResponseListCalleesCallerFunctionsResponse.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_function_capabilities** > BaseResponseFunctionCapabilityResponse get_function_capabilities(function_id) diff --git a/revengai/__init__.py b/revengai/__init__.py index 5b4ebb3..7e0c5e1 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.32.0" +__version__ = "v3.34.0" # Define package exports __all__ = [ @@ -130,6 +130,7 @@ "BaseResponseGetAiDecompilationTask", "BaseResponseGetMeResponse", "BaseResponseGetPublicUserResponse", + "BaseResponseListCalleesCallerFunctionsResponse", "BaseResponseListCollectionResults", "BaseResponseListCommentResponse", "BaseResponseListDieMatch", @@ -465,6 +466,7 @@ from revengai.models.base_response_get_ai_decompilation_task import BaseResponseGetAiDecompilationTask as BaseResponseGetAiDecompilationTask from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse as BaseResponseGetMeResponse from revengai.models.base_response_get_public_user_response import BaseResponseGetPublicUserResponse as BaseResponseGetPublicUserResponse +from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse as BaseResponseListCalleesCallerFunctionsResponse from revengai.models.base_response_list_collection_results import BaseResponseListCollectionResults as BaseResponseListCollectionResults from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse as BaseResponseListCommentResponse from revengai.models.base_response_list_die_match import BaseResponseListDieMatch as BaseResponseListDieMatch diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index 77dad5c..dbd8142 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -16,7 +16,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated from revengai.models.ai_unstrip_request import AiUnstripRequest from revengai.models.analysis_function_matching_request import AnalysisFunctionMatchingRequest @@ -29,6 +29,7 @@ from revengai.models.base_response_function_capability_response import BaseResponseFunctionCapabilityResponse from revengai.models.base_response_function_strings_response import BaseResponseFunctionStringsResponse from revengai.models.base_response_functions_detail_response import BaseResponseFunctionsDetailResponse +from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse from revengai.models.function_matching_request import FunctionMatchingRequest from revengai.models.function_matching_response import FunctionMatchingResponse @@ -2889,6 +2890,270 @@ def _get_function_callees_callers_serialize( + @validate_call + def get_function_callees_callers_bulk( + self, + function_ids: List[Optional[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, + ) -> BaseResponseListCalleesCallerFunctionsResponse: + """Get list of functions that call or are called for a list of functions + + + :param function_ids: (required) + :type function_ids: List[Optional[int]] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseListCalleesCallerFunctionsResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_function_callees_callers_bulk_with_http_info( + self, + function_ids: List[Optional[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[BaseResponseListCalleesCallerFunctionsResponse]: + """Get list of functions that call or are called for a list of functions + + + :param function_ids: (required) + :type function_ids: List[Optional[int]] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseListCalleesCallerFunctionsResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_function_callees_callers_bulk_without_preload_content( + self, + function_ids: List[Optional[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: + """Get list of functions that call or are called for a list of functions + + + :param function_ids: (required) + :type function_ids: List[Optional[int]] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_function_callees_callers_bulk_serialize( + function_ids=function_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseResponseListCalleesCallerFunctionsResponse", + '422': "BaseResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_function_callees_callers_bulk_serialize( + self, + function_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'function_ids': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if function_ids is not None: + + _query_params.append(('function_ids', function_ids)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/functions/callees_callers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_function_capabilities( self, diff --git a/revengai/api_client.py b/revengai/api_client.py index b646cfe..121b5e0 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.32.0/python' + self.user_agent = 'OpenAPI-Generator/v3.34.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 0c9c025..90106a7 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.32.0\n"\ - "SDK Package Version: v3.32.0".\ + "Version of the API: v3.34.0\n"\ + "SDK Package Version: v3.34.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 8023c0b..5156e73 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -97,6 +97,7 @@ from revengai.models.base_response_get_ai_decompilation_task import BaseResponseGetAiDecompilationTask from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse from revengai.models.base_response_get_public_user_response import BaseResponseGetPublicUserResponse +from revengai.models.base_response_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse from revengai.models.base_response_list_collection_results import BaseResponseListCollectionResults from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse from revengai.models.base_response_list_die_match import BaseResponseListDieMatch diff --git a/revengai/models/base_response_list_callees_caller_functions_response.py b/revengai/models/base_response_list_callees_caller_functions_response.py new file mode 100644 index 0000000..d46572d --- /dev/null +++ b/revengai/models/base_response_list_callees_caller_functions_response.py @@ -0,0 +1,129 @@ +# 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.callees_caller_functions_response import CalleesCallerFunctionsResponse +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 BaseResponseListCalleesCallerFunctionsResponse(BaseModel): + """ + BaseResponseListCalleesCallerFunctionsResponse + """ # noqa: E501 + status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") + data: Optional[List[CalleesCallerFunctionsResponse]] = 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 BaseResponseListCalleesCallerFunctionsResponse 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 each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # 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 BaseResponseListCalleesCallerFunctionsResponse 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": [CalleesCallerFunctionsResponse.from_dict(_item) for _item in 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/function_matching_filters.py b/revengai/models/function_matching_filters.py index f0e4b49..92c8d41 100644 --- a/revengai/models/function_matching_filters.py +++ b/revengai/models/function_matching_filters.py @@ -28,8 +28,9 @@ class FunctionMatchingFilters(BaseModel): binary_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of binaries to limit the search to, if empty, search all scoped binaries") collection_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of collections to limit the search to, if empty, search all scoped collections") function_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of functions to limit the search to, if empty, search all scoped functions") + user_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of users to limit the search to, if empty, search all scoped users") debug_types: Optional[List[StrictStr]] = Field(default=None, description="Limit the search to specific debug types, if empty, search all scoped debug & non-debug functions") - __properties: ClassVar[List[str]] = ["binary_ids", "collection_ids", "function_ids", "debug_types"] + __properties: ClassVar[List[str]] = ["binary_ids", "collection_ids", "function_ids", "user_ids", "debug_types"] @field_validator('debug_types') def debug_types_validate_enum(cls, value): @@ -96,6 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "binary_ids": obj.get("binary_ids"), "collection_ids": obj.get("collection_ids"), "function_ids": obj.get("function_ids"), + "user_ids": obj.get("user_ids"), "debug_types": obj.get("debug_types") }) return _obj diff --git a/test/test_analysis_function_matching_request.py b/test/test_analysis_function_matching_request.py index c6e2deb..552ede8 100644 --- a/test/test_analysis_function_matching_request.py +++ b/test/test_analysis_function_matching_request.py @@ -45,6 +45,9 @@ def make_instance(self, include_optional) -> AnalysisFunctionMatchingRequest: function_ids = [ 56 ], + user_ids = [ + 56 + ], debug_types = [ 'USER' ], ), diff --git a/test/test_base_response_list_callees_caller_functions_response.py b/test/test_base_response_list_callees_caller_functions_response.py new file mode 100644 index 0000000..b5196ca --- /dev/null +++ b/test/test_base_response_list_callees_caller_functions_response.py @@ -0,0 +1,83 @@ +# 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_list_callees_caller_functions_response import BaseResponseListCalleesCallerFunctionsResponse + +class TestBaseResponseListCalleesCallerFunctionsResponse(unittest.TestCase): + """BaseResponseListCalleesCallerFunctionsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResponseListCalleesCallerFunctionsResponse: + """Test BaseResponseListCalleesCallerFunctionsResponse + 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 `BaseResponseListCalleesCallerFunctionsResponse` + """ + model = BaseResponseListCalleesCallerFunctionsResponse() + if include_optional: + return BaseResponseListCalleesCallerFunctionsResponse( + status = True, + data = [ + revengai.models.callees_caller_functions_response.CalleesCallerFunctionsResponse( + base_address = 56, + callees = [ + revengai.models.callee_function_info.CalleeFunctionInfo( + function_id = 56, + matched_function_id = 56, + dashboard_url = '', + is_external = True, + callee_name = 'FUN_001e1370', + callee_vaddr = '1971056', ) + ], + callers = [ + revengai.models.caller_function_info.CallerFunctionInfo( + function_id = 56, + matched_function_id = 56, + dashboard_url = '', + is_external = True, + caller_name = 'FUN_0002a5d8', + caller_vaddr = '173528', ) + ], ) + ], + 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 BaseResponseListCalleesCallerFunctionsResponse( + ) + """ + + def testBaseResponseListCalleesCallerFunctionsResponse(self): + """Test BaseResponseListCalleesCallerFunctionsResponse""" + # 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_function_matching_filters.py b/test/test_function_matching_filters.py index 49acb93..9f9ac9c 100644 --- a/test/test_function_matching_filters.py +++ b/test/test_function_matching_filters.py @@ -43,6 +43,9 @@ def make_instance(self, include_optional) -> FunctionMatchingFilters: function_ids = [ 56 ], + user_ids = [ + 56 + ], debug_types = [ 'USER' ] diff --git a/test/test_function_matching_request.py b/test/test_function_matching_request.py index 59870f3..89f2ac7 100644 --- a/test/test_function_matching_request.py +++ b/test/test_function_matching_request.py @@ -49,6 +49,9 @@ def make_instance(self, include_optional) -> FunctionMatchingRequest: function_ids = [ 56 ], + user_ids = [ + 56 + ], debug_types = [ 'USER' ], ), diff --git a/test/test_functions_core_api.py b/test/test_functions_core_api.py index 7b85882..7ca2e1f 100644 --- a/test/test_functions_core_api.py +++ b/test/test_functions_core_api.py @@ -95,6 +95,13 @@ def test_get_function_callees_callers(self) -> None: """ pass + def test_get_function_callees_callers_bulk(self) -> None: + """Test case for get_function_callees_callers_bulk + + Get list of functions that call or are called for a list of functions + """ + pass + def test_get_function_capabilities(self) -> None: """Test case for get_function_capabilities