diff --git a/.sdk-version b/.sdk-version index b79e975..3d5a70b 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.118.9 +v3.123.0 diff --git a/docs/AnalysisFunctionEntry.md b/docs/AnalysisFunctionEntry.md index 28aef39..60ab5e4 100644 --- a/docs/AnalysisFunctionEntry.md +++ b/docs/AnalysisFunctionEntry.md @@ -12,7 +12,9 @@ Name | Type | Description | Notes **function_size** | **int** | | **function_vaddr** | **int** | | **mangled_name** | **str** | | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, if any | [optional] **source_binary_id** | **int** | | [optional] +**source_function_id** | **int** | ID of the source function this name was transferred from, if any | [optional] **source_type** | **str** | | ## Example diff --git a/docs/AppApiRestV2CollectionsEnumsOrderBy.md b/docs/AppApiRestV2CollectionsEnumsOrderBy.md index 5235990..cfa0dca 100644 --- a/docs/AppApiRestV2CollectionsEnumsOrderBy.md +++ b/docs/AppApiRestV2CollectionsEnumsOrderBy.md @@ -7,8 +7,6 @@ * `COLLECTION` (value: `'collection'`) -* `MODEL` (value: `'model'`) - * `OWNER` (value: `'owner'`) * `COLLECTION_SIZE` (value: `'collection_size'`) diff --git a/docs/CollectionCreateRequest.md b/docs/CollectionCreateRequest.md index b2f2d67..54bf0e3 100644 --- a/docs/CollectionCreateRequest.md +++ b/docs/CollectionCreateRequest.md @@ -10,7 +10,6 @@ Name | Type | Description | Notes **collection_scope** | [**CollectionScope**](CollectionScope.md) | | [optional] **tags** | **List[str]** | | [optional] **binaries** | **List[int]** | | [optional] -**model_id** | **int** | | ## Example diff --git a/docs/CollectionListItem.md b/docs/CollectionListItem.md index ca70790..62cedfc 100644 --- a/docs/CollectionListItem.md +++ b/docs/CollectionListItem.md @@ -14,7 +14,6 @@ Name | Type | Description | Notes **collection_size** | **int** | The size of the collection | **collection_id** | **int** | The ID of the collection | **creation** | **datetime** | The datetime of when the collection was created | -**model_name** | **str** | The model being used for the collection | **team_id** | **int** | | [optional] ## Example diff --git a/docs/CollectionListItemBody.md b/docs/CollectionListItemBody.md index b761e3e..eb68e62 100644 --- a/docs/CollectionListItemBody.md +++ b/docs/CollectionListItemBody.md @@ -13,9 +13,9 @@ Name | Type | Description | Notes **collection_tags** | **List[str]** | | **creation** | **datetime** | | **description** | **str** | | -**model_name** | **str** | | **official_collection** | **bool** | | **team_id** | **int** | | +**updated_at** | **datetime** | | ## Example diff --git a/docs/CollectionResponse.md b/docs/CollectionResponse.md index 4d22410..ba43f1e 100644 --- a/docs/CollectionResponse.md +++ b/docs/CollectionResponse.md @@ -8,7 +8,6 @@ Name | Type | Description | Notes **collection_id** | **int** | Collection ID | **collection_name** | **str** | Collection name | **description** | **str** | Collection description | -**model_id** | **int** | Collection model ID | **user_id** | **int** | Collection user ID | **team_id** | **int** | | [optional] **collection_scope** | [**CollectionScope**](CollectionScope.md) | Collection public status | diff --git a/docs/CollectionSearchResult.md b/docs/CollectionSearchResult.md index 7d990dc..533a66b 100644 --- a/docs/CollectionSearchResult.md +++ b/docs/CollectionSearchResult.md @@ -10,8 +10,6 @@ Name | Type | Description | Notes **scope** | **str** | The scope of the collection | **last_updated_at** | **datetime** | The last update date of the collection | **created_at** | **datetime** | The creation date of the collection | -**model_id** | **int** | The model ID of the binary | -**model_name** | **str** | The name of the model | **owned_by** | **str** | The owner of the collection | **tags** | **List[str]** | | [optional] **size** | **int** | | [optional] diff --git a/docs/CreateCollectionInputBody.md b/docs/CreateCollectionInputBody.md index d001742..1e455d1 100644 --- a/docs/CreateCollectionInputBody.md +++ b/docs/CreateCollectionInputBody.md @@ -9,7 +9,6 @@ Name | Type | Description | Notes **collection_name** | **str** | Collection name. | **collection_scope** | **str** | Visibility scope. | [default to 'PRIVATE'] **description** | **str** | Collection description. | -**model_id** | **int** | Model ID the collection is associated with. | **tags** | **List[str]** | Optional tags to attach to the collection. | [optional] ## Example diff --git a/docs/CreateCollectionOutputBody.md b/docs/CreateCollectionOutputBody.md index 00a7688..3e3ad71 100644 --- a/docs/CreateCollectionOutputBody.md +++ b/docs/CreateCollectionOutputBody.md @@ -11,7 +11,6 @@ Name | Type | Description | Notes **collection_scope** | **str** | | **created_at** | **datetime** | | **description** | **str** | | -**model_id** | **int** | | **tags** | **List[str]** | | [optional] **team_id** | **int** | | **updated_at** | **datetime** | | diff --git a/docs/GetCollectionOutputBody.md b/docs/GetCollectionOutputBody.md index f41d7c3..fda5eb0 100644 --- a/docs/GetCollectionOutputBody.md +++ b/docs/GetCollectionOutputBody.md @@ -12,7 +12,6 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **description** | **str** | | **has_next_page** | **bool** | | [optional] -**model_id** | **int** | | **page_number** | **int** | | [optional] **page_size** | **int** | | [optional] **tags** | **List[str]** | | [optional] diff --git a/docs/HistoryEntry.md b/docs/HistoryEntry.md index 295f6d7..dfb0f64 100644 --- a/docs/HistoryEntry.md +++ b/docs/HistoryEntry.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **history_id** | **int** | History record ID | **is_debug** | **bool** | Whether the function had debug info | **mangled_name** | **str** | Mangled function name | [optional] +**source_analysis_id** | **int** | ID of the analysis the source function belongs to, if any | [optional] +**source_function_id** | **int** | ID of the source function this name was transferred from, if any | [optional] **source_type** | **str** | Source of the rename (USER, SYSTEM, AI_UNSTRIP, etc.) | ## Example diff --git a/docs/MatchFilters.md b/docs/MatchFilters.md index ba0e959..901d73b 100644 --- a/docs/MatchFilters.md +++ b/docs/MatchFilters.md @@ -5,10 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**arch** | **str** | Restrict matches to this architecture (multi-platform models only; matches all architectures if omitted). Rejected for single-architecture models. | [optional] **binary_ids** | **List[int]** | Restrict the candidate pool to these binary IDs. | [optional] +**bits** | **int** | Restrict matches to this word size (multi-platform models only). Rejected for single-architecture models. | [optional] **collection_ids** | **List[int]** | Restrict the candidate pool to binaries in these collection IDs. | [optional] **debug_types** | **List[str]** | Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER. | [optional] **function_ids** | **List[int]** | Restrict the candidate pool to these function IDs. | [optional] +**platform** | **str** | Restrict matches to this platform (multi-platform models only; matches all platforms if omitted). Rejected for single-architecture models. | [optional] **user_ids** | **List[int]** | Restrict the candidate pool to functions owned by these user IDs. | [optional] ## Example diff --git a/docs/PatchCollectionOutputBody.md b/docs/PatchCollectionOutputBody.md index 746e860..d389346 100644 --- a/docs/PatchCollectionOutputBody.md +++ b/docs/PatchCollectionOutputBody.md @@ -11,7 +11,6 @@ Name | Type | Description | Notes **collection_scope** | **str** | | **created_at** | **datetime** | | **description** | **str** | | -**model_id** | **int** | | **team_id** | **int** | | **updated_at** | **datetime** | | **user_id** | **int** | | diff --git a/docs/SearchApi.md b/docs/SearchApi.md index 591bb0a..3a626c6 100644 --- a/docs/SearchApi.md +++ b/docs/SearchApi.md @@ -111,7 +111,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) # **search_collections** -> BaseResponseCollectionSearchResponse search_collections(page=page, page_size=page_size, partial_collection_name=partial_collection_name, partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, model_name=model_name, filters=filters, order_by=order_by, order_by_direction=order_by_direction) +> BaseResponseCollectionSearchResponse search_collections(page=page, page_size=page_size, partial_collection_name=partial_collection_name, partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, filters=filters, order_by=order_by, order_by_direction=order_by_direction) Collections search @@ -163,14 +163,13 @@ with revengai.ApiClient(configuration) as api_client: partial_binary_name = 'partial_binary_name_example' # str | The partial or full name of the binary belonging to the collection (optional) partial_binary_sha256 = 'partial_binary_sha256_example' # str | The partial or full sha256 of the binary belonging to the collection (optional) tags = ['tags_example'] # List[str] | The tags to be searched for (optional) - model_name = 'model_name_example' # str | The name of the model used to analyze the binary the function belongs to (optional) filters = [revengai.Filters()] # List[Filters] | The filters to be used for the search (optional) order_by = revengai.AppApiRestV2CollectionsEnumsOrderBy() # AppApiRestV2CollectionsEnumsOrderBy | The field to sort the order by in the results (optional) order_by_direction = revengai.Order() # Order | The order direction in which to return results (optional) try: # Collections search - api_response = api_instance.search_collections(page=page, page_size=page_size, partial_collection_name=partial_collection_name, partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, model_name=model_name, filters=filters, order_by=order_by, order_by_direction=order_by_direction) + api_response = api_instance.search_collections(page=page, page_size=page_size, partial_collection_name=partial_collection_name, partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, filters=filters, order_by=order_by, order_by_direction=order_by_direction) print("The response of SearchApi->search_collections:\n") pprint(api_response) except Exception as e: @@ -190,7 +189,6 @@ Name | Type | Description | Notes **partial_binary_name** | **str**| The partial or full name of the binary belonging to the collection | [optional] **partial_binary_sha256** | **str**| The partial or full sha256 of the binary belonging to the collection | [optional] **tags** | [**List[str]**](str.md)| The tags to be searched for | [optional] - **model_name** | **str**| The name of the model used to analyze the binary the function belongs to | [optional] **filters** | [**List[Filters]**](Filters.md)| The filters to be used for the search | [optional] **order_by** | [**AppApiRestV2CollectionsEnumsOrderBy**](.md)| The field to sort the order by in the results | [optional] **order_by_direction** | [**Order**](.md)| The order direction in which to return results | [optional] @@ -213,8 +211,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256, tags or model_name to search | - | -**404** | The model name provided does not exist | - | +**422** | You must provide at least one of the filters; partial_collection_name, partial_binary_name, partial_binary_sha256 or tags to search | - | [[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) diff --git a/revengai/__init__.py b/revengai/__init__.py index d67fae2..ce702f8 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.118.9" +__version__ = "v3.123.0" # Define package exports __all__ = [ diff --git a/revengai/api/search_api.py b/revengai/api/search_api.py index c2be914..de96f0b 100644 --- a/revengai/api/search_api.py +++ b/revengai/api/search_api.py @@ -440,7 +440,6 @@ def search_collections( partial_binary_name: Annotated[Optional[StrictStr], Field(description="The partial or full name of the binary belonging to the collection")] = None, partial_binary_sha256: Annotated[Optional[StrictStr], Field(description="The partial or full sha256 of the binary belonging to the collection")] = None, tags: Annotated[Optional[List[StrictStr]], Field(description="The tags to be searched for")] = None, - model_name: Annotated[Optional[StrictStr], Field(description="The name of the model used to analyze the binary the function belongs to")] = None, filters: Annotated[Optional[List[Filters]], Field(description="The filters to be used for the search")] = None, order_by: Annotated[Optional[AppApiRestV2CollectionsEnumsOrderBy], Field(description="The field to sort the order by in the results")] = None, order_by_direction: Annotated[Optional[Order], Field(description="The order direction in which to return results")] = None, @@ -473,8 +472,6 @@ def search_collections( :type partial_binary_sha256: str :param tags: The tags to be searched for :type tags: List[str] - :param model_name: The name of the model used to analyze the binary the function belongs to - :type model_name: str :param filters: The filters to be used for the search :type filters: List[Filters] :param order_by: The field to sort the order by in the results @@ -510,7 +507,6 @@ def search_collections( partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, - model_name=model_name, filters=filters, order_by=order_by, order_by_direction=order_by_direction, @@ -523,7 +519,6 @@ def search_collections( _response_types_map: Dict[str, Optional[str]] = { '200': "BaseResponseCollectionSearchResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -545,7 +540,6 @@ def search_collections_with_http_info( partial_binary_name: Annotated[Optional[StrictStr], Field(description="The partial or full name of the binary belonging to the collection")] = None, partial_binary_sha256: Annotated[Optional[StrictStr], Field(description="The partial or full sha256 of the binary belonging to the collection")] = None, tags: Annotated[Optional[List[StrictStr]], Field(description="The tags to be searched for")] = None, - model_name: Annotated[Optional[StrictStr], Field(description="The name of the model used to analyze the binary the function belongs to")] = None, filters: Annotated[Optional[List[Filters]], Field(description="The filters to be used for the search")] = None, order_by: Annotated[Optional[AppApiRestV2CollectionsEnumsOrderBy], Field(description="The field to sort the order by in the results")] = None, order_by_direction: Annotated[Optional[Order], Field(description="The order direction in which to return results")] = None, @@ -578,8 +572,6 @@ def search_collections_with_http_info( :type partial_binary_sha256: str :param tags: The tags to be searched for :type tags: List[str] - :param model_name: The name of the model used to analyze the binary the function belongs to - :type model_name: str :param filters: The filters to be used for the search :type filters: List[Filters] :param order_by: The field to sort the order by in the results @@ -615,7 +607,6 @@ def search_collections_with_http_info( partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, - model_name=model_name, filters=filters, order_by=order_by, order_by_direction=order_by_direction, @@ -628,7 +619,6 @@ def search_collections_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "BaseResponseCollectionSearchResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -650,7 +640,6 @@ def search_collections_without_preload_content( partial_binary_name: Annotated[Optional[StrictStr], Field(description="The partial or full name of the binary belonging to the collection")] = None, partial_binary_sha256: Annotated[Optional[StrictStr], Field(description="The partial or full sha256 of the binary belonging to the collection")] = None, tags: Annotated[Optional[List[StrictStr]], Field(description="The tags to be searched for")] = None, - model_name: Annotated[Optional[StrictStr], Field(description="The name of the model used to analyze the binary the function belongs to")] = None, filters: Annotated[Optional[List[Filters]], Field(description="The filters to be used for the search")] = None, order_by: Annotated[Optional[AppApiRestV2CollectionsEnumsOrderBy], Field(description="The field to sort the order by in the results")] = None, order_by_direction: Annotated[Optional[Order], Field(description="The order direction in which to return results")] = None, @@ -683,8 +672,6 @@ def search_collections_without_preload_content( :type partial_binary_sha256: str :param tags: The tags to be searched for :type tags: List[str] - :param model_name: The name of the model used to analyze the binary the function belongs to - :type model_name: str :param filters: The filters to be used for the search :type filters: List[Filters] :param order_by: The field to sort the order by in the results @@ -720,7 +707,6 @@ def search_collections_without_preload_content( partial_binary_name=partial_binary_name, partial_binary_sha256=partial_binary_sha256, tags=tags, - model_name=model_name, filters=filters, order_by=order_by, order_by_direction=order_by_direction, @@ -733,7 +719,6 @@ def search_collections_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "BaseResponseCollectionSearchResponse", '422': "BaseResponse", - '404': "BaseResponse", } response_data = self.api_client.call_api( *_param, @@ -750,7 +735,6 @@ def _search_collections_serialize( partial_binary_name, partial_binary_sha256, tags, - model_name, filters, order_by, order_by_direction, @@ -802,10 +786,6 @@ def _search_collections_serialize( _query_params.append(('tags', tags)) - if model_name is not None: - - _query_params.append(('model_name', model_name)) - if filters is not None: _query_params.append(('filters', filters)) diff --git a/revengai/api_client.py b/revengai/api_client.py index d1d0df8..4853a30 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.118.9/python' + self.user_agent = 'OpenAPI-Generator/v3.123.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 36f1abb..bbbfc54 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -541,8 +541,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.118.9\n"\ - "SDK Package Version: v3.118.9".\ + "Version of the API: v3.123.0\n"\ + "SDK Package Version: v3.123.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/analysis_function_entry.py b/revengai/models/analysis_function_entry.py index 5568a14..913ee13 100644 --- a/revengai/models/analysis_function_entry.py +++ b/revengai/models/analysis_function_entry.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -32,10 +32,12 @@ class AnalysisFunctionEntry(BaseModel): function_size: StrictInt function_vaddr: StrictInt mangled_name: Optional[StrictStr] = None + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, if any") source_binary_id: Optional[StrictInt] = None + source_function_id: Optional[StrictInt] = Field(default=None, description="ID of the source function this name was transferred from, if any") source_type: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binary_id", "debug", "function_id", "function_name", "function_size", "function_vaddr", "mangled_name", "source_binary_id", "source_type"] + __properties: ClassVar[List[str]] = ["binary_id", "debug", "function_id", "function_name", "function_size", "function_vaddr", "mangled_name", "source_analysis_id", "source_binary_id", "source_function_id", "source_type"] model_config = ConfigDict( populate_by_name=True, @@ -107,7 +109,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "function_size": obj.get("function_size"), "function_vaddr": obj.get("function_vaddr"), "mangled_name": obj.get("mangled_name"), + "source_analysis_id": obj.get("source_analysis_id"), "source_binary_id": obj.get("source_binary_id"), + "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) # store additional fields in additional_properties diff --git a/revengai/models/app_api_rest_v2_collections_enums_order_by.py b/revengai/models/app_api_rest_v2_collections_enums_order_by.py index bbac0a4..c2f50c4 100644 --- a/revengai/models/app_api_rest_v2_collections_enums_order_by.py +++ b/revengai/models/app_api_rest_v2_collections_enums_order_by.py @@ -27,7 +27,6 @@ class AppApiRestV2CollectionsEnumsOrderBy(str, Enum): """ CREATED = 'created' COLLECTION = 'collection' - MODEL = 'model' OWNER = 'owner' COLLECTION_SIZE = 'collection_size' UPDATED = 'updated' diff --git a/revengai/models/collection_create_request.py b/revengai/models/collection_create_request.py index 63229eb..ddb86c2 100644 --- a/revengai/models/collection_create_request.py +++ b/revengai/models/collection_create_request.py @@ -31,8 +31,7 @@ class CollectionCreateRequest(BaseModel): collection_scope: Optional[CollectionScope] = None tags: Optional[List[StrictStr]] = None binaries: Optional[List[StrictInt]] = None - model_id: StrictInt - __properties: ClassVar[List[str]] = ["collection_name", "description", "collection_scope", "tags", "binaries", "model_id"] + __properties: ClassVar[List[str]] = ["collection_name", "description", "collection_scope", "tags", "binaries"] model_config = ConfigDict( populate_by_name=True, @@ -99,8 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "description": obj.get("description"), "collection_scope": obj.get("collection_scope"), "tags": obj.get("tags"), - "binaries": obj.get("binaries"), - "model_id": obj.get("model_id") + "binaries": obj.get("binaries") }) return _obj diff --git a/revengai/models/collection_list_item.py b/revengai/models/collection_list_item.py index 697cabf..ea76f65 100644 --- a/revengai/models/collection_list_item.py +++ b/revengai/models/collection_list_item.py @@ -35,9 +35,8 @@ class CollectionListItem(BaseModel): collection_size: StrictInt = Field(description="The size of the collection") collection_id: StrictInt = Field(description="The ID of the collection") creation: datetime = Field(description="The datetime of when the collection was created") - model_name: StrictStr = Field(description="The model being used for the collection") team_id: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["collection_name", "description", "collection_scope", "collection_owner", "official_collection", "collection_tags", "collection_size", "collection_id", "creation", "model_name", "team_id"] + __properties: ClassVar[List[str]] = ["collection_name", "description", "collection_scope", "collection_owner", "official_collection", "collection_tags", "collection_size", "collection_id", "creation", "team_id"] model_config = ConfigDict( populate_by_name=True, @@ -104,7 +103,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collection_size": obj.get("collection_size"), "collection_id": obj.get("collection_id"), "creation": obj.get("creation"), - "model_name": obj.get("model_name"), "team_id": obj.get("team_id") }) return _obj diff --git a/revengai/models/collection_list_item_body.py b/revengai/models/collection_list_item_body.py index c9f29d8..90fc53a 100644 --- a/revengai/models/collection_list_item_body.py +++ b/revengai/models/collection_list_item_body.py @@ -34,11 +34,11 @@ class CollectionListItemBody(BaseModel): collection_tags: Optional[List[StrictStr]] creation: datetime description: StrictStr - model_name: StrictStr official_collection: StrictBool team_id: StrictInt + updated_at: datetime additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collection_id", "collection_name", "collection_owner", "collection_scope", "collection_size", "collection_tags", "creation", "description", "model_name", "official_collection", "team_id"] + __properties: ClassVar[List[str]] = ["collection_id", "collection_name", "collection_owner", "collection_scope", "collection_size", "collection_tags", "creation", "description", "official_collection", "team_id", "updated_at"] model_config = ConfigDict( populate_by_name=True, @@ -111,9 +111,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collection_tags": obj.get("collection_tags"), "creation": obj.get("creation"), "description": obj.get("description"), - "model_name": obj.get("model_name"), "official_collection": obj.get("official_collection"), - "team_id": obj.get("team_id") + "team_id": obj.get("team_id"), + "updated_at": obj.get("updated_at") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/revengai/models/collection_response.py b/revengai/models/collection_response.py index 58e513e..9dca686 100644 --- a/revengai/models/collection_response.py +++ b/revengai/models/collection_response.py @@ -31,7 +31,6 @@ class CollectionResponse(BaseModel): collection_id: StrictInt = Field(description="Collection ID") collection_name: StrictStr = Field(description="Collection name") description: StrictStr = Field(description="Collection description") - model_id: StrictInt = Field(description="Collection model ID") user_id: StrictInt = Field(description="Collection user ID") team_id: Optional[StrictInt] = None collection_scope: CollectionScope = Field(description="Collection public status") @@ -39,7 +38,7 @@ class CollectionResponse(BaseModel): updated_at: datetime = Field(description="Collection last update date") tags: Optional[List[StrictStr]] = None binaries: Optional[List[CollectionResponseBinariesInner]] = None - __properties: ClassVar[List[str]] = ["collection_id", "collection_name", "description", "model_id", "user_id", "team_id", "collection_scope", "created_at", "updated_at", "tags", "binaries"] + __properties: ClassVar[List[str]] = ["collection_id", "collection_name", "description", "user_id", "team_id", "collection_scope", "created_at", "updated_at", "tags", "binaries"] model_config = ConfigDict( populate_by_name=True, @@ -117,7 +116,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collection_id": obj.get("collection_id"), "collection_name": obj.get("collection_name"), "description": obj.get("description"), - "model_id": obj.get("model_id"), "user_id": obj.get("user_id"), "team_id": obj.get("team_id"), "collection_scope": obj.get("collection_scope"), diff --git a/revengai/models/collection_search_result.py b/revengai/models/collection_search_result.py index 1a7290e..33d14a6 100644 --- a/revengai/models/collection_search_result.py +++ b/revengai/models/collection_search_result.py @@ -31,14 +31,12 @@ class CollectionSearchResult(BaseModel): scope: StrictStr = Field(description="The scope of the collection") last_updated_at: datetime = Field(description="The last update date of the collection") created_at: datetime = Field(description="The creation date of the collection") - model_id: StrictInt = Field(description="The model ID of the binary") - model_name: StrictStr = Field(description="The name of the model") owned_by: StrictStr = Field(description="The owner of the collection") tags: Optional[List[StrictStr]] = None size: Optional[StrictInt] = None description: StrictStr = Field(description="The description of the collection") team_id: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["collection_id", "collection_name", "scope", "last_updated_at", "created_at", "model_id", "model_name", "owned_by", "tags", "size", "description", "team_id"] + __properties: ClassVar[List[str]] = ["collection_id", "collection_name", "scope", "last_updated_at", "created_at", "owned_by", "tags", "size", "description", "team_id"] model_config = ConfigDict( populate_by_name=True, @@ -111,8 +109,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "scope": obj.get("scope"), "last_updated_at": obj.get("last_updated_at"), "created_at": obj.get("created_at"), - "model_id": obj.get("model_id"), - "model_name": obj.get("model_name"), "owned_by": obj.get("owned_by"), "tags": obj.get("tags"), "size": obj.get("size"), diff --git a/revengai/models/create_collection_input_body.py b/revengai/models/create_collection_input_body.py index 8029bb8..2445c8e 100644 --- a/revengai/models/create_collection_input_body.py +++ b/revengai/models/create_collection_input_body.py @@ -30,10 +30,9 @@ class CreateCollectionInputBody(BaseModel): collection_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Collection name.") collection_scope: StrictStr = Field(description="Visibility scope.") description: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Collection description.") - model_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Model ID the collection is associated with.") tags: Optional[List[StrictStr]] = Field(default=None, description="Optional tags to attach to the collection.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binaries", "collection_name", "collection_scope", "description", "model_id", "tags"] + __properties: ClassVar[List[str]] = ["binaries", "collection_name", "collection_scope", "description", "tags"] @field_validator('collection_scope') def collection_scope_validate_enum(cls, value): @@ -114,7 +113,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collection_name": obj.get("collection_name"), "collection_scope": obj.get("collection_scope") if obj.get("collection_scope") is not None else 'PRIVATE', "description": obj.get("description"), - "model_id": obj.get("model_id"), "tags": obj.get("tags") }) # store additional fields in additional_properties diff --git a/revengai/models/create_collection_output_body.py b/revengai/models/create_collection_output_body.py index f678000..969edc2 100644 --- a/revengai/models/create_collection_output_body.py +++ b/revengai/models/create_collection_output_body.py @@ -33,13 +33,12 @@ class CreateCollectionOutputBody(BaseModel): collection_scope: StrictStr created_at: datetime description: StrictStr - model_id: StrictInt tags: Optional[List[StrictStr]] = None team_id: StrictInt updated_at: datetime user_id: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binaries", "collection_id", "collection_name", "collection_scope", "created_at", "description", "model_id", "tags", "team_id", "updated_at", "user_id"] + __properties: ClassVar[List[str]] = ["binaries", "collection_id", "collection_name", "collection_scope", "created_at", "description", "tags", "team_id", "updated_at", "user_id"] model_config = ConfigDict( populate_by_name=True, @@ -122,7 +121,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collection_scope": obj.get("collection_scope"), "created_at": obj.get("created_at"), "description": obj.get("description"), - "model_id": obj.get("model_id"), "tags": obj.get("tags"), "team_id": obj.get("team_id"), "updated_at": obj.get("updated_at"), diff --git a/revengai/models/get_collection_output_body.py b/revengai/models/get_collection_output_body.py index 98e2ee2..a4c6309 100644 --- a/revengai/models/get_collection_output_body.py +++ b/revengai/models/get_collection_output_body.py @@ -34,7 +34,6 @@ class GetCollectionOutputBody(BaseModel): created_at: datetime description: StrictStr has_next_page: Optional[StrictBool] = None - model_id: StrictInt page_number: Optional[StrictInt] = None page_size: Optional[StrictInt] = None tags: Optional[List[StrictStr]] = None @@ -42,7 +41,7 @@ class GetCollectionOutputBody(BaseModel): updated_at: datetime user_id: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binaries", "collection_id", "collection_name", "collection_scope", "created_at", "description", "has_next_page", "model_id", "page_number", "page_size", "tags", "team_id", "updated_at", "user_id"] + __properties: ClassVar[List[str]] = ["binaries", "collection_id", "collection_name", "collection_scope", "created_at", "description", "has_next_page", "page_number", "page_size", "tags", "team_id", "updated_at", "user_id"] model_config = ConfigDict( populate_by_name=True, @@ -126,7 +125,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created_at": obj.get("created_at"), "description": obj.get("description"), "has_next_page": obj.get("has_next_page"), - "model_id": obj.get("model_id"), "page_number": obj.get("page_number"), "page_size": obj.get("page_size"), "tags": obj.get("tags"), diff --git a/revengai/models/history_entry.py b/revengai/models/history_entry.py index a053593..7da8d43 100644 --- a/revengai/models/history_entry.py +++ b/revengai/models/history_entry.py @@ -32,9 +32,11 @@ class HistoryEntry(BaseModel): history_id: StrictInt = Field(description="History record ID") is_debug: StrictBool = Field(description="Whether the function had debug info") mangled_name: Optional[StrictStr] = Field(default=None, description="Mangled function name") + source_analysis_id: Optional[StrictInt] = Field(default=None, description="ID of the analysis the source function belongs to, if any") + source_function_id: Optional[StrictInt] = Field(default=None, description="ID of the source function this name was transferred from, if any") source_type: StrictStr = Field(description="Source of the rename (USER, SYSTEM, AI_UNSTRIP, etc.)") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["change_made_by", "created_at", "function_name", "history_id", "is_debug", "mangled_name", "source_type"] + __properties: ClassVar[List[str]] = ["change_made_by", "created_at", "function_name", "history_id", "is_debug", "mangled_name", "source_analysis_id", "source_function_id", "source_type"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +102,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "history_id": obj.get("history_id"), "is_debug": obj.get("is_debug"), "mangled_name": obj.get("mangled_name"), + "source_analysis_id": obj.get("source_analysis_id"), + "source_function_id": obj.get("source_function_id"), "source_type": obj.get("source_type") }) # store additional fields in additional_properties diff --git a/revengai/models/match_filters.py b/revengai/models/match_filters.py index 1ce6432..4ac6298 100644 --- a/revengai/models/match_filters.py +++ b/revengai/models/match_filters.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -25,13 +25,36 @@ class MatchFilters(BaseModel): """ MatchFilters """ # noqa: E501 + arch: Optional[StrictStr] = Field(default=None, description="Restrict matches to this architecture (multi-platform models only; matches all architectures if omitted). Rejected for single-architecture models.") binary_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to these binary IDs.") + bits: Optional[StrictInt] = Field(default=None, description="Restrict matches to this word size (multi-platform models only). Rejected for single-architecture models.") collection_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to binaries in these collection IDs.") debug_types: Optional[List[StrictStr]] = Field(default=None, description="Restrict matches to candidates with these debug source types. Accepted: SYSTEM, USER.") function_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to these function IDs.") + platform: Optional[StrictStr] = Field(default=None, description="Restrict matches to this platform (multi-platform models only; matches all platforms if omitted). Rejected for single-architecture models.") user_ids: Optional[List[StrictInt]] = Field(default=None, description="Restrict the candidate pool to functions owned by these user IDs.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binary_ids", "collection_ids", "debug_types", "function_ids", "user_ids"] + __properties: ClassVar[List[str]] = ["arch", "binary_ids", "bits", "collection_ids", "debug_types", "function_ids", "platform", "user_ids"] + + @field_validator('arch') + def arch_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['x86', 'arm', 'unknown', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('x86', 'arm', 'unknown', 'unknown_default_open_api')") + return value + + @field_validator('platform') + def platform_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['linux', 'windows', 'android', 'macos', 'unknown', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('linux', 'windows', 'android', 'macos', 'unknown', 'unknown_default_open_api')") + return value model_config = ConfigDict( populate_by_name=True, @@ -116,10 +139,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "arch": obj.get("arch"), "binary_ids": obj.get("binary_ids"), + "bits": obj.get("bits"), "collection_ids": obj.get("collection_ids"), "debug_types": obj.get("debug_types"), "function_ids": obj.get("function_ids"), + "platform": obj.get("platform"), "user_ids": obj.get("user_ids") }) # store additional fields in additional_properties diff --git a/revengai/models/patch_collection_output_body.py b/revengai/models/patch_collection_output_body.py index d31b044..79b15fa 100644 --- a/revengai/models/patch_collection_output_body.py +++ b/revengai/models/patch_collection_output_body.py @@ -32,12 +32,11 @@ class PatchCollectionOutputBody(BaseModel): collection_scope: StrictStr created_at: datetime description: StrictStr - model_id: StrictInt team_id: StrictInt updated_at: datetime user_id: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["binary_count", "collection_id", "collection_name", "collection_scope", "created_at", "description", "model_id", "team_id", "updated_at", "user_id"] + __properties: ClassVar[List[str]] = ["binary_count", "collection_id", "collection_name", "collection_scope", "created_at", "description", "team_id", "updated_at", "user_id"] model_config = ConfigDict( populate_by_name=True, @@ -103,7 +102,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collection_scope": obj.get("collection_scope"), "created_at": obj.get("created_at"), "description": obj.get("description"), - "model_id": obj.get("model_id"), "team_id": obj.get("team_id"), "updated_at": obj.get("updated_at"), "user_id": obj.get("user_id")