hiddenlayer-sdk 2.0.9__py3-none-any.whl → 3.0.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.
- hiddenlayer/__init__.py +109 -105
- hiddenlayer/_base_client.py +1995 -0
- hiddenlayer/_client.py +761 -0
- hiddenlayer/_compat.py +219 -0
- hiddenlayer/_constants.py +14 -0
- hiddenlayer/_exceptions.py +108 -0
- hiddenlayer/_files.py +123 -0
- hiddenlayer/_models.py +835 -0
- hiddenlayer/_oauth2.py +118 -0
- hiddenlayer/_qs.py +150 -0
- hiddenlayer/_resource.py +43 -0
- hiddenlayer/_response.py +832 -0
- hiddenlayer/_streaming.py +333 -0
- hiddenlayer/_types.py +260 -0
- hiddenlayer/_utils/__init__.py +64 -0
- hiddenlayer/_utils/_compat.py +45 -0
- hiddenlayer/_utils/_datetime_parse.py +136 -0
- hiddenlayer/_utils/_logs.py +25 -0
- hiddenlayer/_utils/_proxy.py +65 -0
- hiddenlayer/_utils/_reflection.py +42 -0
- hiddenlayer/_utils/_resources_proxy.py +24 -0
- hiddenlayer/_utils/_streams.py +12 -0
- hiddenlayer/_utils/_sync.py +86 -0
- hiddenlayer/_utils/_transform.py +457 -0
- hiddenlayer/_utils/_typing.py +156 -0
- hiddenlayer/_utils/_utils.py +421 -0
- hiddenlayer/_version.py +4 -0
- hiddenlayer/lib/.keep +4 -0
- hiddenlayer/lib/__init__.py +6 -0
- hiddenlayer/lib/community_scan.py +174 -0
- hiddenlayer/lib/model_scan.py +752 -0
- hiddenlayer/lib/scan_utils.py +142 -0
- hiddenlayer/pagination.py +127 -0
- hiddenlayer/resources/__init__.py +75 -0
- hiddenlayer/resources/interactions.py +205 -0
- hiddenlayer/resources/models/__init__.py +33 -0
- hiddenlayer/resources/models/cards.py +259 -0
- hiddenlayer/resources/models/models.py +284 -0
- hiddenlayer/resources/prompt_analyzer.py +207 -0
- hiddenlayer/resources/scans/__init__.py +61 -0
- hiddenlayer/resources/scans/jobs.py +499 -0
- hiddenlayer/resources/scans/results.py +169 -0
- hiddenlayer/resources/scans/scans.py +166 -0
- hiddenlayer/resources/scans/upload/__init__.py +33 -0
- hiddenlayer/resources/scans/upload/file.py +279 -0
- hiddenlayer/resources/scans/upload/upload.py +340 -0
- hiddenlayer/resources/sensors.py +575 -0
- hiddenlayer/types/__init__.py +16 -0
- hiddenlayer/types/interaction_analyze_params.py +62 -0
- hiddenlayer/types/interaction_analyze_response.py +199 -0
- hiddenlayer/types/model_retrieve_response.py +50 -0
- hiddenlayer/types/models/__init__.py +6 -0
- hiddenlayer/types/models/card_list_params.py +65 -0
- hiddenlayer/types/models/card_list_response.py +50 -0
- hiddenlayer/types/prompt_analyzer_create_params.py +23 -0
- hiddenlayer/types/prompt_analyzer_create_response.py +381 -0
- hiddenlayer/types/scans/__init__.py +14 -0
- hiddenlayer/types/scans/job_list_params.py +75 -0
- hiddenlayer/types/scans/job_list_response.py +22 -0
- hiddenlayer/types/scans/job_request_params.py +49 -0
- hiddenlayer/types/scans/job_retrieve_params.py +16 -0
- hiddenlayer/types/scans/result_sarif_response.py +7 -0
- hiddenlayer/types/scans/scan_job.py +46 -0
- hiddenlayer/types/scans/scan_report.py +367 -0
- hiddenlayer/types/scans/upload/__init__.py +6 -0
- hiddenlayer/types/scans/upload/file_add_response.py +24 -0
- hiddenlayer/types/scans/upload/file_complete_response.py +12 -0
- hiddenlayer/types/scans/upload_complete_all_response.py +12 -0
- hiddenlayer/types/scans/upload_start_params.py +34 -0
- hiddenlayer/types/scans/upload_start_response.py +12 -0
- hiddenlayer/types/sensor_create_params.py +24 -0
- hiddenlayer/types/sensor_create_response.py +33 -0
- hiddenlayer/types/sensor_query_params.py +39 -0
- hiddenlayer/types/sensor_query_response.py +43 -0
- hiddenlayer/types/sensor_retrieve_response.py +33 -0
- hiddenlayer/types/sensor_update_params.py +20 -0
- hiddenlayer/types/sensor_update_response.py +9 -0
- hiddenlayer_sdk-3.0.0.dist-info/METADATA +431 -0
- hiddenlayer_sdk-3.0.0.dist-info/RECORD +82 -0
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/WHEEL +1 -2
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/licenses/LICENSE +1 -1
- hiddenlayer/sdk/constants.py +0 -26
- hiddenlayer/sdk/exceptions.py +0 -12
- hiddenlayer/sdk/models.py +0 -58
- hiddenlayer/sdk/rest/__init__.py +0 -135
- hiddenlayer/sdk/rest/api/__init__.py +0 -10
- hiddenlayer/sdk/rest/api/aidr_predictive_api.py +0 -308
- hiddenlayer/sdk/rest/api/health_api.py +0 -272
- hiddenlayer/sdk/rest/api/model_api.py +0 -559
- hiddenlayer/sdk/rest/api/model_supply_chain_api.py +0 -4063
- hiddenlayer/sdk/rest/api/readiness_api.py +0 -272
- hiddenlayer/sdk/rest/api/sensor_api.py +0 -1432
- hiddenlayer/sdk/rest/api_client.py +0 -770
- hiddenlayer/sdk/rest/api_response.py +0 -21
- hiddenlayer/sdk/rest/configuration.py +0 -445
- hiddenlayer/sdk/rest/exceptions.py +0 -199
- hiddenlayer/sdk/rest/models/__init__.py +0 -113
- hiddenlayer/sdk/rest/models/address.py +0 -110
- hiddenlayer/sdk/rest/models/artifact.py +0 -155
- hiddenlayer/sdk/rest/models/artifact_change.py +0 -108
- hiddenlayer/sdk/rest/models/artifact_content.py +0 -101
- hiddenlayer/sdk/rest/models/artifact_location.py +0 -109
- hiddenlayer/sdk/rest/models/attachment.py +0 -129
- hiddenlayer/sdk/rest/models/begin_multi_file_upload200_response.py +0 -87
- hiddenlayer/sdk/rest/models/begin_multipart_file_upload200_response.py +0 -97
- hiddenlayer/sdk/rest/models/begin_multipart_file_upload200_response_parts_inner.py +0 -94
- hiddenlayer/sdk/rest/models/code_flow.py +0 -113
- hiddenlayer/sdk/rest/models/configuration_override.py +0 -108
- hiddenlayer/sdk/rest/models/conversion.py +0 -114
- hiddenlayer/sdk/rest/models/create_sensor_request.py +0 -95
- hiddenlayer/sdk/rest/models/edge.py +0 -108
- hiddenlayer/sdk/rest/models/edge_traversal.py +0 -122
- hiddenlayer/sdk/rest/models/errors_inner.py +0 -91
- hiddenlayer/sdk/rest/models/exception.py +0 -113
- hiddenlayer/sdk/rest/models/external_properties.py +0 -273
- hiddenlayer/sdk/rest/models/external_property_file_reference.py +0 -102
- hiddenlayer/sdk/rest/models/external_property_file_references.py +0 -240
- hiddenlayer/sdk/rest/models/file_details_v3.py +0 -139
- hiddenlayer/sdk/rest/models/file_result_v3.py +0 -117
- hiddenlayer/sdk/rest/models/file_scan_report_v3.py +0 -132
- hiddenlayer/sdk/rest/models/file_scan_reports_v3.py +0 -95
- hiddenlayer/sdk/rest/models/fix.py +0 -113
- hiddenlayer/sdk/rest/models/get_condensed_model_scan_reports200_response.py +0 -102
- hiddenlayer/sdk/rest/models/graph.py +0 -123
- hiddenlayer/sdk/rest/models/graph_traversal.py +0 -97
- hiddenlayer/sdk/rest/models/inventory_v3.py +0 -101
- hiddenlayer/sdk/rest/models/invocation.py +0 -199
- hiddenlayer/sdk/rest/models/location.py +0 -146
- hiddenlayer/sdk/rest/models/location_inner.py +0 -138
- hiddenlayer/sdk/rest/models/location_relationship.py +0 -107
- hiddenlayer/sdk/rest/models/logical_location.py +0 -104
- hiddenlayer/sdk/rest/models/message.py +0 -92
- hiddenlayer/sdk/rest/models/mitre_atlas_inner.py +0 -110
- hiddenlayer/sdk/rest/models/model.py +0 -103
- hiddenlayer/sdk/rest/models/model_inventory_info.py +0 -103
- hiddenlayer/sdk/rest/models/model_version.py +0 -97
- hiddenlayer/sdk/rest/models/multi_file_upload_request_v3.py +0 -97
- hiddenlayer/sdk/rest/models/multiformat_message_string.py +0 -95
- hiddenlayer/sdk/rest/models/node.py +0 -122
- hiddenlayer/sdk/rest/models/notification.py +0 -157
- hiddenlayer/sdk/rest/models/notify_model_scan_completed200_response.py +0 -87
- hiddenlayer/sdk/rest/models/paged_response_with_total.py +0 -94
- hiddenlayer/sdk/rest/models/pagination_v3.py +0 -95
- hiddenlayer/sdk/rest/models/physical_location.py +0 -94
- hiddenlayer/sdk/rest/models/problem_details.py +0 -103
- hiddenlayer/sdk/rest/models/property_bag.py +0 -101
- hiddenlayer/sdk/rest/models/rectangle.py +0 -110
- hiddenlayer/sdk/rest/models/region.py +0 -127
- hiddenlayer/sdk/rest/models/replacement.py +0 -103
- hiddenlayer/sdk/rest/models/reporting_configuration.py +0 -113
- hiddenlayer/sdk/rest/models/reporting_descriptor.py +0 -162
- hiddenlayer/sdk/rest/models/reporting_descriptor_reference.py +0 -103
- hiddenlayer/sdk/rest/models/reporting_descriptor_relationship.py +0 -115
- hiddenlayer/sdk/rest/models/result.py +0 -312
- hiddenlayer/sdk/rest/models/result_provenance.py +0 -133
- hiddenlayer/sdk/rest/models/rule_details_inner.py +0 -102
- hiddenlayer/sdk/rest/models/run.py +0 -318
- hiddenlayer/sdk/rest/models/run_automation_details.py +0 -129
- hiddenlayer/sdk/rest/models/sarif210.py +0 -123
- hiddenlayer/sdk/rest/models/scan_create_request.py +0 -87
- hiddenlayer/sdk/rest/models/scan_detection_v3.py +0 -159
- hiddenlayer/sdk/rest/models/scan_detection_v31.py +0 -158
- hiddenlayer/sdk/rest/models/scan_header_v3.py +0 -129
- hiddenlayer/sdk/rest/models/scan_job.py +0 -115
- hiddenlayer/sdk/rest/models/scan_job_access.py +0 -97
- hiddenlayer/sdk/rest/models/scan_model_details_v3.py +0 -99
- hiddenlayer/sdk/rest/models/scan_model_details_v31.py +0 -97
- hiddenlayer/sdk/rest/models/scan_model_ids_v3.py +0 -89
- hiddenlayer/sdk/rest/models/scan_report_v3.py +0 -139
- hiddenlayer/sdk/rest/models/scan_results_map_v3.py +0 -105
- hiddenlayer/sdk/rest/models/scan_results_v3.py +0 -120
- hiddenlayer/sdk/rest/models/security_posture.py +0 -89
- hiddenlayer/sdk/rest/models/sensor.py +0 -100
- hiddenlayer/sdk/rest/models/sensor_query_response.py +0 -101
- hiddenlayer/sdk/rest/models/sensor_sor_model_card_query_response.py +0 -101
- hiddenlayer/sdk/rest/models/sensor_sor_model_card_response.py +0 -127
- hiddenlayer/sdk/rest/models/sensor_sor_query_filter.py +0 -108
- hiddenlayer/sdk/rest/models/sensor_sor_query_request.py +0 -109
- hiddenlayer/sdk/rest/models/special_locations.py +0 -97
- hiddenlayer/sdk/rest/models/stack.py +0 -113
- hiddenlayer/sdk/rest/models/stack_frame.py +0 -104
- hiddenlayer/sdk/rest/models/submission_response.py +0 -95
- hiddenlayer/sdk/rest/models/submission_v2.py +0 -109
- hiddenlayer/sdk/rest/models/suppression.py +0 -133
- hiddenlayer/sdk/rest/models/thread_flow.py +0 -144
- hiddenlayer/sdk/rest/models/thread_flow_location.py +0 -166
- hiddenlayer/sdk/rest/models/tool.py +0 -107
- hiddenlayer/sdk/rest/models/tool_component.py +0 -251
- hiddenlayer/sdk/rest/models/tool_component_reference.py +0 -108
- hiddenlayer/sdk/rest/models/translation_metadata.py +0 -110
- hiddenlayer/sdk/rest/models/validation_error_model.py +0 -99
- hiddenlayer/sdk/rest/models/version_control_details.py +0 -108
- hiddenlayer/sdk/rest/models/web_request.py +0 -112
- hiddenlayer/sdk/rest/models/web_response.py +0 -112
- hiddenlayer/sdk/rest/rest.py +0 -257
- hiddenlayer/sdk/services/__init__.py +0 -0
- hiddenlayer/sdk/services/aidr_predictive.py +0 -130
- hiddenlayer/sdk/services/model_scan.py +0 -505
- hiddenlayer/sdk/utils.py +0 -92
- hiddenlayer/sdk/version.py +0 -1
- hiddenlayer_sdk-2.0.9.dist-info/METADATA +0 -368
- hiddenlayer_sdk-2.0.9.dist-info/RECORD +0 -126
- hiddenlayer_sdk-2.0.9.dist-info/top_level.txt +0 -1
- /hiddenlayer/{sdk/__init__.py → py.typed} +0 -0
@@ -1,240 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
HiddenLayer-API
|
5
|
-
|
6
|
-
HiddenLayer-API
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 1
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import pprint
|
17
|
-
import re # noqa: F401
|
18
|
-
import json
|
19
|
-
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing_extensions import Annotated
|
23
|
-
from hiddenlayer.sdk.rest.models.external_property_file_reference import ExternalPropertyFileReference
|
24
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
class ExternalPropertyFileReferences(BaseModel):
|
29
|
-
"""
|
30
|
-
References to external property files that should be inlined with the content of a root log file.
|
31
|
-
""" # noqa: E501
|
32
|
-
conversion: Optional[ExternalPropertyFileReference] = None
|
33
|
-
graphs: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing a run.graphs object to be merged with the root log file.")
|
34
|
-
externalized_properties: Optional[ExternalPropertyFileReference] = Field(default=None, alias="externalizedProperties")
|
35
|
-
artifacts: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.artifacts arrays to be merged with the root log file.")
|
36
|
-
invocations: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.invocations arrays to be merged with the root log file.")
|
37
|
-
logical_locations: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.logicalLocations arrays to be merged with the root log file.", alias="logicalLocations")
|
38
|
-
thread_flow_locations: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.", alias="threadFlowLocations")
|
39
|
-
results: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.results arrays to be merged with the root log file.")
|
40
|
-
taxonomies: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.taxonomies arrays to be merged with the root log file.")
|
41
|
-
addresses: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.addresses arrays to be merged with the root log file.")
|
42
|
-
driver: Optional[ExternalPropertyFileReference] = None
|
43
|
-
extensions: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.extensions arrays to be merged with the root log file.")
|
44
|
-
policies: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.policies arrays to be merged with the root log file.")
|
45
|
-
translations: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.translations arrays to be merged with the root log file.")
|
46
|
-
web_requests: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.requests arrays to be merged with the root log file.", alias="webRequests")
|
47
|
-
web_responses: Optional[Annotated[List[Optional[ExternalPropertyFileReference]], Field(min_length=0)]] = Field(default=None, description="An array of external property files containing run.responses arrays to be merged with the root log file.", alias="webResponses")
|
48
|
-
properties: Optional[PropertyBag] = None
|
49
|
-
__properties: ClassVar[List[str]] = ["conversion", "graphs", "externalizedProperties", "artifacts", "invocations", "logicalLocations", "threadFlowLocations", "results", "taxonomies", "addresses", "driver", "extensions", "policies", "translations", "webRequests", "webResponses", "properties"]
|
50
|
-
|
51
|
-
model_config = ConfigDict(
|
52
|
-
populate_by_name=True,
|
53
|
-
validate_assignment=True,
|
54
|
-
protected_namespaces=(),
|
55
|
-
)
|
56
|
-
|
57
|
-
|
58
|
-
def to_str(self) -> str:
|
59
|
-
"""Returns the string representation of the model using alias"""
|
60
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
61
|
-
|
62
|
-
def to_json(self) -> str:
|
63
|
-
"""Returns the JSON representation of the model using alias"""
|
64
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
65
|
-
return json.dumps(self.to_dict())
|
66
|
-
|
67
|
-
@classmethod
|
68
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
69
|
-
"""Create an instance of ExternalPropertyFileReferences from a JSON string"""
|
70
|
-
return cls.from_dict(json.loads(json_str))
|
71
|
-
|
72
|
-
def to_dict(self) -> Dict[str, Any]:
|
73
|
-
"""Return the dictionary representation of the model using alias.
|
74
|
-
|
75
|
-
This has the following differences from calling pydantic's
|
76
|
-
`self.model_dump(by_alias=True)`:
|
77
|
-
|
78
|
-
* `None` is only added to the output dict for nullable fields that
|
79
|
-
were set at model initialization. Other fields with value `None`
|
80
|
-
are ignored.
|
81
|
-
"""
|
82
|
-
excluded_fields: Set[str] = set([
|
83
|
-
])
|
84
|
-
|
85
|
-
_dict = self.model_dump(
|
86
|
-
by_alias=True,
|
87
|
-
exclude=excluded_fields,
|
88
|
-
exclude_none=True,
|
89
|
-
)
|
90
|
-
# override the default output from pydantic by calling `to_dict()` of conversion
|
91
|
-
if self.conversion:
|
92
|
-
_dict['conversion'] = self.conversion.to_dict()
|
93
|
-
# override the default output from pydantic by calling `to_dict()` of each item in graphs (list)
|
94
|
-
_items = []
|
95
|
-
if self.graphs:
|
96
|
-
for _item in self.graphs:
|
97
|
-
if _item:
|
98
|
-
_items.append(_item.to_dict())
|
99
|
-
_dict['graphs'] = _items
|
100
|
-
# override the default output from pydantic by calling `to_dict()` of externalized_properties
|
101
|
-
if self.externalized_properties:
|
102
|
-
_dict['externalizedProperties'] = self.externalized_properties.to_dict()
|
103
|
-
# override the default output from pydantic by calling `to_dict()` of each item in artifacts (list)
|
104
|
-
_items = []
|
105
|
-
if self.artifacts:
|
106
|
-
for _item in self.artifacts:
|
107
|
-
if _item:
|
108
|
-
_items.append(_item.to_dict())
|
109
|
-
_dict['artifacts'] = _items
|
110
|
-
# override the default output from pydantic by calling `to_dict()` of each item in invocations (list)
|
111
|
-
_items = []
|
112
|
-
if self.invocations:
|
113
|
-
for _item in self.invocations:
|
114
|
-
if _item:
|
115
|
-
_items.append(_item.to_dict())
|
116
|
-
_dict['invocations'] = _items
|
117
|
-
# override the default output from pydantic by calling `to_dict()` of each item in logical_locations (list)
|
118
|
-
_items = []
|
119
|
-
if self.logical_locations:
|
120
|
-
for _item in self.logical_locations:
|
121
|
-
if _item:
|
122
|
-
_items.append(_item.to_dict())
|
123
|
-
_dict['logicalLocations'] = _items
|
124
|
-
# override the default output from pydantic by calling `to_dict()` of each item in thread_flow_locations (list)
|
125
|
-
_items = []
|
126
|
-
if self.thread_flow_locations:
|
127
|
-
for _item in self.thread_flow_locations:
|
128
|
-
if _item:
|
129
|
-
_items.append(_item.to_dict())
|
130
|
-
_dict['threadFlowLocations'] = _items
|
131
|
-
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
132
|
-
_items = []
|
133
|
-
if self.results:
|
134
|
-
for _item in self.results:
|
135
|
-
if _item:
|
136
|
-
_items.append(_item.to_dict())
|
137
|
-
_dict['results'] = _items
|
138
|
-
# override the default output from pydantic by calling `to_dict()` of each item in taxonomies (list)
|
139
|
-
_items = []
|
140
|
-
if self.taxonomies:
|
141
|
-
for _item in self.taxonomies:
|
142
|
-
if _item:
|
143
|
-
_items.append(_item.to_dict())
|
144
|
-
_dict['taxonomies'] = _items
|
145
|
-
# override the default output from pydantic by calling `to_dict()` of each item in addresses (list)
|
146
|
-
_items = []
|
147
|
-
if self.addresses:
|
148
|
-
for _item in self.addresses:
|
149
|
-
if _item:
|
150
|
-
_items.append(_item.to_dict())
|
151
|
-
_dict['addresses'] = _items
|
152
|
-
# override the default output from pydantic by calling `to_dict()` of driver
|
153
|
-
if self.driver:
|
154
|
-
_dict['driver'] = self.driver.to_dict()
|
155
|
-
# override the default output from pydantic by calling `to_dict()` of each item in extensions (list)
|
156
|
-
_items = []
|
157
|
-
if self.extensions:
|
158
|
-
for _item in self.extensions:
|
159
|
-
if _item:
|
160
|
-
_items.append(_item.to_dict())
|
161
|
-
_dict['extensions'] = _items
|
162
|
-
# override the default output from pydantic by calling `to_dict()` of each item in policies (list)
|
163
|
-
_items = []
|
164
|
-
if self.policies:
|
165
|
-
for _item in self.policies:
|
166
|
-
if _item:
|
167
|
-
_items.append(_item.to_dict())
|
168
|
-
_dict['policies'] = _items
|
169
|
-
# override the default output from pydantic by calling `to_dict()` of each item in translations (list)
|
170
|
-
_items = []
|
171
|
-
if self.translations:
|
172
|
-
for _item in self.translations:
|
173
|
-
if _item:
|
174
|
-
_items.append(_item.to_dict())
|
175
|
-
_dict['translations'] = _items
|
176
|
-
# override the default output from pydantic by calling `to_dict()` of each item in web_requests (list)
|
177
|
-
_items = []
|
178
|
-
if self.web_requests:
|
179
|
-
for _item in self.web_requests:
|
180
|
-
if _item:
|
181
|
-
_items.append(_item.to_dict())
|
182
|
-
_dict['webRequests'] = _items
|
183
|
-
# override the default output from pydantic by calling `to_dict()` of each item in web_responses (list)
|
184
|
-
_items = []
|
185
|
-
if self.web_responses:
|
186
|
-
for _item in self.web_responses:
|
187
|
-
if _item:
|
188
|
-
_items.append(_item.to_dict())
|
189
|
-
_dict['webResponses'] = _items
|
190
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
191
|
-
if self.properties:
|
192
|
-
_dict['properties'] = self.properties.to_dict()
|
193
|
-
# set to None if conversion (nullable) is None
|
194
|
-
# and model_fields_set contains the field
|
195
|
-
if self.conversion is None and "conversion" in self.model_fields_set:
|
196
|
-
_dict['conversion'] = None
|
197
|
-
|
198
|
-
# set to None if externalized_properties (nullable) is None
|
199
|
-
# and model_fields_set contains the field
|
200
|
-
if self.externalized_properties is None and "externalized_properties" in self.model_fields_set:
|
201
|
-
_dict['externalizedProperties'] = None
|
202
|
-
|
203
|
-
# set to None if driver (nullable) is None
|
204
|
-
# and model_fields_set contains the field
|
205
|
-
if self.driver is None and "driver" in self.model_fields_set:
|
206
|
-
_dict['driver'] = None
|
207
|
-
|
208
|
-
return _dict
|
209
|
-
|
210
|
-
@classmethod
|
211
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
212
|
-
"""Create an instance of ExternalPropertyFileReferences from a dict"""
|
213
|
-
if obj is None:
|
214
|
-
return None
|
215
|
-
|
216
|
-
if not isinstance(obj, dict):
|
217
|
-
return cls.model_validate(obj)
|
218
|
-
|
219
|
-
_obj = cls.model_validate({
|
220
|
-
"conversion": ExternalPropertyFileReference.from_dict(obj["conversion"]) if obj.get("conversion") is not None else None,
|
221
|
-
"graphs": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["graphs"]] if obj.get("graphs") is not None else None,
|
222
|
-
"externalizedProperties": ExternalPropertyFileReference.from_dict(obj["externalizedProperties"]) if obj.get("externalizedProperties") is not None else None,
|
223
|
-
"artifacts": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["artifacts"]] if obj.get("artifacts") is not None else None,
|
224
|
-
"invocations": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["invocations"]] if obj.get("invocations") is not None else None,
|
225
|
-
"logicalLocations": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["logicalLocations"]] if obj.get("logicalLocations") is not None else None,
|
226
|
-
"threadFlowLocations": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["threadFlowLocations"]] if obj.get("threadFlowLocations") is not None else None,
|
227
|
-
"results": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None,
|
228
|
-
"taxonomies": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["taxonomies"]] if obj.get("taxonomies") is not None else None,
|
229
|
-
"addresses": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["addresses"]] if obj.get("addresses") is not None else None,
|
230
|
-
"driver": ExternalPropertyFileReference.from_dict(obj["driver"]) if obj.get("driver") is not None else None,
|
231
|
-
"extensions": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["extensions"]] if obj.get("extensions") is not None else None,
|
232
|
-
"policies": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["policies"]] if obj.get("policies") is not None else None,
|
233
|
-
"translations": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["translations"]] if obj.get("translations") is not None else None,
|
234
|
-
"webRequests": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["webRequests"]] if obj.get("webRequests") is not None else None,
|
235
|
-
"webResponses": [ExternalPropertyFileReference.from_dict(_item) for _item in obj["webResponses"]] if obj.get("webResponses") is not None else None,
|
236
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
237
|
-
})
|
238
|
-
return _obj
|
239
|
-
|
240
|
-
|
@@ -1,139 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
HiddenLayer-API
|
5
|
-
|
6
|
-
HiddenLayer-API
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 1
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import pprint
|
17
|
-
import re # noqa: F401
|
18
|
-
import json
|
19
|
-
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing_extensions import Annotated
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
class FileDetailsV3(BaseModel):
|
27
|
-
"""
|
28
|
-
FileDetailsV3
|
29
|
-
""" # noqa: E501
|
30
|
-
estimated_time: StrictStr = Field(description="estimated time to scan the file")
|
31
|
-
md5: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="hexadecimal md5 hash of file")
|
32
|
-
sha256: Annotated[str, Field(strict=True)] = Field(description="hexadecimal sha256 hash of file")
|
33
|
-
tlsh: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="TLSH hash of file")
|
34
|
-
file_size: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="size of the file in human readable format")
|
35
|
-
file_size_bytes: Optional[StrictInt] = Field(default=None, description="size of the file in bytes")
|
36
|
-
file_type: StrictStr = Field(description="type of the file")
|
37
|
-
file_type_details: Optional[Dict[str, Any]] = None
|
38
|
-
__properties: ClassVar[List[str]] = ["estimated_time", "md5", "sha256", "tlsh", "file_size", "file_size_bytes", "file_type", "file_type_details"]
|
39
|
-
|
40
|
-
@field_validator('md5')
|
41
|
-
def md5_validate_regular_expression(cls, value):
|
42
|
-
"""Validates the regular expression"""
|
43
|
-
if value is None:
|
44
|
-
return value
|
45
|
-
|
46
|
-
if not re.match(r"^[a-fA-F0-9]{32}$", value):
|
47
|
-
raise ValueError(r"must validate the regular expression /^[a-fA-F0-9]{32}$/")
|
48
|
-
return value
|
49
|
-
|
50
|
-
@field_validator('sha256')
|
51
|
-
def sha256_validate_regular_expression(cls, value):
|
52
|
-
"""Validates the regular expression"""
|
53
|
-
if not re.match(r"^$|^[a-fA-F0-9]{64}$", value):
|
54
|
-
raise ValueError(r"must validate the regular expression /^$|^[a-fA-F0-9]{64}$/")
|
55
|
-
return value
|
56
|
-
|
57
|
-
@field_validator('tlsh')
|
58
|
-
def tlsh_validate_regular_expression(cls, value):
|
59
|
-
"""Validates the regular expression"""
|
60
|
-
if value is None:
|
61
|
-
return value
|
62
|
-
|
63
|
-
if not re.match(r"^[a-fA-F0-9]{70}$", value):
|
64
|
-
raise ValueError(r"must validate the regular expression /^[a-fA-F0-9]{70}$/")
|
65
|
-
return value
|
66
|
-
|
67
|
-
@field_validator('file_size')
|
68
|
-
def file_size_validate_regular_expression(cls, value):
|
69
|
-
"""Validates the regular expression"""
|
70
|
-
if value is None:
|
71
|
-
return value
|
72
|
-
|
73
|
-
if not re.match(r"^\d+(\.\d+)?\s?(B|KB|MB|GB|TB)$", value):
|
74
|
-
raise ValueError(r"must validate the regular expression /^\d+(\.\d+)?\s?(B|KB|MB|GB|TB)$/")
|
75
|
-
return value
|
76
|
-
|
77
|
-
model_config = ConfigDict(
|
78
|
-
populate_by_name=True,
|
79
|
-
validate_assignment=True,
|
80
|
-
protected_namespaces=(),
|
81
|
-
)
|
82
|
-
|
83
|
-
|
84
|
-
def to_str(self) -> str:
|
85
|
-
"""Returns the string representation of the model using alias"""
|
86
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
87
|
-
|
88
|
-
def to_json(self) -> str:
|
89
|
-
"""Returns the JSON representation of the model using alias"""
|
90
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
91
|
-
return json.dumps(self.to_dict())
|
92
|
-
|
93
|
-
@classmethod
|
94
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
95
|
-
"""Create an instance of FileDetailsV3 from a JSON string"""
|
96
|
-
return cls.from_dict(json.loads(json_str))
|
97
|
-
|
98
|
-
def to_dict(self) -> Dict[str, Any]:
|
99
|
-
"""Return the dictionary representation of the model using alias.
|
100
|
-
|
101
|
-
This has the following differences from calling pydantic's
|
102
|
-
`self.model_dump(by_alias=True)`:
|
103
|
-
|
104
|
-
* `None` is only added to the output dict for nullable fields that
|
105
|
-
were set at model initialization. Other fields with value `None`
|
106
|
-
are ignored.
|
107
|
-
"""
|
108
|
-
excluded_fields: Set[str] = set([
|
109
|
-
])
|
110
|
-
|
111
|
-
_dict = self.model_dump(
|
112
|
-
by_alias=True,
|
113
|
-
exclude=excluded_fields,
|
114
|
-
exclude_none=True,
|
115
|
-
)
|
116
|
-
return _dict
|
117
|
-
|
118
|
-
@classmethod
|
119
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
120
|
-
"""Create an instance of FileDetailsV3 from a dict"""
|
121
|
-
if obj is None:
|
122
|
-
return None
|
123
|
-
|
124
|
-
if not isinstance(obj, dict):
|
125
|
-
return cls.model_validate(obj)
|
126
|
-
|
127
|
-
_obj = cls.model_validate({
|
128
|
-
"estimated_time": obj.get("estimated_time"),
|
129
|
-
"md5": obj.get("md5"),
|
130
|
-
"sha256": obj.get("sha256"),
|
131
|
-
"tlsh": obj.get("tlsh"),
|
132
|
-
"file_size": obj.get("file_size"),
|
133
|
-
"file_size_bytes": obj.get("file_size_bytes"),
|
134
|
-
"file_type": obj.get("file_type"),
|
135
|
-
"file_type_details": obj.get("file_type_details")
|
136
|
-
})
|
137
|
-
return _obj
|
138
|
-
|
139
|
-
|
@@ -1,117 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
HiddenLayer-API
|
5
|
-
|
6
|
-
HiddenLayer-API
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 1
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import pprint
|
17
|
-
import re # noqa: F401
|
18
|
-
import json
|
19
|
-
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from hiddenlayer.sdk.rest.models.scan_detection_v31 import ScanDetectionV31
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
class FileResultV3(BaseModel):
|
27
|
-
"""
|
28
|
-
FileResultV3
|
29
|
-
""" # noqa: E501
|
30
|
-
file_location: StrictStr
|
31
|
-
status: StrictStr
|
32
|
-
start_time: Optional[StrictInt] = None
|
33
|
-
end_time: Optional[StrictInt] = None
|
34
|
-
details: Optional[Dict[str, Any]] = None
|
35
|
-
seen: Optional[StrictInt] = None
|
36
|
-
detections: Optional[List[ScanDetectionV31]] = None
|
37
|
-
__properties: ClassVar[List[str]] = ["file_location", "status", "start_time", "end_time", "details", "seen", "detections"]
|
38
|
-
|
39
|
-
@field_validator('status')
|
40
|
-
def status_validate_enum(cls, value):
|
41
|
-
"""Validates the enum"""
|
42
|
-
if value not in set(['done', 'running', 'failed', 'pending', 'canceled', 'skipped']):
|
43
|
-
raise ValueError("must be one of enum values ('done', 'running', 'failed', 'pending', 'canceled', 'skipped')")
|
44
|
-
return value
|
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 FileResultV3 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 details
|
86
|
-
if self.details:
|
87
|
-
_dict['details'] = self.details.to_dict()
|
88
|
-
# override the default output from pydantic by calling `to_dict()` of each item in detections (list)
|
89
|
-
_items = []
|
90
|
-
if self.detections:
|
91
|
-
for _item in self.detections:
|
92
|
-
if _item:
|
93
|
-
_items.append(_item.to_dict())
|
94
|
-
_dict['detections'] = _items
|
95
|
-
return _dict
|
96
|
-
|
97
|
-
@classmethod
|
98
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
|
-
"""Create an instance of FileResultV3 from a dict"""
|
100
|
-
if obj is None:
|
101
|
-
return None
|
102
|
-
|
103
|
-
if not isinstance(obj, dict):
|
104
|
-
return cls.model_validate(obj)
|
105
|
-
|
106
|
-
_obj = cls.model_validate({
|
107
|
-
"file_location": obj.get("file_location"),
|
108
|
-
"status": obj.get("status"),
|
109
|
-
"start_time": obj.get("start_time"),
|
110
|
-
"end_time": obj.get("end_time"),
|
111
|
-
"details": FileDetailsV3.from_dict(obj["details"]) if obj.get("details") is not None else None,
|
112
|
-
"seen": obj.get("seen"),
|
113
|
-
"detections": [ScanDetectionV31.from_dict(_item) for _item in obj["detections"]] if obj.get("detections") is not None else None
|
114
|
-
})
|
115
|
-
return _obj
|
116
|
-
|
117
|
-
|
@@ -1,132 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
HiddenLayer-API
|
5
|
-
|
6
|
-
HiddenLayer-API
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 1
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
-
|
11
|
-
Do not edit the class manually.
|
12
|
-
""" # noqa: E501
|
13
|
-
|
14
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
import pprint
|
17
|
-
import re # noqa: F401
|
18
|
-
import json
|
19
|
-
|
20
|
-
from datetime import datetime
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
-
from hiddenlayer.sdk.rest.models.file_details_v3 import FileDetailsV3
|
24
|
-
from hiddenlayer.sdk.rest.models.scan_detection_v3 import ScanDetectionV3
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
class FileScanReportV3(BaseModel):
|
29
|
-
"""
|
30
|
-
FileScanReportV3
|
31
|
-
""" # noqa: E501
|
32
|
-
file_instance_id: StrictStr = Field(description="unique ID of the file")
|
33
|
-
file_location: StrictStr = Field(description="full file path")
|
34
|
-
start_time: datetime = Field(description="time the scan started")
|
35
|
-
end_time: datetime = Field(description="time the scan ended")
|
36
|
-
details: FileDetailsV3
|
37
|
-
status: StrictStr = Field(description="status of the scan")
|
38
|
-
seen: datetime = Field(description="time the scan was seen at")
|
39
|
-
detections: Optional[List[ScanDetectionV3]] = None
|
40
|
-
file_results: Optional[List[FileScanReportV3]] = None
|
41
|
-
__properties: ClassVar[List[str]] = ["file_instance_id", "file_location", "start_time", "end_time", "details", "status", "seen", "detections", "file_results"]
|
42
|
-
|
43
|
-
@field_validator('status')
|
44
|
-
def status_validate_enum(cls, value):
|
45
|
-
"""Validates the enum"""
|
46
|
-
if value not in set(['skipped', 'pending', 'running', 'done', 'failed', 'canceled']):
|
47
|
-
raise ValueError("must be one of enum values ('skipped', 'pending', 'running', 'done', 'failed', 'canceled')")
|
48
|
-
return value
|
49
|
-
|
50
|
-
model_config = ConfigDict(
|
51
|
-
populate_by_name=True,
|
52
|
-
validate_assignment=True,
|
53
|
-
protected_namespaces=(),
|
54
|
-
)
|
55
|
-
|
56
|
-
|
57
|
-
def to_str(self) -> str:
|
58
|
-
"""Returns the string representation of the model using alias"""
|
59
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
60
|
-
|
61
|
-
def to_json(self) -> str:
|
62
|
-
"""Returns the JSON representation of the model using alias"""
|
63
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
64
|
-
return json.dumps(self.to_dict())
|
65
|
-
|
66
|
-
@classmethod
|
67
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
68
|
-
"""Create an instance of FileScanReportV3 from a JSON string"""
|
69
|
-
return cls.from_dict(json.loads(json_str))
|
70
|
-
|
71
|
-
def to_dict(self) -> Dict[str, Any]:
|
72
|
-
"""Return the dictionary representation of the model using alias.
|
73
|
-
|
74
|
-
This has the following differences from calling pydantic's
|
75
|
-
`self.model_dump(by_alias=True)`:
|
76
|
-
|
77
|
-
* `None` is only added to the output dict for nullable fields that
|
78
|
-
were set at model initialization. Other fields with value `None`
|
79
|
-
are ignored.
|
80
|
-
"""
|
81
|
-
excluded_fields: Set[str] = set([
|
82
|
-
])
|
83
|
-
|
84
|
-
_dict = self.model_dump(
|
85
|
-
by_alias=True,
|
86
|
-
exclude=excluded_fields,
|
87
|
-
exclude_none=True,
|
88
|
-
)
|
89
|
-
# override the default output from pydantic by calling `to_dict()` of details
|
90
|
-
if self.details:
|
91
|
-
_dict['details'] = self.details.to_dict()
|
92
|
-
# override the default output from pydantic by calling `to_dict()` of each item in detections (list)
|
93
|
-
_items = []
|
94
|
-
if self.detections:
|
95
|
-
for _item in self.detections:
|
96
|
-
if _item:
|
97
|
-
_items.append(_item.to_dict())
|
98
|
-
_dict['detections'] = _items
|
99
|
-
# override the default output from pydantic by calling `to_dict()` of each item in file_results (list)
|
100
|
-
_items = []
|
101
|
-
if self.file_results:
|
102
|
-
for _item in self.file_results:
|
103
|
-
if _item:
|
104
|
-
_items.append(_item.to_dict())
|
105
|
-
_dict['file_results'] = _items
|
106
|
-
return _dict
|
107
|
-
|
108
|
-
@classmethod
|
109
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
110
|
-
"""Create an instance of FileScanReportV3 from a dict"""
|
111
|
-
if obj is None:
|
112
|
-
return None
|
113
|
-
|
114
|
-
if not isinstance(obj, dict):
|
115
|
-
return cls.model_validate(obj)
|
116
|
-
|
117
|
-
_obj = cls.model_validate({
|
118
|
-
"file_instance_id": obj.get("file_instance_id"),
|
119
|
-
"file_location": obj.get("file_location"),
|
120
|
-
"start_time": obj.get("start_time"),
|
121
|
-
"end_time": obj.get("end_time"),
|
122
|
-
"details": FileDetailsV3.from_dict(obj["details"]) if obj.get("details") is not None else None,
|
123
|
-
"status": obj.get("status"),
|
124
|
-
"seen": obj.get("seen"),
|
125
|
-
"detections": [ScanDetectionV3.from_dict(_item) for _item in obj["detections"]] if obj.get("detections") is not None else None,
|
126
|
-
"file_results": [FileScanReportV3.from_dict(_item) for _item in obj["file_results"]] if obj.get("file_results") is not None else None
|
127
|
-
})
|
128
|
-
return _obj
|
129
|
-
|
130
|
-
# TODO: Rewrite to not use raise_errors
|
131
|
-
FileScanReportV3.model_rebuild(raise_errors=False)
|
132
|
-
|