diff --git a/.sdk-version b/.sdk-version index 97ae48a..aeb5aaf 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.43.0 +v2.46.0 diff --git a/README.md b/README.md index 230430c..f4cc78e 100644 --- a/README.md +++ b/README.md @@ -321,10 +321,10 @@ Class | Method | HTTP request | Description - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) - [FunctionMappingFull](docs/FunctionMappingFull.md) - - [FunctionMatchingBatchResponse](docs/FunctionMatchingBatchResponse.md) + - [FunctionMatch](docs/FunctionMatch.md) - [FunctionMatchingFilters](docs/FunctionMatchingFilters.md) - [FunctionMatchingRequest](docs/FunctionMatchingRequest.md) - - [FunctionMatchingResultWithBestMatch](docs/FunctionMatchingResultWithBestMatch.md) + - [FunctionMatchingResponse](docs/FunctionMatchingResponse.md) - [FunctionNameHistory](docs/FunctionNameHistory.md) - [FunctionParamResponse](docs/FunctionParamResponse.md) - [FunctionRename](docs/FunctionRename.md) diff --git a/docs/FunctionMatch.md b/docs/FunctionMatch.md new file mode 100644 index 0000000..7cd06b3 --- /dev/null +++ b/docs/FunctionMatch.md @@ -0,0 +1,31 @@ +# FunctionMatch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_id** | **int** | Unique identifier of the function | +**matched_functions** | [**List[MatchedFunction]**](MatchedFunction.md) | | +**confidences** | [**List[NameConfidence]**](NameConfidence.md) | | [optional] + +## Example + +```python +from revengai.models.function_match import FunctionMatch + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionMatch from a JSON string +function_match_instance = FunctionMatch.from_json(json) +# print the JSON string representation of the object +print(FunctionMatch.to_json()) + +# convert the object into a dict +function_match_dict = function_match_instance.to_dict() +# create an instance of FunctionMatch from a dict +function_match_from_dict = FunctionMatch.from_dict(function_match_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FunctionMatchingBatchResponse.md b/docs/FunctionMatchingResponse.md similarity index 50% rename from docs/FunctionMatchingBatchResponse.md rename to docs/FunctionMatchingResponse.md index a8895c1..28b91ef 100644 --- a/docs/FunctionMatchingBatchResponse.md +++ b/docs/FunctionMatchingResponse.md @@ -1,4 +1,4 @@ -# FunctionMatchingBatchResponse +# FunctionMatchingResponse ## Properties @@ -11,24 +11,27 @@ Name | Type | Description | Notes **error_message** | **str** | | [optional] **current_page** | **int** | | [optional] **total_pages** | **int** | | [optional] -**matches** | [**List[FunctionMatchingResultWithBestMatch]**](FunctionMatchingResultWithBestMatch.md) | | [optional] +**matches** | [**List[FunctionMatch]**](FunctionMatch.md) | | [optional] +**num_matches** | **int** | | [optional] +**num_debug_matches** | **int** | | [optional] +**updated_at** | **str** | | [optional] ## Example ```python -from revengai.models.function_matching_batch_response import FunctionMatchingBatchResponse +from revengai.models.function_matching_response import FunctionMatchingResponse # TODO update the JSON string below json = "{}" -# create an instance of FunctionMatchingBatchResponse from a JSON string -function_matching_batch_response_instance = FunctionMatchingBatchResponse.from_json(json) +# create an instance of FunctionMatchingResponse from a JSON string +function_matching_response_instance = FunctionMatchingResponse.from_json(json) # print the JSON string representation of the object -print(FunctionMatchingBatchResponse.to_json()) +print(FunctionMatchingResponse.to_json()) # convert the object into a dict -function_matching_batch_response_dict = function_matching_batch_response_instance.to_dict() -# create an instance of FunctionMatchingBatchResponse from a dict -function_matching_batch_response_from_dict = FunctionMatchingBatchResponse.from_dict(function_matching_batch_response_dict) +function_matching_response_dict = function_matching_response_instance.to_dict() +# create an instance of FunctionMatchingResponse from a dict +function_matching_response_from_dict = FunctionMatchingResponse.from_dict(function_matching_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/FunctionMatchingResultWithBestMatch.md b/docs/FunctionMatchingResultWithBestMatch.md deleted file mode 100644 index 1b7e5bd..0000000 --- a/docs/FunctionMatchingResultWithBestMatch.md +++ /dev/null @@ -1,31 +0,0 @@ -# FunctionMatchingResultWithBestMatch - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**function_id** | **int** | Unique identifier of the function | -**matched_functions** | [**List[MatchedFunction]**](MatchedFunction.md) | | -**confidences** | [**List[NameConfidence]**](NameConfidence.md) | | [optional] - -## Example - -```python -from revengai.models.function_matching_result_with_best_match import FunctionMatchingResultWithBestMatch - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionMatchingResultWithBestMatch from a JSON string -function_matching_result_with_best_match_instance = FunctionMatchingResultWithBestMatch.from_json(json) -# print the JSON string representation of the object -print(FunctionMatchingResultWithBestMatch.to_json()) - -# convert the object into a dict -function_matching_result_with_best_match_dict = function_matching_result_with_best_match_instance.to_dict() -# create an instance of FunctionMatchingResultWithBestMatch from a dict -function_matching_result_with_best_match_from_dict = FunctionMatchingResultWithBestMatch.from_dict(function_matching_result_with_best_match_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FunctionsCoreApi.md b/docs/FunctionsCoreApi.md index 6bfd469..72cf8c2 100644 --- a/docs/FunctionsCoreApi.md +++ b/docs/FunctionsCoreApi.md @@ -102,7 +102,7 @@ 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) # **analysis_function_matching** -> FunctionMatchingBatchResponse analysis_function_matching(analysis_id, analysis_function_matching_request) +> FunctionMatchingResponse analysis_function_matching(analysis_id, analysis_function_matching_request) Perform matching for the functions of an analysis @@ -115,7 +115,7 @@ Takes in an analysis id and settings and matches the nearest functions to the on ```python import revengai from revengai.models.analysis_function_matching_request import AnalysisFunctionMatchingRequest -from revengai.models.function_matching_batch_response import FunctionMatchingBatchResponse +from revengai.models.function_matching_response import FunctionMatchingResponse from revengai.rest import ApiException from pprint import pprint @@ -164,7 +164,7 @@ Name | Type | Description | Notes ### Return type -[**FunctionMatchingBatchResponse**](FunctionMatchingBatchResponse.md) +[**FunctionMatchingResponse**](FunctionMatchingResponse.md) ### Authorization @@ -268,7 +268,7 @@ 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) # **batch_function_matching** -> FunctionMatchingBatchResponse batch_function_matching(function_matching_request) +> FunctionMatchingResponse batch_function_matching(function_matching_request) Perform function matching for an arbitrary batch of functions, binaries or collections @@ -280,8 +280,8 @@ Takes in an input of functions ID's and settings and finds the nearest functions ```python import revengai -from revengai.models.function_matching_batch_response import FunctionMatchingBatchResponse from revengai.models.function_matching_request import FunctionMatchingRequest +from revengai.models.function_matching_response import FunctionMatchingResponse from revengai.rest import ApiException from pprint import pprint @@ -328,7 +328,7 @@ Name | Type | Description | Notes ### Return type -[**FunctionMatchingBatchResponse**](FunctionMatchingBatchResponse.md) +[**FunctionMatchingResponse**](FunctionMatchingResponse.md) ### Authorization diff --git a/docs/LoginRequest.md b/docs/LoginRequest.md index 978ddc5..d7f0729 100644 --- a/docs/LoginRequest.md +++ b/docs/LoginRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**username** | **str** | User's username | +**username** | **str** | User's username or email | **password** | **str** | User's password | ## Example diff --git a/revengai/__init__.py b/revengai/__init__.py index fc01122..08a5e71 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v2.43.0" +__version__ = "v2.46.0" # Define package exports __all__ = [ @@ -217,10 +217,10 @@ "FunctionLocalVariableResponse", "FunctionMapping", "FunctionMappingFull", - "FunctionMatchingBatchResponse", + "FunctionMatch", "FunctionMatchingFilters", "FunctionMatchingRequest", - "FunctionMatchingResultWithBestMatch", + "FunctionMatchingResponse", "FunctionNameHistory", "FunctionParamResponse", "FunctionRename", @@ -531,10 +531,10 @@ from revengai.models.function_local_variable_response import FunctionLocalVariableResponse as FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping as FunctionMapping from revengai.models.function_mapping_full import FunctionMappingFull as FunctionMappingFull -from revengai.models.function_matching_batch_response import FunctionMatchingBatchResponse as FunctionMatchingBatchResponse +from revengai.models.function_match import FunctionMatch as FunctionMatch from revengai.models.function_matching_filters import FunctionMatchingFilters as FunctionMatchingFilters from revengai.models.function_matching_request import FunctionMatchingRequest as FunctionMatchingRequest -from revengai.models.function_matching_result_with_best_match import FunctionMatchingResultWithBestMatch as FunctionMatchingResultWithBestMatch +from revengai.models.function_matching_response import FunctionMatchingResponse as FunctionMatchingResponse from revengai.models.function_name_history import FunctionNameHistory as FunctionNameHistory from revengai.models.function_param_response import FunctionParamResponse as FunctionParamResponse from revengai.models.function_rename import FunctionRename as FunctionRename diff --git a/revengai/api/functions_core_api.py b/revengai/api/functions_core_api.py index 216995a..db8fccc 100644 --- a/revengai/api/functions_core_api.py +++ b/revengai/api/functions_core_api.py @@ -28,8 +28,8 @@ 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.function_matching_batch_response import FunctionMatchingBatchResponse from revengai.models.function_matching_request import FunctionMatchingRequest +from revengai.models.function_matching_response import FunctionMatchingResponse from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -358,7 +358,7 @@ def analysis_function_matching( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FunctionMatchingBatchResponse: + ) -> FunctionMatchingResponse: """Perform matching for the functions of an analysis Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids @@ -399,7 +399,7 @@ def analysis_function_matching( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingBatchResponse", + '200': "FunctionMatchingResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -430,7 +430,7 @@ def analysis_function_matching_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[FunctionMatchingBatchResponse]: + ) -> ApiResponse[FunctionMatchingResponse]: """Perform matching for the functions of an analysis Takes in an analysis id and settings and matches the nearest functions to the ones associated with it. Results can optionally be filtered by collection, binary, debug type or (other) function ids @@ -471,7 +471,7 @@ def analysis_function_matching_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingBatchResponse", + '200': "FunctionMatchingResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -543,7 +543,7 @@ def analysis_function_matching_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingBatchResponse", + '200': "FunctionMatchingResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -941,7 +941,7 @@ def batch_function_matching( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FunctionMatchingBatchResponse: + ) -> FunctionMatchingResponse: """Perform function matching for an arbitrary batch of functions, binaries or collections Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system @@ -979,7 +979,7 @@ def batch_function_matching( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingBatchResponse", + '200': "FunctionMatchingResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1009,7 +1009,7 @@ def batch_function_matching_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[FunctionMatchingBatchResponse]: + ) -> ApiResponse[FunctionMatchingResponse]: """Perform function matching for an arbitrary batch of functions, binaries or collections Takes in an input of functions ID's and settings and finds the nearest functions for each function that's within the system @@ -1047,7 +1047,7 @@ def batch_function_matching_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingBatchResponse", + '200': "FunctionMatchingResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1115,7 +1115,7 @@ def batch_function_matching_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "FunctionMatchingBatchResponse", + '200': "FunctionMatchingResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( diff --git a/revengai/api_client.py b/revengai/api_client.py index b16d608..dfe1fa1 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.43.0/python' + self.user_agent = 'OpenAPI-Generator/v2.46.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index e0e20e7..1956650 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.43.0\n"\ - "SDK Package Version: v2.43.0".\ + "Version of the API: v2.46.0\n"\ + "SDK Package Version: v2.46.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 f98550c..b3561e8 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -185,10 +185,10 @@ from revengai.models.function_local_variable_response import FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping from revengai.models.function_mapping_full import FunctionMappingFull -from revengai.models.function_matching_batch_response import FunctionMatchingBatchResponse +from revengai.models.function_match import FunctionMatch from revengai.models.function_matching_filters import FunctionMatchingFilters from revengai.models.function_matching_request import FunctionMatchingRequest -from revengai.models.function_matching_result_with_best_match import FunctionMatchingResultWithBestMatch +from revengai.models.function_matching_response import FunctionMatchingResponse from revengai.models.function_name_history import FunctionNameHistory from revengai.models.function_param_response import FunctionParamResponse from revengai.models.function_rename import FunctionRename diff --git a/revengai/models/function_matching_result_with_best_match.py b/revengai/models/function_match.py similarity index 93% rename from revengai/models/function_matching_result_with_best_match.py rename to revengai/models/function_match.py index 3313e8f..cdb6e32 100644 --- a/revengai/models/function_matching_result_with_best_match.py +++ b/revengai/models/function_match.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class FunctionMatchingResultWithBestMatch(BaseModel): +class FunctionMatch(BaseModel): """ - FunctionMatchingResultWithBestMatch + FunctionMatch """ # noqa: E501 function_id: StrictInt = Field(description="Unique identifier of the function") matched_functions: List[MatchedFunction] @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionMatchingResultWithBestMatch from a JSON string""" + """Create an instance of FunctionMatch from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -94,7 +94,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionMatchingResultWithBestMatch from a dict""" + """Create an instance of FunctionMatch from a dict""" if obj is None: return None diff --git a/revengai/models/function_matching_batch_response.py b/revengai/models/function_matching_response.py similarity index 75% rename from revengai/models/function_matching_batch_response.py rename to revengai/models/function_matching_response.py index de8c5f2..c608241 100644 --- a/revengai/models/function_matching_batch_response.py +++ b/revengai/models/function_matching_response.py @@ -18,13 +18,13 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_matching_result_with_best_match import FunctionMatchingResultWithBestMatch +from revengai.models.function_match import FunctionMatch from typing import Optional, Set from typing_extensions import Self -class FunctionMatchingBatchResponse(BaseModel): +class FunctionMatchingResponse(BaseModel): """ - FunctionMatchingBatchResponse + FunctionMatchingResponse """ # noqa: E501 progress: Optional[StrictInt] = Field(default=0, description="Progress of the matching operation, represented as a percentage") status: Optional[StrictStr] = None @@ -32,8 +32,11 @@ class FunctionMatchingBatchResponse(BaseModel): error_message: Optional[StrictStr] = None current_page: Optional[StrictInt] = None total_pages: Optional[StrictInt] = None - matches: Optional[List[FunctionMatchingResultWithBestMatch]] = None - __properties: ClassVar[List[str]] = ["progress", "status", "total_time", "error_message", "current_page", "total_pages", "matches"] + matches: Optional[List[FunctionMatch]] = None + num_matches: Optional[StrictInt] = None + num_debug_matches: Optional[StrictInt] = None + updated_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["progress", "status", "total_time", "error_message", "current_page", "total_pages", "matches", "num_matches", "num_debug_matches", "updated_at"] model_config = ConfigDict( populate_by_name=True, @@ -53,7 +56,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionMatchingBatchResponse from a JSON string""" + """Create an instance of FunctionMatchingResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -111,11 +114,26 @@ def to_dict(self) -> Dict[str, Any]: if self.matches is None and "matches" in self.model_fields_set: _dict['matches'] = None + # set to None if num_matches (nullable) is None + # and model_fields_set contains the field + if self.num_matches is None and "num_matches" in self.model_fields_set: + _dict['num_matches'] = None + + # set to None if num_debug_matches (nullable) is None + # and model_fields_set contains the field + if self.num_debug_matches is None and "num_debug_matches" in self.model_fields_set: + _dict['num_debug_matches'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionMatchingBatchResponse from a dict""" + """Create an instance of FunctionMatchingResponse from a dict""" if obj is None: return None @@ -129,7 +147,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "error_message": obj.get("error_message"), "current_page": obj.get("current_page"), "total_pages": obj.get("total_pages"), - "matches": [FunctionMatchingResultWithBestMatch.from_dict(_item) for _item in obj["matches"]] if obj.get("matches") is not None else None + "matches": [FunctionMatch.from_dict(_item) for _item in obj["matches"]] if obj.get("matches") is not None else None, + "num_matches": obj.get("num_matches"), + "num_debug_matches": obj.get("num_debug_matches"), + "updated_at": obj.get("updated_at") }) return _obj diff --git a/revengai/models/login_request.py b/revengai/models/login_request.py index eedc9ce..3d734bc 100644 --- a/revengai/models/login_request.py +++ b/revengai/models/login_request.py @@ -26,7 +26,7 @@ class LoginRequest(BaseModel): """ LoginRequest """ # noqa: E501 - username: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="User's username") + username: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="User's username or email") password: Annotated[str, Field(min_length=10, strict=True)] = Field(description="User's password") __properties: ClassVar[List[str]] = ["username", "password"] diff --git a/test/test_function_matching_result_with_best_match.py b/test/test_function_match.py similarity index 77% rename from test/test_function_matching_result_with_best_match.py rename to test/test_function_match.py index 02c4939..1f18445 100644 --- a/test/test_function_matching_result_with_best_match.py +++ b/test/test_function_match.py @@ -13,10 +13,10 @@ import unittest -from revengai.models.function_matching_result_with_best_match import FunctionMatchingResultWithBestMatch +from revengai.models.function_match import FunctionMatch -class TestFunctionMatchingResultWithBestMatch(unittest.TestCase): - """FunctionMatchingResultWithBestMatch unit test stubs""" +class TestFunctionMatch(unittest.TestCase): + """FunctionMatch unit test stubs""" def setUp(self): pass @@ -24,16 +24,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> FunctionMatchingResultWithBestMatch: - """Test FunctionMatchingResultWithBestMatch + def make_instance(self, include_optional) -> FunctionMatch: + """Test FunctionMatch 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 `FunctionMatchingResultWithBestMatch` + # uncomment below to create an instance of `FunctionMatch` """ - model = FunctionMatchingResultWithBestMatch() + model = FunctionMatch() if include_optional: - return FunctionMatchingResultWithBestMatch( + return FunctionMatch( function_id = 56, matched_functions = [ revengai.models.matched_function.MatchedFunction( @@ -56,7 +56,7 @@ def make_instance(self, include_optional) -> FunctionMatchingResultWithBestMatch ] ) else: - return FunctionMatchingResultWithBestMatch( + return FunctionMatch( function_id = 56, matched_functions = [ revengai.models.matched_function.MatchedFunction( @@ -75,8 +75,8 @@ def make_instance(self, include_optional) -> FunctionMatchingResultWithBestMatch ) """ - def testFunctionMatchingResultWithBestMatch(self): - """Test FunctionMatchingResultWithBestMatch""" + def testFunctionMatch(self): + """Test FunctionMatch""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_function_matching_batch_response.py b/test/test_function_matching_response.py similarity index 76% rename from test/test_function_matching_batch_response.py rename to test/test_function_matching_response.py index cd44770..82061ce 100644 --- a/test/test_function_matching_batch_response.py +++ b/test/test_function_matching_response.py @@ -13,10 +13,10 @@ import unittest -from revengai.models.function_matching_batch_response import FunctionMatchingBatchResponse +from revengai.models.function_matching_response import FunctionMatchingResponse -class TestFunctionMatchingBatchResponse(unittest.TestCase): - """FunctionMatchingBatchResponse unit test stubs""" +class TestFunctionMatchingResponse(unittest.TestCase): + """FunctionMatchingResponse unit test stubs""" def setUp(self): pass @@ -24,16 +24,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> FunctionMatchingBatchResponse: - """Test FunctionMatchingBatchResponse + def make_instance(self, include_optional) -> FunctionMatchingResponse: + """Test FunctionMatchingResponse 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 `FunctionMatchingBatchResponse` + # uncomment below to create an instance of `FunctionMatchingResponse` """ - model = FunctionMatchingBatchResponse() + model = FunctionMatchingResponse() if include_optional: - return FunctionMatchingBatchResponse( + return FunctionMatchingResponse( progress = 56, status = '', total_time = 56, @@ -41,7 +41,7 @@ def make_instance(self, include_optional) -> FunctionMatchingBatchResponse: current_page = 56, total_pages = 56, matches = [ - revengai.models.function_matching_result_with_best_match.FunctionMatchingResultWithBestMatch( + revengai.models.function_match.FunctionMatch( function_id = 56, matched_functions = [ revengai.models.matched_function.MatchedFunction( @@ -62,15 +62,18 @@ def make_instance(self, include_optional) -> FunctionMatchingBatchResponse: name = '', confidence = 0.0, ) ], ) - ] + ], + num_matches = 56, + num_debug_matches = 56, + updated_at = '' ) else: - return FunctionMatchingBatchResponse( + return FunctionMatchingResponse( ) """ - def testFunctionMatchingBatchResponse(self): - """Test FunctionMatchingBatchResponse""" + def testFunctionMatchingResponse(self): + """Test FunctionMatchingResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True)