revengai 2.74.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- revengai/__init__.py +647 -0
- revengai/api/__init__.py +22 -0
- revengai/api/analyses_comments_api.py +1198 -0
- revengai/api/analyses_core_api.py +3870 -0
- revengai/api/analyses_dynamic_execution_api.py +1884 -0
- revengai/api/analyses_results_metadata_api.py +2240 -0
- revengai/api/analyses_security_checks_api.py +862 -0
- revengai/api/authentication_users_api.py +1323 -0
- revengai/api/binaries_api.py +1610 -0
- revengai/api/collections_api.py +2167 -0
- revengai/api/external_sources_api.py +827 -0
- revengai/api/firmware_api.py +592 -0
- revengai/api/functions_ai_decompilation_api.py +2592 -0
- revengai/api/functions_block_comments_api.py +849 -0
- revengai/api/functions_core_api.py +3430 -0
- revengai/api/functions_data_types_api.py +1746 -0
- revengai/api/functions_decompilation_api.py +1198 -0
- revengai/api/functions_renaming_history_api.py +1151 -0
- revengai/api/models_api.py +284 -0
- revengai/api/search_api.py +1454 -0
- revengai/api_client.py +803 -0
- revengai/api_response.py +21 -0
- revengai/configuration.py +605 -0
- revengai/exceptions.py +215 -0
- revengai/models/__init__.py +298 -0
- revengai/models/addr.py +143 -0
- revengai/models/ai_decompilation_rating.py +37 -0
- revengai/models/ai_unstrip_request.py +86 -0
- revengai/models/analysis_access_info.py +88 -0
- revengai/models/analysis_config.py +106 -0
- revengai/models/analysis_create_request.py +131 -0
- revengai/models/analysis_create_response.py +88 -0
- revengai/models/analysis_detail_response.py +121 -0
- revengai/models/analysis_function_mapping.py +90 -0
- revengai/models/analysis_function_matching_request.py +110 -0
- revengai/models/analysis_functions.py +94 -0
- revengai/models/analysis_functions_list.py +94 -0
- revengai/models/analysis_record.py +128 -0
- revengai/models/analysis_scope.py +36 -0
- revengai/models/analysis_strings_response.py +96 -0
- revengai/models/analysis_tags.py +94 -0
- revengai/models/analysis_update_request.py +108 -0
- revengai/models/analysis_update_tags_request.py +86 -0
- revengai/models/analysis_update_tags_response.py +94 -0
- revengai/models/app_api_rest_v2_analyses_enums_dynamic_execution_status.py +38 -0
- revengai/models/app_api_rest_v2_analyses_enums_order_by.py +37 -0
- revengai/models/app_api_rest_v2_collections_enums_order_by.py +40 -0
- revengai/models/app_api_rest_v2_functions_responses_function.py +93 -0
- revengai/models/app_api_rest_v2_functions_types_function.py +110 -0
- revengai/models/app_services_dynamic_execution_schemas_dynamic_execution_status.py +86 -0
- revengai/models/argument.py +99 -0
- revengai/models/auto_unstrip_request.py +99 -0
- revengai/models/auto_unstrip_response.py +129 -0
- revengai/models/base_response.py +124 -0
- revengai/models/base_response_analysis_create_response.py +125 -0
- revengai/models/base_response_analysis_detail_response.py +125 -0
- revengai/models/base_response_analysis_function_mapping.py +125 -0
- revengai/models/base_response_analysis_functions.py +125 -0
- revengai/models/base_response_analysis_functions_list.py +125 -0
- revengai/models/base_response_analysis_strings_response.py +125 -0
- revengai/models/base_response_analysis_tags.py +125 -0
- revengai/models/base_response_analysis_update_tags_response.py +125 -0
- revengai/models/base_response_basic.py +125 -0
- revengai/models/base_response_binary_additional_response.py +125 -0
- revengai/models/base_response_binary_details_response.py +125 -0
- revengai/models/base_response_binary_externals_response.py +125 -0
- revengai/models/base_response_binary_search_response.py +125 -0
- revengai/models/base_response_block_comments_generation_for_function_response.py +125 -0
- revengai/models/base_response_block_comments_overview_generation_response.py +116 -0
- revengai/models/base_response_bool.py +121 -0
- revengai/models/base_response_callees_caller_functions_response.py +125 -0
- revengai/models/base_response_capabilities.py +125 -0
- revengai/models/base_response_check_security_checks_task_response.py +125 -0
- revengai/models/base_response_child_binaries_response.py +125 -0
- revengai/models/base_response_collection_binaries_update_response.py +125 -0
- revengai/models/base_response_collection_response.py +125 -0
- revengai/models/base_response_collection_search_response.py +125 -0
- revengai/models/base_response_collection_tags_update_response.py +125 -0
- revengai/models/base_response_comment_response.py +125 -0
- revengai/models/base_response_communities.py +125 -0
- revengai/models/base_response_created.py +125 -0
- revengai/models/base_response_dict.py +121 -0
- revengai/models/base_response_dynamic_execution_status.py +125 -0
- revengai/models/base_response_external_response.py +125 -0
- revengai/models/base_response_function_blocks_response.py +125 -0
- revengai/models/base_response_function_capability_response.py +125 -0
- revengai/models/base_response_function_data_types.py +125 -0
- revengai/models/base_response_function_data_types_list.py +125 -0
- revengai/models/base_response_function_search_response.py +125 -0
- revengai/models/base_response_function_strings_response.py +125 -0
- revengai/models/base_response_function_task_response.py +125 -0
- revengai/models/base_response_functions_detail_response.py +125 -0
- revengai/models/base_response_generate_function_data_types.py +125 -0
- revengai/models/base_response_generation_status_list.py +125 -0
- revengai/models/base_response_get_ai_decompilation_rating_response.py +125 -0
- revengai/models/base_response_get_ai_decompilation_task.py +125 -0
- revengai/models/base_response_get_me_response.py +125 -0
- revengai/models/base_response_get_public_user_response.py +125 -0
- revengai/models/base_response_list_collection_results.py +125 -0
- revengai/models/base_response_list_comment_response.py +129 -0
- revengai/models/base_response_list_die_match.py +129 -0
- revengai/models/base_response_list_function_name_history.py +129 -0
- revengai/models/base_response_list_sbom.py +129 -0
- revengai/models/base_response_list_user_activity_response.py +129 -0
- revengai/models/base_response_login_response.py +125 -0
- revengai/models/base_response_logs.py +125 -0
- revengai/models/base_response_models_response.py +125 -0
- revengai/models/base_response_network_overview_response.py +125 -0
- revengai/models/base_response_params.py +125 -0
- revengai/models/base_response_process_dumps.py +125 -0
- revengai/models/base_response_process_registry.py +125 -0
- revengai/models/base_response_process_tree.py +125 -0
- revengai/models/base_response_queued_security_checks_task_response.py +125 -0
- revengai/models/base_response_recent.py +125 -0
- revengai/models/base_response_security_checks_response.py +125 -0
- revengai/models/base_response_status.py +125 -0
- revengai/models/base_response_str.py +121 -0
- revengai/models/base_response_tag_search_response.py +125 -0
- revengai/models/base_response_task_response.py +125 -0
- revengai/models/base_response_ttps.py +125 -0
- revengai/models/base_response_upload_response.py +125 -0
- revengai/models/base_response_vulnerabilities.py +125 -0
- revengai/models/basic.py +116 -0
- revengai/models/binary_additional_details_data_response.py +112 -0
- revengai/models/binary_additional_response.py +105 -0
- revengai/models/binary_config.py +108 -0
- revengai/models/binary_details_response.py +125 -0
- revengai/models/binary_externals_response.py +95 -0
- revengai/models/binary_search_response.py +94 -0
- revengai/models/binary_search_result.py +108 -0
- revengai/models/binary_task_status.py +39 -0
- revengai/models/block.py +86 -0
- revengai/models/block_comments_generation_for_function_response.py +86 -0
- revengai/models/callee_function_info.py +106 -0
- revengai/models/callees_caller_functions_response.py +106 -0
- revengai/models/caller_function_info.py +106 -0
- revengai/models/capabilities.py +94 -0
- revengai/models/capability.py +90 -0
- revengai/models/check_security_checks_task_response.py +87 -0
- revengai/models/child_binaries_response.py +104 -0
- revengai/models/code_signature_model.py +98 -0
- revengai/models/collection_binaries_update_request.py +86 -0
- revengai/models/collection_binaries_update_response.py +94 -0
- revengai/models/collection_binary_response.py +97 -0
- revengai/models/collection_create_request.py +107 -0
- revengai/models/collection_list_item.py +112 -0
- revengai/models/collection_response.py +131 -0
- revengai/models/collection_response_binaries_inner.py +135 -0
- revengai/models/collection_scope.py +38 -0
- revengai/models/collection_search_response.py +94 -0
- revengai/models/collection_search_result.py +124 -0
- revengai/models/collection_tags_update_request.py +86 -0
- revengai/models/collection_tags_update_response.py +86 -0
- revengai/models/collection_update_request.py +106 -0
- revengai/models/comment_base.py +86 -0
- revengai/models/comment_response.py +110 -0
- revengai/models/comment_update_request.py +86 -0
- revengai/models/communities.py +100 -0
- revengai/models/community_match_percentages.py +92 -0
- revengai/models/confidence_type.py +39 -0
- revengai/models/context.py +141 -0
- revengai/models/created.py +90 -0
- revengai/models/decompilation_comment_context.py +98 -0
- revengai/models/die_match.py +92 -0
- revengai/models/dynamic_execution_status_input.py +38 -0
- revengai/models/elf_dynamic_entry.py +88 -0
- revengai/models/elf_import_model.py +88 -0
- revengai/models/elf_model.py +179 -0
- revengai/models/elf_relocation.py +98 -0
- revengai/models/elf_section.py +104 -0
- revengai/models/elf_security.py +94 -0
- revengai/models/elf_segment.py +102 -0
- revengai/models/elf_symbol.py +98 -0
- revengai/models/entrypoint_model.py +88 -0
- revengai/models/enumeration.py +97 -0
- revengai/models/error_model.py +88 -0
- revengai/models/export_model.py +88 -0
- revengai/models/external_response.py +91 -0
- revengai/models/file_format.py +37 -0
- revengai/models/file_hashes.py +140 -0
- revengai/models/file_metadata.py +96 -0
- revengai/models/filters.py +39 -0
- revengai/models/function_block_destination_response.py +95 -0
- revengai/models/function_block_response.py +109 -0
- revengai/models/function_blocks_response.py +121 -0
- revengai/models/function_boundary.py +90 -0
- revengai/models/function_capability_response.py +86 -0
- revengai/models/function_comment_create_request.py +92 -0
- revengai/models/function_data_types.py +106 -0
- revengai/models/function_data_types_list.py +98 -0
- revengai/models/function_data_types_list_item.py +108 -0
- revengai/models/function_data_types_params.py +86 -0
- revengai/models/function_data_types_status.py +90 -0
- revengai/models/function_header.py +112 -0
- revengai/models/function_info_input.py +105 -0
- revengai/models/function_info_input_func_deps_inner.py +163 -0
- revengai/models/function_info_output.py +105 -0
- revengai/models/function_list_item.py +96 -0
- revengai/models/function_local_variable_response.py +94 -0
- revengai/models/function_mapping.py +90 -0
- revengai/models/function_mapping_full.py +275 -0
- revengai/models/function_match.py +111 -0
- revengai/models/function_matching_filters.py +103 -0
- revengai/models/function_matching_request.py +114 -0
- revengai/models/function_matching_response.py +157 -0
- revengai/models/function_name_history.py +99 -0
- revengai/models/function_param_response.py +94 -0
- revengai/models/function_rename.py +88 -0
- revengai/models/function_rename_map.py +90 -0
- revengai/models/function_search_response.py +94 -0
- revengai/models/function_search_result.py +99 -0
- revengai/models/function_source_type.py +39 -0
- revengai/models/function_string.py +88 -0
- revengai/models/function_strings_response.py +96 -0
- revengai/models/function_task_response.py +94 -0
- revengai/models/function_task_status.py +39 -0
- revengai/models/function_type_input.py +127 -0
- revengai/models/function_type_output.py +127 -0
- revengai/models/functions_detail_response.py +125 -0
- revengai/models/functions_list_rename.py +94 -0
- revengai/models/generate_function_data_types.py +94 -0
- revengai/models/generation_status_list.py +98 -0
- revengai/models/get_ai_decompilation_rating_response.py +94 -0
- revengai/models/get_ai_decompilation_task.py +159 -0
- revengai/models/get_me_response.py +108 -0
- revengai/models/get_public_user_response.py +88 -0
- revengai/models/global_variable.py +101 -0
- revengai/models/icon_model.py +91 -0
- revengai/models/import_model.py +88 -0
- revengai/models/inverse_function_map_item.py +99 -0
- revengai/models/inverse_string_map_item.py +93 -0
- revengai/models/inverse_value.py +86 -0
- revengai/models/isa.py +37 -0
- revengai/models/list_collection_results.py +94 -0
- revengai/models/login_request.py +89 -0
- revengai/models/login_response.py +86 -0
- revengai/models/logs.py +86 -0
- revengai/models/matched_function.py +116 -0
- revengai/models/matched_function_suggestion.py +97 -0
- revengai/models/meta_model.py +95 -0
- revengai/models/model_name.py +40 -0
- revengai/models/models_response.py +86 -0
- revengai/models/name_confidence.py +89 -0
- revengai/models/network_overview_dns.py +98 -0
- revengai/models/network_overview_dns_answer.py +88 -0
- revengai/models/network_overview_metadata.py +99 -0
- revengai/models/network_overview_response.py +104 -0
- revengai/models/order.py +36 -0
- revengai/models/pagination_model.py +90 -0
- revengai/models/params.py +103 -0
- revengai/models/pdb_debug_model.py +94 -0
- revengai/models/pe_model.py +215 -0
- revengai/models/platform.py +36 -0
- revengai/models/process.py +103 -0
- revengai/models/process_dump.py +96 -0
- revengai/models/process_dump_metadata.py +90 -0
- revengai/models/process_dumps.py +92 -0
- revengai/models/process_dumps_data.py +96 -0
- revengai/models/process_registry.py +105 -0
- revengai/models/process_tree.py +96 -0
- revengai/models/queued_security_checks_task_response.py +86 -0
- revengai/models/re_analysis_form.py +101 -0
- revengai/models/recent.py +94 -0
- revengai/models/registry.py +102 -0
- revengai/models/relative_binary_response.py +90 -0
- revengai/models/sandbox_options.py +88 -0
- revengai/models/sbom.py +96 -0
- revengai/models/sbom_package.py +88 -0
- revengai/models/scrape_third_party_config.py +86 -0
- revengai/models/section_model.py +96 -0
- revengai/models/security_checks_response.py +98 -0
- revengai/models/security_checks_result.py +103 -0
- revengai/models/security_model.py +106 -0
- revengai/models/severity_type.py +40 -0
- revengai/models/single_code_certificate_model.py +96 -0
- revengai/models/single_code_signature_model.py +96 -0
- revengai/models/single_pdb_entry_model.py +90 -0
- revengai/models/single_section_model.py +98 -0
- revengai/models/stack_variable.py +101 -0
- revengai/models/status_input.py +40 -0
- revengai/models/status_output.py +88 -0
- revengai/models/string_functions.py +96 -0
- revengai/models/structure.py +117 -0
- revengai/models/structure_member.py +99 -0
- revengai/models/symbols.py +96 -0
- revengai/models/tag.py +86 -0
- revengai/models/tag_item.py +95 -0
- revengai/models/tag_response.py +88 -0
- revengai/models/tag_search_response.py +94 -0
- revengai/models/tag_search_result.py +88 -0
- revengai/models/task_response.py +94 -0
- revengai/models/task_status.py +39 -0
- revengai/models/timestamp_model.py +90 -0
- revengai/models/ttps.py +92 -0
- revengai/models/ttps_attack.py +88 -0
- revengai/models/ttps_data.py +96 -0
- revengai/models/ttps_element.py +108 -0
- revengai/models/ttps_occurance.py +88 -0
- revengai/models/type_definition.py +97 -0
- revengai/models/update_function_data_types.py +92 -0
- revengai/models/upload_file_type.py +38 -0
- revengai/models/upload_response.py +91 -0
- revengai/models/upsert_ai_decomplation_rating_request.py +94 -0
- revengai/models/user_activity_response.py +97 -0
- revengai/models/vulnerabilities.py +94 -0
- revengai/models/vulnerability.py +113 -0
- revengai/models/vulnerability_type.py +40 -0
- revengai/models/workspace.py +37 -0
- revengai/py.typed +0 -0
- revengai/rest.py +257 -0
- revengai-2.74.0.dist-info/METADATA +447 -0
- revengai-2.74.0.dist-info/RECORD +314 -0
- revengai-2.74.0.dist-info/WHEEL +4 -0
- revengai-2.74.0.dist-info/licenses/LICENSE.md +19 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
import pprint
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
20
|
+
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class FunctionMapping(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
FunctionMapping
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
function_map: Dict[str, StrictInt] = Field(description="Mapping of remote function ids to local function addresses")
|
|
29
|
+
inverse_function_map: Dict[str, StrictInt] = Field(description="Mapping of local function addresses to remote function ids")
|
|
30
|
+
name_map: Dict[str, StrictStr] = Field(description="Mapping of local function addresses to mangled names")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["function_map", "inverse_function_map", "name_map"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of FunctionMapping from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of FunctionMapping from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"function_map": obj.get("function_map"),
|
|
85
|
+
"inverse_function_map": obj.get("inverse_function_map"),
|
|
86
|
+
"name_map": obj.get("name_map")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
import pprint
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from revengai.models.inverse_function_map_item import InverseFunctionMapItem
|
|
22
|
+
from revengai.models.inverse_string_map_item import InverseStringMapItem
|
|
23
|
+
from revengai.models.inverse_value import InverseValue
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class FunctionMappingFull(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
FunctionMappingFull
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
inverse_string_map: Dict[str, InverseStringMapItem]
|
|
32
|
+
inverse_function_map: Dict[str, InverseFunctionMapItem]
|
|
33
|
+
unmatched_functions: Dict[str, InverseValue]
|
|
34
|
+
unmatched_custom_types: Dict[str, InverseValue]
|
|
35
|
+
unmatched_strings: Dict[str, InverseValue]
|
|
36
|
+
unmatched_vars: Dict[str, InverseValue]
|
|
37
|
+
unmatched_go_to_labels: Dict[str, InverseValue]
|
|
38
|
+
unmatched_custom_function_pointers: Dict[str, InverseValue]
|
|
39
|
+
unmatched_variadic_lists: Dict[str, InverseValue]
|
|
40
|
+
unmatched_enums: Dict[str, InverseValue]
|
|
41
|
+
unmatched_global_vars: Dict[str, InverseValue]
|
|
42
|
+
fields: Dict[str, Dict[str, InverseValue]]
|
|
43
|
+
unmatched_external_vars: Optional[Dict[str, InverseValue]] = Field(default=None, description="No longer provided.")
|
|
44
|
+
__properties: ClassVar[List[str]] = ["inverse_string_map", "inverse_function_map", "unmatched_functions", "unmatched_custom_types", "unmatched_strings", "unmatched_vars", "unmatched_go_to_labels", "unmatched_custom_function_pointers", "unmatched_variadic_lists", "unmatched_enums", "unmatched_global_vars", "fields", "unmatched_external_vars"]
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of FunctionMappingFull from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of each value in inverse_string_map (dict)
|
|
86
|
+
_field_dict = {}
|
|
87
|
+
if self.inverse_string_map:
|
|
88
|
+
for _key_inverse_string_map in self.inverse_string_map:
|
|
89
|
+
if self.inverse_string_map[_key_inverse_string_map]:
|
|
90
|
+
_field_dict[_key_inverse_string_map] = self.inverse_string_map[_key_inverse_string_map].to_dict()
|
|
91
|
+
_dict['inverse_string_map'] = _field_dict
|
|
92
|
+
# override the default output from pydantic by calling `to_dict()` of each value in inverse_function_map (dict)
|
|
93
|
+
_field_dict = {}
|
|
94
|
+
if self.inverse_function_map:
|
|
95
|
+
for _key_inverse_function_map in self.inverse_function_map:
|
|
96
|
+
if self.inverse_function_map[_key_inverse_function_map]:
|
|
97
|
+
_field_dict[_key_inverse_function_map] = self.inverse_function_map[_key_inverse_function_map].to_dict()
|
|
98
|
+
_dict['inverse_function_map'] = _field_dict
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_functions (dict)
|
|
100
|
+
_field_dict = {}
|
|
101
|
+
if self.unmatched_functions:
|
|
102
|
+
for _key_unmatched_functions in self.unmatched_functions:
|
|
103
|
+
if self.unmatched_functions[_key_unmatched_functions]:
|
|
104
|
+
_field_dict[_key_unmatched_functions] = self.unmatched_functions[_key_unmatched_functions].to_dict()
|
|
105
|
+
_dict['unmatched_functions'] = _field_dict
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_custom_types (dict)
|
|
107
|
+
_field_dict = {}
|
|
108
|
+
if self.unmatched_custom_types:
|
|
109
|
+
for _key_unmatched_custom_types in self.unmatched_custom_types:
|
|
110
|
+
if self.unmatched_custom_types[_key_unmatched_custom_types]:
|
|
111
|
+
_field_dict[_key_unmatched_custom_types] = self.unmatched_custom_types[_key_unmatched_custom_types].to_dict()
|
|
112
|
+
_dict['unmatched_custom_types'] = _field_dict
|
|
113
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_strings (dict)
|
|
114
|
+
_field_dict = {}
|
|
115
|
+
if self.unmatched_strings:
|
|
116
|
+
for _key_unmatched_strings in self.unmatched_strings:
|
|
117
|
+
if self.unmatched_strings[_key_unmatched_strings]:
|
|
118
|
+
_field_dict[_key_unmatched_strings] = self.unmatched_strings[_key_unmatched_strings].to_dict()
|
|
119
|
+
_dict['unmatched_strings'] = _field_dict
|
|
120
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_vars (dict)
|
|
121
|
+
_field_dict = {}
|
|
122
|
+
if self.unmatched_vars:
|
|
123
|
+
for _key_unmatched_vars in self.unmatched_vars:
|
|
124
|
+
if self.unmatched_vars[_key_unmatched_vars]:
|
|
125
|
+
_field_dict[_key_unmatched_vars] = self.unmatched_vars[_key_unmatched_vars].to_dict()
|
|
126
|
+
_dict['unmatched_vars'] = _field_dict
|
|
127
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_go_to_labels (dict)
|
|
128
|
+
_field_dict = {}
|
|
129
|
+
if self.unmatched_go_to_labels:
|
|
130
|
+
for _key_unmatched_go_to_labels in self.unmatched_go_to_labels:
|
|
131
|
+
if self.unmatched_go_to_labels[_key_unmatched_go_to_labels]:
|
|
132
|
+
_field_dict[_key_unmatched_go_to_labels] = self.unmatched_go_to_labels[_key_unmatched_go_to_labels].to_dict()
|
|
133
|
+
_dict['unmatched_go_to_labels'] = _field_dict
|
|
134
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_custom_function_pointers (dict)
|
|
135
|
+
_field_dict = {}
|
|
136
|
+
if self.unmatched_custom_function_pointers:
|
|
137
|
+
for _key_unmatched_custom_function_pointers in self.unmatched_custom_function_pointers:
|
|
138
|
+
if self.unmatched_custom_function_pointers[_key_unmatched_custom_function_pointers]:
|
|
139
|
+
_field_dict[_key_unmatched_custom_function_pointers] = self.unmatched_custom_function_pointers[_key_unmatched_custom_function_pointers].to_dict()
|
|
140
|
+
_dict['unmatched_custom_function_pointers'] = _field_dict
|
|
141
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_variadic_lists (dict)
|
|
142
|
+
_field_dict = {}
|
|
143
|
+
if self.unmatched_variadic_lists:
|
|
144
|
+
for _key_unmatched_variadic_lists in self.unmatched_variadic_lists:
|
|
145
|
+
if self.unmatched_variadic_lists[_key_unmatched_variadic_lists]:
|
|
146
|
+
_field_dict[_key_unmatched_variadic_lists] = self.unmatched_variadic_lists[_key_unmatched_variadic_lists].to_dict()
|
|
147
|
+
_dict['unmatched_variadic_lists'] = _field_dict
|
|
148
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_enums (dict)
|
|
149
|
+
_field_dict = {}
|
|
150
|
+
if self.unmatched_enums:
|
|
151
|
+
for _key_unmatched_enums in self.unmatched_enums:
|
|
152
|
+
if self.unmatched_enums[_key_unmatched_enums]:
|
|
153
|
+
_field_dict[_key_unmatched_enums] = self.unmatched_enums[_key_unmatched_enums].to_dict()
|
|
154
|
+
_dict['unmatched_enums'] = _field_dict
|
|
155
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_global_vars (dict)
|
|
156
|
+
_field_dict = {}
|
|
157
|
+
if self.unmatched_global_vars:
|
|
158
|
+
for _key_unmatched_global_vars in self.unmatched_global_vars:
|
|
159
|
+
if self.unmatched_global_vars[_key_unmatched_global_vars]:
|
|
160
|
+
_field_dict[_key_unmatched_global_vars] = self.unmatched_global_vars[_key_unmatched_global_vars].to_dict()
|
|
161
|
+
_dict['unmatched_global_vars'] = _field_dict
|
|
162
|
+
# override the default output from pydantic by calling `to_dict()` of each value in fields (dict)
|
|
163
|
+
_field_dict = {}
|
|
164
|
+
if self.fields:
|
|
165
|
+
for _key_fields in self.fields:
|
|
166
|
+
if self.fields[_key_fields]:
|
|
167
|
+
_field_dict[_key_fields] = self.fields[_key_fields].to_dict()
|
|
168
|
+
_dict['fields'] = _field_dict
|
|
169
|
+
# override the default output from pydantic by calling `to_dict()` of each value in unmatched_external_vars (dict)
|
|
170
|
+
_field_dict = {}
|
|
171
|
+
if self.unmatched_external_vars:
|
|
172
|
+
for _key_unmatched_external_vars in self.unmatched_external_vars:
|
|
173
|
+
if self.unmatched_external_vars[_key_unmatched_external_vars]:
|
|
174
|
+
_field_dict[_key_unmatched_external_vars] = self.unmatched_external_vars[_key_unmatched_external_vars].to_dict()
|
|
175
|
+
_dict['unmatched_external_vars'] = _field_dict
|
|
176
|
+
return _dict
|
|
177
|
+
|
|
178
|
+
@classmethod
|
|
179
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
180
|
+
"""Create an instance of FunctionMappingFull from a dict"""
|
|
181
|
+
if obj is None:
|
|
182
|
+
return None
|
|
183
|
+
|
|
184
|
+
if not isinstance(obj, dict):
|
|
185
|
+
return cls.model_validate(obj)
|
|
186
|
+
|
|
187
|
+
_obj = cls.model_validate({
|
|
188
|
+
"inverse_string_map": dict(
|
|
189
|
+
(_k, InverseStringMapItem.from_dict(_v))
|
|
190
|
+
for _k, _v in obj["inverse_string_map"].items()
|
|
191
|
+
)
|
|
192
|
+
if obj.get("inverse_string_map") is not None
|
|
193
|
+
else None,
|
|
194
|
+
"inverse_function_map": dict(
|
|
195
|
+
(_k, InverseFunctionMapItem.from_dict(_v))
|
|
196
|
+
for _k, _v in obj["inverse_function_map"].items()
|
|
197
|
+
)
|
|
198
|
+
if obj.get("inverse_function_map") is not None
|
|
199
|
+
else None,
|
|
200
|
+
"unmatched_functions": dict(
|
|
201
|
+
(_k, InverseValue.from_dict(_v))
|
|
202
|
+
for _k, _v in obj["unmatched_functions"].items()
|
|
203
|
+
)
|
|
204
|
+
if obj.get("unmatched_functions") is not None
|
|
205
|
+
else None,
|
|
206
|
+
"unmatched_custom_types": dict(
|
|
207
|
+
(_k, InverseValue.from_dict(_v))
|
|
208
|
+
for _k, _v in obj["unmatched_custom_types"].items()
|
|
209
|
+
)
|
|
210
|
+
if obj.get("unmatched_custom_types") is not None
|
|
211
|
+
else None,
|
|
212
|
+
"unmatched_strings": dict(
|
|
213
|
+
(_k, InverseValue.from_dict(_v))
|
|
214
|
+
for _k, _v in obj["unmatched_strings"].items()
|
|
215
|
+
)
|
|
216
|
+
if obj.get("unmatched_strings") is not None
|
|
217
|
+
else None,
|
|
218
|
+
"unmatched_vars": dict(
|
|
219
|
+
(_k, InverseValue.from_dict(_v))
|
|
220
|
+
for _k, _v in obj["unmatched_vars"].items()
|
|
221
|
+
)
|
|
222
|
+
if obj.get("unmatched_vars") is not None
|
|
223
|
+
else None,
|
|
224
|
+
"unmatched_go_to_labels": dict(
|
|
225
|
+
(_k, InverseValue.from_dict(_v))
|
|
226
|
+
for _k, _v in obj["unmatched_go_to_labels"].items()
|
|
227
|
+
)
|
|
228
|
+
if obj.get("unmatched_go_to_labels") is not None
|
|
229
|
+
else None,
|
|
230
|
+
"unmatched_custom_function_pointers": dict(
|
|
231
|
+
(_k, InverseValue.from_dict(_v))
|
|
232
|
+
for _k, _v in obj["unmatched_custom_function_pointers"].items()
|
|
233
|
+
)
|
|
234
|
+
if obj.get("unmatched_custom_function_pointers") is not None
|
|
235
|
+
else None,
|
|
236
|
+
"unmatched_variadic_lists": dict(
|
|
237
|
+
(_k, InverseValue.from_dict(_v))
|
|
238
|
+
for _k, _v in obj["unmatched_variadic_lists"].items()
|
|
239
|
+
)
|
|
240
|
+
if obj.get("unmatched_variadic_lists") is not None
|
|
241
|
+
else None,
|
|
242
|
+
"unmatched_enums": dict(
|
|
243
|
+
(_k, InverseValue.from_dict(_v))
|
|
244
|
+
for _k, _v in obj["unmatched_enums"].items()
|
|
245
|
+
)
|
|
246
|
+
if obj.get("unmatched_enums") is not None
|
|
247
|
+
else None,
|
|
248
|
+
"unmatched_global_vars": dict(
|
|
249
|
+
(_k, InverseValue.from_dict(_v))
|
|
250
|
+
for _k, _v in obj["unmatched_global_vars"].items()
|
|
251
|
+
)
|
|
252
|
+
if obj.get("unmatched_global_vars") is not None
|
|
253
|
+
else None,
|
|
254
|
+
"fields": dict(
|
|
255
|
+
(_k, dict(
|
|
256
|
+
(_ik, InverseValue.from_dict(_iv))
|
|
257
|
+
for _ik, _iv in _v.items()
|
|
258
|
+
)
|
|
259
|
+
if _v is not None
|
|
260
|
+
else None
|
|
261
|
+
)
|
|
262
|
+
for _k, _v in obj.get("fields").items()
|
|
263
|
+
)
|
|
264
|
+
if obj.get("fields") is not None
|
|
265
|
+
else None,
|
|
266
|
+
"unmatched_external_vars": dict(
|
|
267
|
+
(_k, InverseValue.from_dict(_v))
|
|
268
|
+
for _k, _v in obj["unmatched_external_vars"].items()
|
|
269
|
+
)
|
|
270
|
+
if obj.get("unmatched_external_vars") is not None
|
|
271
|
+
else None
|
|
272
|
+
})
|
|
273
|
+
return _obj
|
|
274
|
+
|
|
275
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
import pprint
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from revengai.models.matched_function import MatchedFunction
|
|
22
|
+
from revengai.models.name_confidence import NameConfidence
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class FunctionMatch(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
FunctionMatch
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
function_id: StrictInt = Field(description="Unique identifier of the function")
|
|
31
|
+
matched_functions: List[MatchedFunction]
|
|
32
|
+
confidences: Optional[List[NameConfidence]] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["function_id", "matched_functions", "confidences"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of FunctionMatch from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in matched_functions (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.matched_functions:
|
|
77
|
+
for _item_matched_functions in self.matched_functions:
|
|
78
|
+
if _item_matched_functions:
|
|
79
|
+
_items.append(_item_matched_functions.to_dict())
|
|
80
|
+
_dict['matched_functions'] = _items
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in confidences (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.confidences:
|
|
84
|
+
for _item_confidences in self.confidences:
|
|
85
|
+
if _item_confidences:
|
|
86
|
+
_items.append(_item_confidences.to_dict())
|
|
87
|
+
_dict['confidences'] = _items
|
|
88
|
+
# set to None if confidences (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.confidences is None and "confidences" in self.model_fields_set:
|
|
91
|
+
_dict['confidences'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of FunctionMatch from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"function_id": obj.get("function_id"),
|
|
106
|
+
"matched_functions": [MatchedFunction.from_dict(_item) for _item in obj["matched_functions"]] if obj.get("matched_functions") is not None else None,
|
|
107
|
+
"confidences": [NameConfidence.from_dict(_item) for _item in obj["confidences"]] if obj.get("confidences") is not None else None
|
|
108
|
+
})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
RevEng.AI API
|
|
5
|
+
|
|
6
|
+
RevEng.AI is Similarity Search Engine for executable binaries
|
|
7
|
+
|
|
8
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
9
|
+
|
|
10
|
+
Do not edit the class manually.
|
|
11
|
+
""" # noqa: E501
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
import pprint
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class FunctionMatchingFilters(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
FunctionMatchingFilters
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
binary_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of binaries to limit the search to, if empty, search all scoped binaries")
|
|
29
|
+
collection_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of collections to limit the search to, if empty, search all scoped collections")
|
|
30
|
+
function_ids: Optional[List[StrictInt]] = Field(default=None, description="ID's of functions to limit the search to, if empty, search all scoped functions")
|
|
31
|
+
debug_types: Optional[List[StrictStr]] = Field(default=None, description="Limit the search to specific debug types, if empty, search all scoped debug & non-debug functions")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["binary_ids", "collection_ids", "function_ids", "debug_types"]
|
|
33
|
+
|
|
34
|
+
@field_validator('debug_types')
|
|
35
|
+
def debug_types_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value is None:
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
for i in value:
|
|
41
|
+
if i not in set(['USER', 'SYSTEM', 'EXTERNAL']):
|
|
42
|
+
raise ValueError("each list item must be one of ('USER', 'SYSTEM', 'EXTERNAL')")
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
populate_by_name=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
59
|
+
return json.dumps(self.to_dict())
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of FunctionMatchingFilters from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of FunctionMatchingFilters from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"binary_ids": obj.get("binary_ids"),
|
|
97
|
+
"collection_ids": obj.get("collection_ids"),
|
|
98
|
+
"function_ids": obj.get("function_ids"),
|
|
99
|
+
"debug_types": obj.get("debug_types")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|