diff --git a/.sdk-version b/.sdk-version index df46356..1a924d0 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.97.0 +v3.98.0 diff --git a/README.md b/README.md index 3c96bf7..fdb0182 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,7 @@ Class | Method | HTTP request | Description - [AnalysisBulkAddTagsResponse](docs/AnalysisBulkAddTagsResponse.md) - [AnalysisBulkAddTagsResponseItem](docs/AnalysisBulkAddTagsResponseItem.md) - [AnalysisConfig](docs/AnalysisConfig.md) + - [AnalysisConfigSnapshot](docs/AnalysisConfigSnapshot.md) - [AnalysisCreateRequest](docs/AnalysisCreateRequest.md) - [AnalysisCreateResponse](docs/AnalysisCreateResponse.md) - [AnalysisDetailResponse](docs/AnalysisDetailResponse.md) diff --git a/docs/AnalysisConfig.md b/docs/AnalysisConfig.md index 540f94c..cdba700 100644 --- a/docs/AnalysisConfig.md +++ b/docs/AnalysisConfig.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **scrape_third_party_config** | [**ScrapeThirdPartyConfig**](ScrapeThirdPartyConfig.md) | Settings to scrape third party sources | [optional] **generate_cves** | **bool** | A configuration option for fetching CVEs data. | [optional] [default to False] +**analyse_functions** | **bool** | When enabled (default), runs the static AI analysis pipeline. | [optional] [default to True] **generate_sbom** | **bool** | A configuration option for generating software bill of materials data. | [optional] [default to False] **generate_capabilities** | **bool** | A configuration option for generating capabilities of a binary | [optional] [default to False] **no_cache** | **bool** | When enabled, skips using cached data within the processing. | [optional] [default to False] diff --git a/docs/AnalysisConfigSnapshot.md b/docs/AnalysisConfigSnapshot.md new file mode 100644 index 0000000..dc58c3e --- /dev/null +++ b/docs/AnalysisConfigSnapshot.md @@ -0,0 +1,34 @@ +# AnalysisConfigSnapshot + +Point-in-time record of which features an analysis was submitted with. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | **bool** | | +**sandbox** | **bool** | | +**scrape** | **bool** | | +**capabilities** | **bool** | | +**triage** | **bool** | | + +## Example + +```python +from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalysisConfigSnapshot from a JSON string +analysis_config_snapshot_instance = AnalysisConfigSnapshot.from_json(json) +# print the JSON string representation of the object +print(AnalysisConfigSnapshot.to_json()) + +# convert the object into a dict +analysis_config_snapshot_dict = analysis_config_snapshot_instance.to_dict() +# create an instance of AnalysisConfigSnapshot from a dict +analysis_config_snapshot_from_dict = AnalysisConfigSnapshot.from_dict(analysis_config_snapshot_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/AnalysisDetailResponse.md b/docs/AnalysisDetailResponse.md index 0f2ede9..94a92de 100644 --- a/docs/AnalysisDetailResponse.md +++ b/docs/AnalysisDetailResponse.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **sbom** | **Dict[str, object]** | | [optional] **sha_256_hash** | **str** | | **auto_run_agents** | [**AutoRunAgents**](AutoRunAgents.md) | | +**requested_config** | [**AnalysisConfigSnapshot**](AnalysisConfigSnapshot.md) | Snapshot of the configuration the analysis was submitted with. | ## Example diff --git a/revengai/__init__.py b/revengai/__init__.py index 0a80509..ba527e6 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.97.0" +__version__ = "v3.98.0" # Define package exports __all__ = [ @@ -66,6 +66,7 @@ "AnalysisBulkAddTagsResponse", "AnalysisBulkAddTagsResponseItem", "AnalysisConfig", + "AnalysisConfigSnapshot", "AnalysisCreateRequest", "AnalysisCreateResponse", "AnalysisDetailResponse", @@ -596,6 +597,7 @@ from revengai.models.analysis_bulk_add_tags_response import AnalysisBulkAddTagsResponse as AnalysisBulkAddTagsResponse from revengai.models.analysis_bulk_add_tags_response_item import AnalysisBulkAddTagsResponseItem as AnalysisBulkAddTagsResponseItem from revengai.models.analysis_config import AnalysisConfig as AnalysisConfig +from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot as AnalysisConfigSnapshot from revengai.models.analysis_create_request import AnalysisCreateRequest as AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse as AnalysisCreateResponse from revengai.models.analysis_detail_response import AnalysisDetailResponse as AnalysisDetailResponse diff --git a/revengai/api_client.py b/revengai/api_client.py index 0227034..408758e 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.97.0/python' + self.user_agent = 'OpenAPI-Generator/v3.98.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 528cbdf..0729196 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.97.0\n"\ - "SDK Package Version: v3.97.0".\ + "Version of the API: v3.98.0\n"\ + "SDK Package Version: v3.98.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 8181418..0e00671 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -31,6 +31,7 @@ from revengai.models.analysis_bulk_add_tags_response import AnalysisBulkAddTagsResponse from revengai.models.analysis_bulk_add_tags_response_item import AnalysisBulkAddTagsResponseItem from revengai.models.analysis_config import AnalysisConfig +from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot from revengai.models.analysis_create_request import AnalysisCreateRequest from revengai.models.analysis_create_response import AnalysisCreateResponse from revengai.models.analysis_detail_response import AnalysisDetailResponse diff --git a/revengai/models/analysis_config.py b/revengai/models/analysis_config.py index dafd4a1..2d2b6f4 100644 --- a/revengai/models/analysis_config.py +++ b/revengai/models/analysis_config.py @@ -29,12 +29,13 @@ class AnalysisConfig(BaseModel): """ # noqa: E501 scrape_third_party_config: Optional[ScrapeThirdPartyConfig] = Field(default=None, description="Settings to scrape third party sources") generate_cves: Optional[StrictBool] = Field(default=False, description="A configuration option for fetching CVEs data.") + analyse_functions: Optional[StrictBool] = Field(default=True, description="When enabled (default), runs the static AI analysis pipeline.") generate_sbom: Optional[StrictBool] = Field(default=False, description="A configuration option for generating software bill of materials data.") generate_capabilities: Optional[StrictBool] = Field(default=False, description="A configuration option for generating capabilities of a binary") no_cache: Optional[StrictBool] = Field(default=False, description="When enabled, skips using cached data within the processing.") advanced_analysis: Optional[StrictBool] = Field(default=False, description="Enables an advanced security analysis.") sandbox_config: Optional[SandboxOptions] = Field(default=None, description="Including a sandbox config enables the dynamic execution sandbox") - __properties: ClassVar[List[str]] = ["scrape_third_party_config", "generate_cves", "generate_sbom", "generate_capabilities", "no_cache", "advanced_analysis", "sandbox_config"] + __properties: ClassVar[List[str]] = ["scrape_third_party_config", "generate_cves", "analyse_functions", "generate_sbom", "generate_capabilities", "no_cache", "advanced_analysis", "sandbox_config"] model_config = ConfigDict( populate_by_name=True, @@ -95,6 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "scrape_third_party_config": ScrapeThirdPartyConfig.from_dict(obj["scrape_third_party_config"]) if obj.get("scrape_third_party_config") is not None else None, "generate_cves": obj.get("generate_cves") if obj.get("generate_cves") is not None else False, + "analyse_functions": obj.get("analyse_functions") if obj.get("analyse_functions") is not None else True, "generate_sbom": obj.get("generate_sbom") if obj.get("generate_sbom") is not None else False, "generate_capabilities": obj.get("generate_capabilities") if obj.get("generate_capabilities") is not None else False, "no_cache": obj.get("no_cache") if obj.get("no_cache") is not None else False, diff --git a/revengai/models/analysis_config_snapshot.py b/revengai/models/analysis_config_snapshot.py new file mode 100644 index 0000000..fd02868 --- /dev/null +++ b/revengai/models/analysis_config_snapshot.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AnalysisConfigSnapshot(BaseModel): + """ + Point-in-time record of which features an analysis was submitted with. + """ # noqa: E501 + functions: StrictBool + sandbox: StrictBool + scrape: StrictBool + capabilities: StrictBool + triage: StrictBool + __properties: ClassVar[List[str]] = ["functions", "sandbox", "scrape", "capabilities", "triage"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnalysisConfigSnapshot from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnalysisConfigSnapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": obj.get("functions"), + "sandbox": obj.get("sandbox"), + "scrape": obj.get("scrape"), + "capabilities": obj.get("capabilities"), + "triage": obj.get("triage") + }) + return _obj + + diff --git a/revengai/models/analysis_detail_response.py b/revengai/models/analysis_detail_response.py index f34b955..f6ae72c 100644 --- a/revengai/models/analysis_detail_response.py +++ b/revengai/models/analysis_detail_response.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from revengai.models.analysis_access_info import AnalysisAccessInfo +from revengai.models.analysis_config_snapshot import AnalysisConfigSnapshot from revengai.models.auto_run_agents import AutoRunAgents from typing import Optional, Set from typing_extensions import Self @@ -43,7 +44,8 @@ class AnalysisDetailResponse(BaseModel): sbom: Optional[Dict[str, Any]] = None sha_256_hash: StrictStr auto_run_agents: AutoRunAgents - __properties: ClassVar[List[str]] = ["access", "analysis_id", "analysis_scope", "architecture", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "sbom", "sha_256_hash", "auto_run_agents"] + requested_config: AnalysisConfigSnapshot = Field(description="Snapshot of the configuration the analysis was submitted with.") + __properties: ClassVar[List[str]] = ["access", "analysis_id", "analysis_scope", "architecture", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "dashboard_url", "debug", "model_name", "sbom", "sha_256_hash", "auto_run_agents", "requested_config"] model_config = ConfigDict( populate_by_name=True, @@ -90,6 +92,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of auto_run_agents if self.auto_run_agents: _dict['auto_run_agents'] = self.auto_run_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of requested_config + if self.requested_config: + _dict['requested_config'] = self.requested_config.to_dict() # set to None if sbom (nullable) is None # and model_fields_set contains the field if self.sbom is None and "sbom" in self.model_fields_set: @@ -122,7 +127,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "model_name": obj.get("model_name"), "sbom": obj.get("sbom"), "sha_256_hash": obj.get("sha_256_hash"), - "auto_run_agents": AutoRunAgents.from_dict(obj["auto_run_agents"]) if obj.get("auto_run_agents") is not None else None + "auto_run_agents": AutoRunAgents.from_dict(obj["auto_run_agents"]) if obj.get("auto_run_agents") is not None else None, + "requested_config": AnalysisConfigSnapshot.from_dict(obj["requested_config"]) if obj.get("requested_config") is not None else None }) return _obj