Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .sdk-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.18.1
v3.20.0
1 change: 1 addition & 0 deletions docs/AnalysisDetailResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**binary_size** | **int** | |
**binary_type** | **str** | |
**creation** | **str** | |
**dashboard_url** | **str** | URL to view this analysis in the dashboard |
**debug** | **bool** | |
**model_name** | **str** | |
**sbom** | **Dict[str, object]** | | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/NameSourceType.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**type** | **str** | The source (process) the function name came from |
**function_id** | **int** | | [optional]
**binary_id** | **int** | | [optional]
**analysis_id** | **int** | | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/RelativeBinaryResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**binary_id** | **int** | ID of the relative binary |
**analysis_id** | **int** | | [optional]
**name** | **str** | Name of the relative binary |
**sha256** | **str** | SHA256 hash of the relative binary |

Expand Down
2 changes: 1 addition & 1 deletion revengai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
""" # noqa: E501


__version__ = "v3.18.1"
__version__ = "v3.20.0"

# Define package exports
__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion revengai/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.18.1/python'
self.user_agent = 'OpenAPI-Generator/v3.20.0/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
4 changes: 2 additions & 2 deletions revengai/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.18.1\n"\
"SDK Package Version: v3.18.1".\
"Version of the API: v3.20.0\n"\
"SDK Package Version: v3.20.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self) -> List[HostSetting]:
Expand Down
6 changes: 4 additions & 2 deletions revengai/models/analysis_detail_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 revengai.models.analysis_access_info import AnalysisAccessInfo
from typing import Optional, Set
Expand All @@ -36,11 +36,12 @@ class AnalysisDetailResponse(BaseModel):
binary_size: StrictInt
binary_type: StrictStr
creation: StrictStr
dashboard_url: StrictStr = Field(description="URL to view this analysis in the dashboard")
debug: StrictBool
model_name: StrictStr
sbom: Optional[Dict[str, Any]] = None
sha_256_hash: StrictStr
__properties: ClassVar[List[str]] = ["access", "analysis_id", "analysis_scope", "architecture", "binary_dynamic", "binary_format", "binary_name", "binary_size", "binary_type", "creation", "debug", "model_name", "sbom", "sha_256_hash"]
__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"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -111,6 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"binary_size": obj.get("binary_size"),
"binary_type": obj.get("binary_type"),
"creation": obj.get("creation"),
"dashboard_url": obj.get("dashboard_url"),
"debug": obj.get("debug"),
"model_name": obj.get("model_name"),
"sbom": obj.get("sbom"),
Expand Down
11 changes: 9 additions & 2 deletions revengai/models/name_source_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class NameSourceType(BaseModel):
type: StrictStr = Field(description="The source (process) the function name came from")
function_id: Optional[StrictInt] = None
binary_id: Optional[StrictInt] = None
__properties: ClassVar[List[str]] = ["type", "function_id", "binary_id"]
analysis_id: Optional[StrictInt] = None
__properties: ClassVar[List[str]] = ["type", "function_id", "binary_id", "analysis_id"]

@field_validator('type')
def type_validate_enum(cls, value):
Expand Down Expand Up @@ -86,6 +87,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.binary_id is None and "binary_id" in self.model_fields_set:
_dict['binary_id'] = None

# set to None if analysis_id (nullable) is None
# and model_fields_set contains the field
if self.analysis_id is None and "analysis_id" in self.model_fields_set:
_dict['analysis_id'] = None

return _dict

@classmethod
Expand All @@ -100,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"type": obj.get("type"),
"function_id": obj.get("function_id"),
"binary_id": obj.get("binary_id")
"binary_id": obj.get("binary_id"),
"analysis_id": obj.get("analysis_id")
})
return _obj

Expand Down
11 changes: 9 additions & 2 deletions revengai/models/relative_binary_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import json

from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -26,9 +26,10 @@ class RelativeBinaryResponse(BaseModel):
RelativeBinaryResponse
""" # noqa: E501
binary_id: StrictInt = Field(description="ID of the relative binary")
analysis_id: Optional[StrictInt] = None
name: StrictStr = Field(description="Name of the relative binary")
sha256: StrictStr = Field(description="SHA256 hash of the relative binary")
__properties: ClassVar[List[str]] = ["binary_id", "name", "sha256"]
__properties: ClassVar[List[str]] = ["binary_id", "analysis_id", "name", "sha256"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if analysis_id (nullable) is None
# and model_fields_set contains the field
if self.analysis_id is None and "analysis_id" in self.model_fields_set:
_dict['analysis_id'] = None

return _dict

@classmethod
Expand All @@ -82,6 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate({
"binary_id": obj.get("binary_id"),
"analysis_id": obj.get("analysis_id"),
"name": obj.get("name"),
"sha256": obj.get("sha256")
})
Expand Down
2 changes: 2 additions & 0 deletions test/test_analysis_detail_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def make_instance(self, include_optional) -> AnalysisDetailResponse:
binary_size = 56,
binary_type = '',
creation = '',
dashboard_url = '',
debug = True,
model_name = '',
sbom = {
Expand All @@ -67,6 +68,7 @@ def make_instance(self, include_optional) -> AnalysisDetailResponse:
binary_size = 56,
binary_type = '',
creation = '',
dashboard_url = '',
debug = True,
model_name = '',
sha_256_hash = '',
Expand Down
6 changes: 4 additions & 2 deletions test/test_analysis_functions_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def make_instance(self, include_optional) -> AnalysisFunctionsList:
name_source = revengai.models.name_source_type.NameSourceType(
type = 'SYSTEM',
function_id = 56,
binary_id = 56, ),
binary_id = 56,
analysis_id = 56, ),
mangled_name = '',
vaddr = 56,
size = 56,
Expand All @@ -59,7 +60,8 @@ def make_instance(self, include_optional) -> AnalysisFunctionsList:
name_source = revengai.models.name_source_type.NameSourceType(
type = 'SYSTEM',
function_id = 56,
binary_id = 56, ),
binary_id = 56,
analysis_id = 56, ),
mangled_name = '',
vaddr = 56,
size = 56,
Expand Down
1 change: 1 addition & 0 deletions test/test_base_response_analysis_detail_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def make_instance(self, include_optional) -> BaseResponseAnalysisDetailResponse:
binary_size = 56,
binary_type = '',
creation = '',
dashboard_url = '',
debug = True,
model_name = '',
sbom = {
Expand Down
3 changes: 2 additions & 1 deletion test/test_base_response_analysis_functions_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def make_instance(self, include_optional) -> BaseResponseAnalysisFunctionsList:
name_source = revengai.models.name_source_type.NameSourceType(
type = 'SYSTEM',
function_id = 56,
binary_id = 56, ),
binary_id = 56,
analysis_id = 56, ),
mangled_name = '',
vaddr = 56,
size = 56,
Expand Down
2 changes: 2 additions & 0 deletions test/test_base_response_child_binaries_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ def make_instance(self, include_optional) -> BaseResponseChildBinariesResponse:
children = [
revengai.models.relative_binary_response.RelativeBinaryResponse(
binary_id = 56,
analysis_id = 56,
name = '',
sha256 = '', )
],
parent = revengai.models.relative_binary_response.RelativeBinaryResponse(
binary_id = 56,
analysis_id = 56,
name = '',
sha256 = '', ), ),
message = '',
Expand Down
3 changes: 3 additions & 0 deletions test/test_child_binaries_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ def make_instance(self, include_optional) -> ChildBinariesResponse:
children = [
revengai.models.relative_binary_response.RelativeBinaryResponse(
binary_id = 56,
analysis_id = 56,
name = '',
sha256 = '', )
],
parent = revengai.models.relative_binary_response.RelativeBinaryResponse(
binary_id = 56,
analysis_id = 56,
name = '',
sha256 = '', )
)
Expand All @@ -50,6 +52,7 @@ def make_instance(self, include_optional) -> ChildBinariesResponse:
children = [
revengai.models.relative_binary_response.RelativeBinaryResponse(
binary_id = 56,
analysis_id = 56,
name = '',
sha256 = '', )
],
Expand Down
6 changes: 4 additions & 2 deletions test/test_function_list_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def make_instance(self, include_optional) -> FunctionListItem:
name_source = revengai.models.name_source_type.NameSourceType(
type = 'SYSTEM',
function_id = 56,
binary_id = 56, ),
binary_id = 56,
analysis_id = 56, ),
mangled_name = '',
vaddr = 56,
size = 56,
Expand All @@ -54,7 +55,8 @@ def make_instance(self, include_optional) -> FunctionListItem:
name_source = revengai.models.name_source_type.NameSourceType(
type = 'SYSTEM',
function_id = 56,
binary_id = 56, ),
binary_id = 56,
analysis_id = 56, ),
mangled_name = '',
vaddr = 56,
size = 56,
Expand Down
3 changes: 2 additions & 1 deletion test/test_name_source_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def make_instance(self, include_optional) -> NameSourceType:
return NameSourceType(
type = 'SYSTEM',
function_id = 56,
binary_id = 56
binary_id = 56,
analysis_id = 56
)
else:
return NameSourceType(
Expand Down
1 change: 1 addition & 0 deletions test/test_relative_binary_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def make_instance(self, include_optional) -> RelativeBinaryResponse:
if include_optional:
return RelativeBinaryResponse(
binary_id = 56,
analysis_id = 56,
name = '',
sha256 = ''
)
Expand Down