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,215 @@
|
|
|
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, StrictBool, StrictInt, StrictStr
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from revengai.models.code_signature_model import CodeSignatureModel
|
|
22
|
+
from revengai.models.entrypoint_model import EntrypointModel
|
|
23
|
+
from revengai.models.export_model import ExportModel
|
|
24
|
+
from revengai.models.icon_model import IconModel
|
|
25
|
+
from revengai.models.import_model import ImportModel
|
|
26
|
+
from revengai.models.pdb_debug_model import PDBDebugModel
|
|
27
|
+
from revengai.models.section_model import SectionModel
|
|
28
|
+
from revengai.models.security_model import SecurityModel
|
|
29
|
+
from revengai.models.timestamp_model import TimestampModel
|
|
30
|
+
from typing import Optional, Set
|
|
31
|
+
from typing_extensions import Self
|
|
32
|
+
|
|
33
|
+
class PEModel(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
PEModel
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
type: StrictStr
|
|
38
|
+
timestamps: Optional[TimestampModel]
|
|
39
|
+
architecture: StrictStr
|
|
40
|
+
checksum: StrictInt
|
|
41
|
+
image_base: StrictInt
|
|
42
|
+
security: Optional[SecurityModel]
|
|
43
|
+
version_info: Optional[Dict[str, Any]]
|
|
44
|
+
debug_info: Optional[PDBDebugModel]
|
|
45
|
+
number_of_resources: Optional[StrictInt]
|
|
46
|
+
entry_point: Optional[EntrypointModel]
|
|
47
|
+
signature: Optional[CodeSignatureModel]
|
|
48
|
+
dotnet: StrictBool
|
|
49
|
+
debug_stripped: StrictBool
|
|
50
|
+
import_hash: StrictStr
|
|
51
|
+
export_hash: StrictStr
|
|
52
|
+
rich_header_hash: StrictStr
|
|
53
|
+
sections: Optional[SectionModel]
|
|
54
|
+
imports: Optional[ImportModel]
|
|
55
|
+
exports: Optional[ExportModel]
|
|
56
|
+
icon_data: Optional[IconModel]
|
|
57
|
+
__properties: ClassVar[List[str]] = ["type", "timestamps", "architecture", "checksum", "image_base", "security", "version_info", "debug_info", "number_of_resources", "entry_point", "signature", "dotnet", "debug_stripped", "import_hash", "export_hash", "rich_header_hash", "sections", "imports", "exports", "icon_data"]
|
|
58
|
+
|
|
59
|
+
model_config = ConfigDict(
|
|
60
|
+
populate_by_name=True,
|
|
61
|
+
validate_assignment=True,
|
|
62
|
+
protected_namespaces=(),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def to_str(self) -> str:
|
|
67
|
+
"""Returns the string representation of the model using alias"""
|
|
68
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
69
|
+
|
|
70
|
+
def to_json(self) -> str:
|
|
71
|
+
"""Returns the JSON representation of the model using alias"""
|
|
72
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
73
|
+
return json.dumps(self.to_dict())
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of PEModel from a JSON string"""
|
|
78
|
+
return cls.from_dict(json.loads(json_str))
|
|
79
|
+
|
|
80
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
81
|
+
"""Return the dictionary representation of the model using alias.
|
|
82
|
+
|
|
83
|
+
This has the following differences from calling pydantic's
|
|
84
|
+
`self.model_dump(by_alias=True)`:
|
|
85
|
+
|
|
86
|
+
* `None` is only added to the output dict for nullable fields that
|
|
87
|
+
were set at model initialization. Other fields with value `None`
|
|
88
|
+
are ignored.
|
|
89
|
+
"""
|
|
90
|
+
excluded_fields: Set[str] = set([
|
|
91
|
+
])
|
|
92
|
+
|
|
93
|
+
_dict = self.model_dump(
|
|
94
|
+
by_alias=True,
|
|
95
|
+
exclude=excluded_fields,
|
|
96
|
+
exclude_none=True,
|
|
97
|
+
)
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of timestamps
|
|
99
|
+
if self.timestamps:
|
|
100
|
+
_dict['timestamps'] = self.timestamps.to_dict()
|
|
101
|
+
# override the default output from pydantic by calling `to_dict()` of security
|
|
102
|
+
if self.security:
|
|
103
|
+
_dict['security'] = self.security.to_dict()
|
|
104
|
+
# override the default output from pydantic by calling `to_dict()` of debug_info
|
|
105
|
+
if self.debug_info:
|
|
106
|
+
_dict['debug_info'] = self.debug_info.to_dict()
|
|
107
|
+
# override the default output from pydantic by calling `to_dict()` of entry_point
|
|
108
|
+
if self.entry_point:
|
|
109
|
+
_dict['entry_point'] = self.entry_point.to_dict()
|
|
110
|
+
# override the default output from pydantic by calling `to_dict()` of signature
|
|
111
|
+
if self.signature:
|
|
112
|
+
_dict['signature'] = self.signature.to_dict()
|
|
113
|
+
# override the default output from pydantic by calling `to_dict()` of sections
|
|
114
|
+
if self.sections:
|
|
115
|
+
_dict['sections'] = self.sections.to_dict()
|
|
116
|
+
# override the default output from pydantic by calling `to_dict()` of imports
|
|
117
|
+
if self.imports:
|
|
118
|
+
_dict['imports'] = self.imports.to_dict()
|
|
119
|
+
# override the default output from pydantic by calling `to_dict()` of exports
|
|
120
|
+
if self.exports:
|
|
121
|
+
_dict['exports'] = self.exports.to_dict()
|
|
122
|
+
# override the default output from pydantic by calling `to_dict()` of icon_data
|
|
123
|
+
if self.icon_data:
|
|
124
|
+
_dict['icon_data'] = self.icon_data.to_dict()
|
|
125
|
+
# set to None if timestamps (nullable) is None
|
|
126
|
+
# and model_fields_set contains the field
|
|
127
|
+
if self.timestamps is None and "timestamps" in self.model_fields_set:
|
|
128
|
+
_dict['timestamps'] = None
|
|
129
|
+
|
|
130
|
+
# set to None if security (nullable) is None
|
|
131
|
+
# and model_fields_set contains the field
|
|
132
|
+
if self.security is None and "security" in self.model_fields_set:
|
|
133
|
+
_dict['security'] = None
|
|
134
|
+
|
|
135
|
+
# set to None if version_info (nullable) is None
|
|
136
|
+
# and model_fields_set contains the field
|
|
137
|
+
if self.version_info is None and "version_info" in self.model_fields_set:
|
|
138
|
+
_dict['version_info'] = None
|
|
139
|
+
|
|
140
|
+
# set to None if debug_info (nullable) is None
|
|
141
|
+
# and model_fields_set contains the field
|
|
142
|
+
if self.debug_info is None and "debug_info" in self.model_fields_set:
|
|
143
|
+
_dict['debug_info'] = None
|
|
144
|
+
|
|
145
|
+
# set to None if number_of_resources (nullable) is None
|
|
146
|
+
# and model_fields_set contains the field
|
|
147
|
+
if self.number_of_resources is None and "number_of_resources" in self.model_fields_set:
|
|
148
|
+
_dict['number_of_resources'] = None
|
|
149
|
+
|
|
150
|
+
# set to None if entry_point (nullable) is None
|
|
151
|
+
# and model_fields_set contains the field
|
|
152
|
+
if self.entry_point is None and "entry_point" in self.model_fields_set:
|
|
153
|
+
_dict['entry_point'] = None
|
|
154
|
+
|
|
155
|
+
# set to None if signature (nullable) is None
|
|
156
|
+
# and model_fields_set contains the field
|
|
157
|
+
if self.signature is None and "signature" in self.model_fields_set:
|
|
158
|
+
_dict['signature'] = None
|
|
159
|
+
|
|
160
|
+
# set to None if sections (nullable) is None
|
|
161
|
+
# and model_fields_set contains the field
|
|
162
|
+
if self.sections is None and "sections" in self.model_fields_set:
|
|
163
|
+
_dict['sections'] = None
|
|
164
|
+
|
|
165
|
+
# set to None if imports (nullable) is None
|
|
166
|
+
# and model_fields_set contains the field
|
|
167
|
+
if self.imports is None and "imports" in self.model_fields_set:
|
|
168
|
+
_dict['imports'] = None
|
|
169
|
+
|
|
170
|
+
# set to None if exports (nullable) is None
|
|
171
|
+
# and model_fields_set contains the field
|
|
172
|
+
if self.exports is None and "exports" in self.model_fields_set:
|
|
173
|
+
_dict['exports'] = None
|
|
174
|
+
|
|
175
|
+
# set to None if icon_data (nullable) is None
|
|
176
|
+
# and model_fields_set contains the field
|
|
177
|
+
if self.icon_data is None and "icon_data" in self.model_fields_set:
|
|
178
|
+
_dict['icon_data'] = None
|
|
179
|
+
|
|
180
|
+
return _dict
|
|
181
|
+
|
|
182
|
+
@classmethod
|
|
183
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
184
|
+
"""Create an instance of PEModel from a dict"""
|
|
185
|
+
if obj is None:
|
|
186
|
+
return None
|
|
187
|
+
|
|
188
|
+
if not isinstance(obj, dict):
|
|
189
|
+
return cls.model_validate(obj)
|
|
190
|
+
|
|
191
|
+
_obj = cls.model_validate({
|
|
192
|
+
"type": obj.get("type"),
|
|
193
|
+
"timestamps": TimestampModel.from_dict(obj["timestamps"]) if obj.get("timestamps") is not None else None,
|
|
194
|
+
"architecture": obj.get("architecture"),
|
|
195
|
+
"checksum": obj.get("checksum"),
|
|
196
|
+
"image_base": obj.get("image_base"),
|
|
197
|
+
"security": SecurityModel.from_dict(obj["security"]) if obj.get("security") is not None else None,
|
|
198
|
+
"version_info": obj.get("version_info"),
|
|
199
|
+
"debug_info": PDBDebugModel.from_dict(obj["debug_info"]) if obj.get("debug_info") is not None else None,
|
|
200
|
+
"number_of_resources": obj.get("number_of_resources"),
|
|
201
|
+
"entry_point": EntrypointModel.from_dict(obj["entry_point"]) if obj.get("entry_point") is not None else None,
|
|
202
|
+
"signature": CodeSignatureModel.from_dict(obj["signature"]) if obj.get("signature") is not None else None,
|
|
203
|
+
"dotnet": obj.get("dotnet"),
|
|
204
|
+
"debug_stripped": obj.get("debug_stripped"),
|
|
205
|
+
"import_hash": obj.get("import_hash"),
|
|
206
|
+
"export_hash": obj.get("export_hash"),
|
|
207
|
+
"rich_header_hash": obj.get("rich_header_hash"),
|
|
208
|
+
"sections": SectionModel.from_dict(obj["sections"]) if obj.get("sections") is not None else None,
|
|
209
|
+
"imports": ImportModel.from_dict(obj["imports"]) if obj.get("imports") is not None else None,
|
|
210
|
+
"exports": ExportModel.from_dict(obj["exports"]) if obj.get("exports") is not None else None,
|
|
211
|
+
"icon_data": IconModel.from_dict(obj["icon_data"]) if obj.get("icon_data") is not None else None
|
|
212
|
+
})
|
|
213
|
+
return _obj
|
|
214
|
+
|
|
215
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
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 json
|
|
16
|
+
from enum import Enum
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Platform(str, Enum):
|
|
21
|
+
"""
|
|
22
|
+
Platform
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
allowed enum values
|
|
27
|
+
"""
|
|
28
|
+
LINUX = 'linux'
|
|
29
|
+
WINDOWS = 'windows'
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def from_json(cls, json_str: str) -> Self:
|
|
33
|
+
"""Create an instance of Platform from a JSON string"""
|
|
34
|
+
return cls(json.loads(json_str))
|
|
35
|
+
|
|
36
|
+
|
|
@@ -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, StrictFloat, StrictInt, StrictStr
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class Process(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Process
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
pid: StrictInt
|
|
29
|
+
procname: StrictStr
|
|
30
|
+
executable_name: StrictStr
|
|
31
|
+
args: List[StrictStr]
|
|
32
|
+
ts_from: Union[StrictFloat, StrictInt]
|
|
33
|
+
ts_to: Optional[Union[StrictFloat, StrictInt]]
|
|
34
|
+
children: List[Any]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["pid", "procname", "executable_name", "args", "ts_from", "ts_to", "children"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of Process from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# set to None if ts_to (nullable) is None
|
|
77
|
+
# and model_fields_set contains the field
|
|
78
|
+
if self.ts_to is None and "ts_to" in self.model_fields_set:
|
|
79
|
+
_dict['ts_to'] = None
|
|
80
|
+
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of Process from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"pid": obj.get("pid"),
|
|
94
|
+
"procname": obj.get("procname"),
|
|
95
|
+
"executable_name": obj.get("executable_name"),
|
|
96
|
+
"args": obj.get("args"),
|
|
97
|
+
"ts_from": obj.get("ts_from"),
|
|
98
|
+
"ts_to": obj.get("ts_to"),
|
|
99
|
+
"children": obj.get("children")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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, StrictInt, StrictStr
|
|
20
|
+
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from revengai.models.process_dump_metadata import ProcessDumpMetadata
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ProcessDump(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ProcessDump
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
base_address: StrictInt
|
|
30
|
+
actual_filename: StrictStr
|
|
31
|
+
filename_friendly: StrictStr
|
|
32
|
+
extended_metadata: ProcessDumpMetadata
|
|
33
|
+
__properties: ClassVar[List[str]] = ["base_address", "actual_filename", "filename_friendly", "extended_metadata"]
|
|
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 ProcessDump 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 extended_metadata
|
|
75
|
+
if self.extended_metadata:
|
|
76
|
+
_dict['extended_metadata'] = self.extended_metadata.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of ProcessDump from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"base_address": obj.get("base_address"),
|
|
90
|
+
"actual_filename": obj.get("actual_filename"),
|
|
91
|
+
"filename_friendly": obj.get("filename_friendly"),
|
|
92
|
+
"extended_metadata": ProcessDumpMetadata.from_dict(obj["extended_metadata"]) if obj.get("extended_metadata") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -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, 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 ProcessDumpMetadata(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
ProcessDumpMetadata
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
sha256: StrictStr
|
|
29
|
+
type: StrictStr
|
|
30
|
+
size: StrictInt
|
|
31
|
+
__properties: ClassVar[List[str]] = ["sha256", "type", "size"]
|
|
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 ProcessDumpMetadata 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 ProcessDumpMetadata 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
|
+
"sha256": obj.get("sha256"),
|
|
85
|
+
"type": obj.get("type"),
|
|
86
|
+
"size": obj.get("size")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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, StrictBool
|
|
20
|
+
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from revengai.models.process_dumps_data import ProcessDumpsData
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ProcessDumps(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ProcessDumps
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
success: StrictBool
|
|
30
|
+
data: ProcessDumpsData
|
|
31
|
+
__properties: ClassVar[List[str]] = ["success", "data"]
|
|
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 ProcessDumps 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
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
73
|
+
if self.data:
|
|
74
|
+
_dict['data'] = self.data.to_dict()
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of ProcessDumps from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"success": obj.get("success"),
|
|
88
|
+
"data": ProcessDumpsData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|