From 0d0c2b6501703cab872c2490ec2626747799b825 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 19 Dec 2025 06:12:12 +0000 Subject: [PATCH] Update SDK to version v2.74.0 - Generated from OpenAPI spec version v2.74.0 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 4 +-- docs/AnalysisFunctionMatchingRequest.md | 1 + docs/AuthenticationUsersApi.md | 6 ++--- docs/AutoUnstripRequest.md | 1 + ...sponse.md => BaseResponseGetMeResponse.md} | 18 ++++++------- docs/FunctionMatchingRequest.md | 1 + docs/{GetUserResponse.md => GetMeResponse.md} | 17 ++++++------ revengai/__init__.py | 10 +++---- revengai/api/authentication_users_api.py | 12 ++++----- revengai/api_client.py | 2 +- revengai/configuration.py | 4 +-- revengai/models/__init__.py | 4 +-- .../analysis_function_matching_request.py | 6 +++-- revengai/models/auto_unstrip_request.py | 6 +++-- ...se.py => base_response_get_me_response.py} | 14 +++++----- revengai/models/function_matching_request.py | 6 +++-- ...et_user_response.py => get_me_response.py} | 23 +++++++++++----- ...test_analysis_function_matching_request.py | 3 ++- test/test_auto_unstrip_request.py | 3 ++- ... => test_base_response_get_me_response.py} | 27 ++++++++++--------- test/test_function_matching_request.py | 3 ++- ...er_response.py => test_get_me_response.py} | 26 +++++++++--------- 23 files changed, 112 insertions(+), 87 deletions(-) rename docs/{BaseResponseGetUserResponse.md => BaseResponseGetMeResponse.md} (51%) rename docs/{GetUserResponse.md => GetMeResponse.md} (60%) rename revengai/models/{base_response_get_user_response.py => base_response_get_me_response.py} (90%) rename revengai/models/{get_user_response.py => get_me_response.py} (79%) rename test/{test_base_response_get_user_response.py => test_base_response_get_me_response.py} (73%) rename test/{test_get_user_response.py => test_get_me_response.py} (70%) diff --git a/.sdk-version b/.sdk-version index 0d06862..9526e67 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.70.0 +v2.74.0 diff --git a/README.md b/README.md index ee8e440..a0d5223 100644 --- a/README.md +++ b/README.md @@ -217,8 +217,8 @@ Class | Method | HTTP request | Description - [BaseResponseGenerationStatusList](docs/BaseResponseGenerationStatusList.md) - [BaseResponseGetAiDecompilationRatingResponse](docs/BaseResponseGetAiDecompilationRatingResponse.md) - [BaseResponseGetAiDecompilationTask](docs/BaseResponseGetAiDecompilationTask.md) + - [BaseResponseGetMeResponse](docs/BaseResponseGetMeResponse.md) - [BaseResponseGetPublicUserResponse](docs/BaseResponseGetPublicUserResponse.md) - - [BaseResponseGetUserResponse](docs/BaseResponseGetUserResponse.md) - [BaseResponseListCollectionResults](docs/BaseResponseListCollectionResults.md) - [BaseResponseListCommentResponse](docs/BaseResponseListCommentResponse.md) - [BaseResponseListDieMatch](docs/BaseResponseListDieMatch.md) @@ -345,8 +345,8 @@ Class | Method | HTTP request | Description - [GenerationStatusList](docs/GenerationStatusList.md) - [GetAiDecompilationRatingResponse](docs/GetAiDecompilationRatingResponse.md) - [GetAiDecompilationTask](docs/GetAiDecompilationTask.md) + - [GetMeResponse](docs/GetMeResponse.md) - [GetPublicUserResponse](docs/GetPublicUserResponse.md) - - [GetUserResponse](docs/GetUserResponse.md) - [GlobalVariable](docs/GlobalVariable.md) - [ISA](docs/ISA.md) - [IconModel](docs/IconModel.md) diff --git a/docs/AnalysisFunctionMatchingRequest.md b/docs/AnalysisFunctionMatchingRequest.md index 6246b4c..d14ad97 100644 --- a/docs/AnalysisFunctionMatchingRequest.md +++ b/docs/AnalysisFunctionMatchingRequest.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **page_size** | **int** | Number of functions to return per page, default is 0 (all functions), max is 1000 | [optional] [default to 0] **status_only** | **bool** | If set to true, only returns the status of the matching operation without the actual results | [optional] [default to False] **no_cache** | **bool** | If set to true, forces the system to bypass any cached results and perform a fresh computation | [optional] [default to False] +**use_canonical_names** | **bool** | Whether to use canonical function names during function matching for confidence results, default is False | [optional] [default to False] ## Example diff --git a/docs/AuthenticationUsersApi.md b/docs/AuthenticationUsersApi.md index 76e6cdd..36d5d73 100644 --- a/docs/AuthenticationUsersApi.md +++ b/docs/AuthenticationUsersApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **get_requester_user_info** -> BaseResponseGetUserResponse get_requester_user_info() +> BaseResponseGetMeResponse get_requester_user_info() Get the requesters user information @@ -22,7 +22,7 @@ Get the requesters user information ```python import revengai -from revengai.models.base_response_get_user_response import BaseResponseGetUserResponse +from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse from revengai.rest import ApiException from pprint import pprint @@ -65,7 +65,7 @@ This endpoint does not need any parameter. ### Return type -[**BaseResponseGetUserResponse**](BaseResponseGetUserResponse.md) +[**BaseResponseGetMeResponse**](BaseResponseGetMeResponse.md) ### Authorization diff --git a/docs/AutoUnstripRequest.md b/docs/AutoUnstripRequest.md index 9487aea..731818f 100644 --- a/docs/AutoUnstripRequest.md +++ b/docs/AutoUnstripRequest.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **min_group_size** | **int** | Minimum number of matching functions required to consider for a match, default is 10 | [optional] [default to 10] **status_only** | **bool** | If set to true, only returns the status of the auto-unstrip operation without the actual results | [optional] [default to False] **no_cache** | **bool** | If set to true, forces the system to bypass any cached results and perform a fresh computation | [optional] [default to False] +**use_canonical_names** | **bool** | Whether to use canonical function names during matching for auto-unstrip, default is False | [optional] [default to False] ## Example diff --git a/docs/BaseResponseGetUserResponse.md b/docs/BaseResponseGetMeResponse.md similarity index 51% rename from docs/BaseResponseGetUserResponse.md rename to docs/BaseResponseGetMeResponse.md index 5f8ce01..da9a532 100644 --- a/docs/BaseResponseGetUserResponse.md +++ b/docs/BaseResponseGetMeResponse.md @@ -1,4 +1,4 @@ -# BaseResponseGetUserResponse +# BaseResponseGetMeResponse ## Properties @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **bool** | Response status on whether the request succeeded | [optional] [default to True] -**data** | [**GetUserResponse**](GetUserResponse.md) | | [optional] +**data** | [**GetMeResponse**](GetMeResponse.md) | | [optional] **message** | **str** | | [optional] **errors** | [**List[ErrorModel]**](ErrorModel.md) | | [optional] **meta** | [**MetaModel**](MetaModel.md) | Metadata | [optional] @@ -14,19 +14,19 @@ Name | Type | Description | Notes ## Example ```python -from revengai.models.base_response_get_user_response import BaseResponseGetUserResponse +from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse # TODO update the JSON string below json = "{}" -# create an instance of BaseResponseGetUserResponse from a JSON string -base_response_get_user_response_instance = BaseResponseGetUserResponse.from_json(json) +# create an instance of BaseResponseGetMeResponse from a JSON string +base_response_get_me_response_instance = BaseResponseGetMeResponse.from_json(json) # print the JSON string representation of the object -print(BaseResponseGetUserResponse.to_json()) +print(BaseResponseGetMeResponse.to_json()) # convert the object into a dict -base_response_get_user_response_dict = base_response_get_user_response_instance.to_dict() -# create an instance of BaseResponseGetUserResponse from a dict -base_response_get_user_response_from_dict = BaseResponseGetUserResponse.from_dict(base_response_get_user_response_dict) +base_response_get_me_response_dict = base_response_get_me_response_instance.to_dict() +# create an instance of BaseResponseGetMeResponse from a dict +base_response_get_me_response_from_dict = BaseResponseGetMeResponse.from_dict(base_response_get_me_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/FunctionMatchingRequest.md b/docs/FunctionMatchingRequest.md index f75bb47..6eba45f 100644 --- a/docs/FunctionMatchingRequest.md +++ b/docs/FunctionMatchingRequest.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **page_size** | **int** | Number of functions to return per page, default is 0 (all functions), max is 1000 | [optional] [default to 0] **status_only** | **bool** | If set to true, only returns the status of the matching operation without the actual results | [optional] [default to False] **no_cache** | **bool** | If set to true, forces the system to bypass any cached results and perform a fresh computation | [optional] [default to False] +**use_canonical_names** | **bool** | Whether to use canonical function names during function matching for confidence results, default is False | [optional] [default to False] ## Example diff --git a/docs/GetUserResponse.md b/docs/GetMeResponse.md similarity index 60% rename from docs/GetUserResponse.md rename to docs/GetMeResponse.md index f2546bd..a855e5c 100644 --- a/docs/GetUserResponse.md +++ b/docs/GetMeResponse.md @@ -1,4 +1,4 @@ -# GetUserResponse +# GetMeResponse ## Properties @@ -12,23 +12,24 @@ Name | Type | Description | Notes **email** | **str** | | **creation** | **datetime** | | **tutorial_seen** | **bool** | | +**role** | **str** | | ## Example ```python -from revengai.models.get_user_response import GetUserResponse +from revengai.models.get_me_response import GetMeResponse # TODO update the JSON string below json = "{}" -# create an instance of GetUserResponse from a JSON string -get_user_response_instance = GetUserResponse.from_json(json) +# create an instance of GetMeResponse from a JSON string +get_me_response_instance = GetMeResponse.from_json(json) # print the JSON string representation of the object -print(GetUserResponse.to_json()) +print(GetMeResponse.to_json()) # convert the object into a dict -get_user_response_dict = get_user_response_instance.to_dict() -# create an instance of GetUserResponse from a dict -get_user_response_from_dict = GetUserResponse.from_dict(get_user_response_dict) +get_me_response_dict = get_me_response_instance.to_dict() +# create an instance of GetMeResponse from a dict +get_me_response_from_dict = GetMeResponse.from_dict(get_me_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 26791f9..f813835 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v2.70.0" +__version__ = "v2.74.0" # Define package exports __all__ = [ @@ -115,8 +115,8 @@ "BaseResponseGenerationStatusList", "BaseResponseGetAiDecompilationRatingResponse", "BaseResponseGetAiDecompilationTask", + "BaseResponseGetMeResponse", "BaseResponseGetPublicUserResponse", - "BaseResponseGetUserResponse", "BaseResponseListCollectionResults", "BaseResponseListCommentResponse", "BaseResponseListDieMatch", @@ -243,8 +243,8 @@ "GenerationStatusList", "GetAiDecompilationRatingResponse", "GetAiDecompilationTask", + "GetMeResponse", "GetPublicUserResponse", - "GetUserResponse", "GlobalVariable", "ISA", "IconModel", @@ -432,8 +432,8 @@ from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList as BaseResponseGenerationStatusList from revengai.models.base_response_get_ai_decompilation_rating_response import BaseResponseGetAiDecompilationRatingResponse as BaseResponseGetAiDecompilationRatingResponse 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_get_user_response import BaseResponseGetUserResponse as BaseResponseGetUserResponse 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 @@ -560,8 +560,8 @@ from revengai.models.generation_status_list import GenerationStatusList as GenerationStatusList from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse as GetAiDecompilationRatingResponse from revengai.models.get_ai_decompilation_task import GetAiDecompilationTask as GetAiDecompilationTask +from revengai.models.get_me_response import GetMeResponse as GetMeResponse from revengai.models.get_public_user_response import GetPublicUserResponse as GetPublicUserResponse -from revengai.models.get_user_response import GetUserResponse as GetUserResponse from revengai.models.global_variable import GlobalVariable as GlobalVariable from revengai.models.isa import ISA as ISA from revengai.models.icon_model import IconModel as IconModel diff --git a/revengai/api/authentication_users_api.py b/revengai/api/authentication_users_api.py index e2de7e3..aca0aa9 100644 --- a/revengai/api/authentication_users_api.py +++ b/revengai/api/authentication_users_api.py @@ -16,8 +16,8 @@ from typing_extensions import Annotated from pydantic import StrictInt +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_get_user_response import BaseResponseGetUserResponse from revengai.models.base_response_list_comment_response import BaseResponseListCommentResponse from revengai.models.base_response_list_user_activity_response import BaseResponseListUserActivityResponse from revengai.models.base_response_login_response import BaseResponseLoginResponse @@ -56,7 +56,7 @@ def get_requester_user_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseGetUserResponse: + ) -> BaseResponseGetMeResponse: """Get the requesters user information @@ -90,7 +90,7 @@ def get_requester_user_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetUserResponse", + '200': "BaseResponseGetMeResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -119,7 +119,7 @@ def get_requester_user_info_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[BaseResponseGetUserResponse]: + ) -> ApiResponse[BaseResponseGetMeResponse]: """Get the requesters user information @@ -153,7 +153,7 @@ def get_requester_user_info_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetUserResponse", + '200': "BaseResponseGetMeResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -216,7 +216,7 @@ def get_requester_user_info_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseGetUserResponse", + '200': "BaseResponseGetMeResponse", '422': "BaseResponse", } response_data = self.api_client.call_api( diff --git a/revengai/api_client.py b/revengai/api_client.py index 0cefdda..fad501a 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.70.0/python' + self.user_agent = 'OpenAPI-Generator/v2.74.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 0a77b33..9163342 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.70.0\n"\ - "SDK Package Version: v2.70.0".\ + "Version of the API: v2.74.0\n"\ + "SDK Package Version: v2.74.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 33a1c7d..70bef82 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -83,8 +83,8 @@ from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList from revengai.models.base_response_get_ai_decompilation_rating_response import BaseResponseGetAiDecompilationRatingResponse 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_get_user_response import BaseResponseGetUserResponse 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 @@ -211,8 +211,8 @@ from revengai.models.generation_status_list import GenerationStatusList from revengai.models.get_ai_decompilation_rating_response import GetAiDecompilationRatingResponse from revengai.models.get_ai_decompilation_task import GetAiDecompilationTask +from revengai.models.get_me_response import GetMeResponse from revengai.models.get_public_user_response import GetPublicUserResponse -from revengai.models.get_user_response import GetUserResponse from revengai.models.global_variable import GlobalVariable from revengai.models.isa import ISA from revengai.models.icon_model import IconModel diff --git a/revengai/models/analysis_function_matching_request.py b/revengai/models/analysis_function_matching_request.py index e7dfaa9..f2def4b 100644 --- a/revengai/models/analysis_function_matching_request.py +++ b/revengai/models/analysis_function_matching_request.py @@ -34,7 +34,8 @@ class AnalysisFunctionMatchingRequest(BaseModel): page_size: Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]] = Field(default=0, description="Number of functions to return per page, default is 0 (all functions), max is 1000") status_only: Optional[StrictBool] = Field(default=False, description="If set to true, only returns the status of the matching operation without the actual results") no_cache: Optional[StrictBool] = Field(default=False, description="If set to true, forces the system to bypass any cached results and perform a fresh computation") - __properties: ClassVar[List[str]] = ["min_similarity", "filters", "results_per_function", "page", "page_size", "status_only", "no_cache"] + use_canonical_names: Optional[StrictBool] = Field(default=False, description="Whether to use canonical function names during function matching for confidence results, default is False") + __properties: ClassVar[List[str]] = ["min_similarity", "filters", "results_per_function", "page", "page_size", "status_only", "no_cache", "use_canonical_names"] model_config = ConfigDict( populate_by_name=True, @@ -101,7 +102,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "page": obj.get("page") if obj.get("page") is not None else 1, "page_size": obj.get("page_size") if obj.get("page_size") is not None else 0, "status_only": obj.get("status_only") if obj.get("status_only") is not None else False, - "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False + "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False, + "use_canonical_names": obj.get("use_canonical_names") if obj.get("use_canonical_names") is not None else False }) return _obj diff --git a/revengai/models/auto_unstrip_request.py b/revengai/models/auto_unstrip_request.py index 68e5754..2e6e5d4 100644 --- a/revengai/models/auto_unstrip_request.py +++ b/revengai/models/auto_unstrip_request.py @@ -32,7 +32,8 @@ class AutoUnstripRequest(BaseModel): min_group_size: Optional[Annotated[int, Field(le=20, strict=True, ge=1)]] = Field(default=10, description="Minimum number of matching functions required to consider for a match, default is 10") status_only: Optional[StrictBool] = Field(default=False, description="If set to true, only returns the status of the auto-unstrip operation without the actual results") no_cache: Optional[StrictBool] = Field(default=False, description="If set to true, forces the system to bypass any cached results and perform a fresh computation") - __properties: ClassVar[List[str]] = ["min_similarity", "apply", "confidence_threshold", "min_group_size", "status_only", "no_cache"] + use_canonical_names: Optional[StrictBool] = Field(default=False, description="Whether to use canonical function names during matching for auto-unstrip, default is False") + __properties: ClassVar[List[str]] = ["min_similarity", "apply", "confidence_threshold", "min_group_size", "status_only", "no_cache", "use_canonical_names"] model_config = ConfigDict( populate_by_name=True, @@ -90,7 +91,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "confidence_threshold": obj.get("confidence_threshold") if obj.get("confidence_threshold") is not None else 90.0, "min_group_size": obj.get("min_group_size") if obj.get("min_group_size") is not None else 10, "status_only": obj.get("status_only") if obj.get("status_only") is not None else False, - "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False + "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False, + "use_canonical_names": obj.get("use_canonical_names") if obj.get("use_canonical_names") is not None else False }) return _obj diff --git a/revengai/models/base_response_get_user_response.py b/revengai/models/base_response_get_me_response.py similarity index 90% rename from revengai/models/base_response_get_user_response.py rename to revengai/models/base_response_get_me_response.py index f1814dc..b61fc58 100644 --- a/revengai/models/base_response_get_user_response.py +++ b/revengai/models/base_response_get_me_response.py @@ -19,17 +19,17 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from revengai.models.error_model import ErrorModel -from revengai.models.get_user_response import GetUserResponse +from revengai.models.get_me_response import GetMeResponse from revengai.models.meta_model import MetaModel from typing import Optional, Set from typing_extensions import Self -class BaseResponseGetUserResponse(BaseModel): +class BaseResponseGetMeResponse(BaseModel): """ - BaseResponseGetUserResponse + BaseResponseGetMeResponse """ # noqa: E501 status: Optional[StrictBool] = Field(default=True, description="Response status on whether the request succeeded") - data: Optional[GetUserResponse] = None + data: Optional[GetMeResponse] = None message: Optional[StrictStr] = None errors: Optional[List[ErrorModel]] = None meta: Optional[MetaModel] = Field(default=None, description="Metadata") @@ -53,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BaseResponseGetUserResponse from a JSON string""" + """Create an instance of BaseResponseGetMeResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -106,7 +106,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseResponseGetUserResponse from a dict""" + """Create an instance of BaseResponseGetMeResponse from a dict""" if obj is None: return None @@ -115,7 +115,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "status": obj.get("status") if obj.get("status") is not None else True, - "data": GetUserResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, + "data": GetMeResponse.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 diff --git a/revengai/models/function_matching_request.py b/revengai/models/function_matching_request.py index f5d9d03..8965510 100644 --- a/revengai/models/function_matching_request.py +++ b/revengai/models/function_matching_request.py @@ -36,7 +36,8 @@ class FunctionMatchingRequest(BaseModel): page_size: Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]] = Field(default=0, description="Number of functions to return per page, default is 0 (all functions), max is 1000") status_only: Optional[StrictBool] = Field(default=False, description="If set to true, only returns the status of the matching operation without the actual results") no_cache: Optional[StrictBool] = Field(default=False, description="If set to true, forces the system to bypass any cached results and perform a fresh computation") - __properties: ClassVar[List[str]] = ["model_id", "function_ids", "min_similarity", "filters", "results_per_function", "page", "page_size", "status_only", "no_cache"] + use_canonical_names: Optional[StrictBool] = Field(default=False, description="Whether to use canonical function names during function matching for confidence results, default is False") + __properties: ClassVar[List[str]] = ["model_id", "function_ids", "min_similarity", "filters", "results_per_function", "page", "page_size", "status_only", "no_cache", "use_canonical_names"] model_config = ConfigDict( populate_by_name=True, @@ -105,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "page": obj.get("page") if obj.get("page") is not None else 1, "page_size": obj.get("page_size") if obj.get("page_size") is not None else 0, "status_only": obj.get("status_only") if obj.get("status_only") is not None else False, - "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False + "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False, + "use_canonical_names": obj.get("use_canonical_names") if obj.get("use_canonical_names") is not None else False }) return _obj diff --git a/revengai/models/get_user_response.py b/revengai/models/get_me_response.py similarity index 79% rename from revengai/models/get_user_response.py rename to revengai/models/get_me_response.py index 2b0a373..cc93a40 100644 --- a/revengai/models/get_user_response.py +++ b/revengai/models/get_me_response.py @@ -17,14 +17,14 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class GetUserResponse(BaseModel): +class GetMeResponse(BaseModel): """ - GetUserResponse + GetMeResponse """ # noqa: E501 username: StrictStr user_id: StrictInt @@ -33,7 +33,15 @@ class GetUserResponse(BaseModel): email: StrictStr creation: datetime tutorial_seen: StrictBool - __properties: ClassVar[List[str]] = ["username", "user_id", "first_name", "last_name", "email", "creation", "tutorial_seen"] + role: StrictStr + __properties: ClassVar[List[str]] = ["username", "user_id", "first_name", "last_name", "email", "creation", "tutorial_seen", "role"] + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['USER', 'ADMIN', 'SUPERADMIN', 'SYSTEM']): + raise ValueError("must be one of enum values ('USER', 'ADMIN', 'SUPERADMIN', 'SYSTEM')") + return value model_config = ConfigDict( populate_by_name=True, @@ -53,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GetUserResponse from a JSON string""" + """Create an instance of GetMeResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -78,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetUserResponse from a dict""" + """Create an instance of GetMeResponse from a dict""" if obj is None: return None @@ -92,7 +100,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "last_name": obj.get("last_name"), "email": obj.get("email"), "creation": obj.get("creation"), - "tutorial_seen": obj.get("tutorial_seen") + "tutorial_seen": obj.get("tutorial_seen"), + "role": obj.get("role") }) return _obj diff --git a/test/test_analysis_function_matching_request.py b/test/test_analysis_function_matching_request.py index 02a5bc1..c6e2deb 100644 --- a/test/test_analysis_function_matching_request.py +++ b/test/test_analysis_function_matching_request.py @@ -52,7 +52,8 @@ def make_instance(self, include_optional) -> AnalysisFunctionMatchingRequest: page = 1.0, page_size = 0.0, status_only = True, - no_cache = True + no_cache = True, + use_canonical_names = True ) else: return AnalysisFunctionMatchingRequest( diff --git a/test/test_auto_unstrip_request.py b/test/test_auto_unstrip_request.py index f221093..613feaa 100644 --- a/test/test_auto_unstrip_request.py +++ b/test/test_auto_unstrip_request.py @@ -39,7 +39,8 @@ def make_instance(self, include_optional) -> AutoUnstripRequest: confidence_threshold = 0.0, min_group_size = 1.0, status_only = True, - no_cache = True + no_cache = True, + use_canonical_names = True ) else: return AutoUnstripRequest( diff --git a/test/test_base_response_get_user_response.py b/test/test_base_response_get_me_response.py similarity index 73% rename from test/test_base_response_get_user_response.py rename to test/test_base_response_get_me_response.py index 4f88c6a..1056a64 100644 --- a/test/test_base_response_get_user_response.py +++ b/test/test_base_response_get_me_response.py @@ -13,10 +13,10 @@ import unittest -from revengai.models.base_response_get_user_response import BaseResponseGetUserResponse +from revengai.models.base_response_get_me_response import BaseResponseGetMeResponse -class TestBaseResponseGetUserResponse(unittest.TestCase): - """BaseResponseGetUserResponse unit test stubs""" +class TestBaseResponseGetMeResponse(unittest.TestCase): + """BaseResponseGetMeResponse unit test stubs""" def setUp(self): pass @@ -24,25 +24,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BaseResponseGetUserResponse: - """Test BaseResponseGetUserResponse + def make_instance(self, include_optional) -> BaseResponseGetMeResponse: + """Test BaseResponseGetMeResponse 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 `BaseResponseGetUserResponse` + # uncomment below to create an instance of `BaseResponseGetMeResponse` """ - model = BaseResponseGetUserResponse() + model = BaseResponseGetMeResponse() if include_optional: - return BaseResponseGetUserResponse( + return BaseResponseGetMeResponse( status = True, - data = revengai.models.get_user_response.GetUserResponse( + data = revengai.models.get_me_response.GetMeResponse( username = '', user_id = 56, first_name = '', last_name = '', email = '', creation = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - tutorial_seen = True, ), + tutorial_seen = True, + role = 'USER', ), message = '', errors = [ revengai.models.error_model.ErrorModel( @@ -56,12 +57,12 @@ def make_instance(self, include_optional) -> BaseResponseGetUserResponse: has_next_page = True, ), ) ) else: - return BaseResponseGetUserResponse( + return BaseResponseGetMeResponse( ) """ - def testBaseResponseGetUserResponse(self): - """Test BaseResponseGetUserResponse""" + def testBaseResponseGetMeResponse(self): + """Test BaseResponseGetMeResponse""" # 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_request.py b/test/test_function_matching_request.py index d785e14..59870f3 100644 --- a/test/test_function_matching_request.py +++ b/test/test_function_matching_request.py @@ -56,7 +56,8 @@ def make_instance(self, include_optional) -> FunctionMatchingRequest: page = 1.0, page_size = 0.0, status_only = True, - no_cache = True + no_cache = True, + use_canonical_names = True ) else: return FunctionMatchingRequest( diff --git a/test/test_get_user_response.py b/test/test_get_me_response.py similarity index 70% rename from test/test_get_user_response.py rename to test/test_get_me_response.py index 47e8d9f..7a8e7cb 100644 --- a/test/test_get_user_response.py +++ b/test/test_get_me_response.py @@ -13,10 +13,10 @@ import unittest -from revengai.models.get_user_response import GetUserResponse +from revengai.models.get_me_response import GetMeResponse -class TestGetUserResponse(unittest.TestCase): - """GetUserResponse unit test stubs""" +class TestGetMeResponse(unittest.TestCase): + """GetMeResponse unit test stubs""" def setUp(self): pass @@ -24,26 +24,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> GetUserResponse: - """Test GetUserResponse + def make_instance(self, include_optional) -> GetMeResponse: + """Test GetMeResponse 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 `GetUserResponse` + # uncomment below to create an instance of `GetMeResponse` """ - model = GetUserResponse() + model = GetMeResponse() if include_optional: - return GetUserResponse( + return GetMeResponse( username = '', user_id = 56, first_name = '', last_name = '', email = '', creation = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - tutorial_seen = True + tutorial_seen = True, + role = 'USER' ) else: - return GetUserResponse( + return GetMeResponse( username = '', user_id = 56, first_name = '', @@ -51,11 +52,12 @@ def make_instance(self, include_optional) -> GetUserResponse: email = '', creation = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), tutorial_seen = True, + role = 'USER', ) """ - def testGetUserResponse(self): - """Test GetUserResponse""" + def testGetMeResponse(self): + """Test GetMeResponse""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True)