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,312 +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, StrictStr, field_validator
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
-
from typing_extensions import Annotated
|
23
|
-
from hiddenlayer.sdk.rest.models.artifact_location import ArtifactLocation
|
24
|
-
from hiddenlayer.sdk.rest.models.attachment import Attachment
|
25
|
-
from hiddenlayer.sdk.rest.models.code_flow import CodeFlow
|
26
|
-
from hiddenlayer.sdk.rest.models.fix import Fix
|
27
|
-
from hiddenlayer.sdk.rest.models.graph import Graph
|
28
|
-
from hiddenlayer.sdk.rest.models.graph_traversal import GraphTraversal
|
29
|
-
from hiddenlayer.sdk.rest.models.location import Location
|
30
|
-
from hiddenlayer.sdk.rest.models.message import Message
|
31
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
32
|
-
from hiddenlayer.sdk.rest.models.reporting_descriptor_reference import ReportingDescriptorReference
|
33
|
-
from hiddenlayer.sdk.rest.models.result_provenance import ResultProvenance
|
34
|
-
from hiddenlayer.sdk.rest.models.stack import Stack
|
35
|
-
from hiddenlayer.sdk.rest.models.suppression import Suppression
|
36
|
-
from hiddenlayer.sdk.rest.models.web_request import WebRequest
|
37
|
-
from hiddenlayer.sdk.rest.models.web_response import WebResponse
|
38
|
-
from typing import Optional, Set
|
39
|
-
from typing_extensions import Self
|
40
|
-
|
41
|
-
class Result(BaseModel):
|
42
|
-
"""
|
43
|
-
A result produced by an analysis tool.
|
44
|
-
""" # noqa: E501
|
45
|
-
rule_id: Optional[StrictStr] = Field(default=None, description="The stable, unique identifier of the rule, if any, to which this result is relevant.", alias="ruleId")
|
46
|
-
rule_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, description="The index within the tool component rules array of the rule object associated with this result.", alias="ruleIndex")
|
47
|
-
rule: Optional[ReportingDescriptorReference] = None
|
48
|
-
kind: Optional[StrictStr] = Field(default='fail', description="A value that categorizes results by evaluation state.")
|
49
|
-
level: Optional[StrictStr] = Field(default='warning', description="A value specifying the severity level of the result.")
|
50
|
-
message: Optional[Message]
|
51
|
-
analysis_target: Optional[ArtifactLocation] = Field(default=None, alias="analysisTarget")
|
52
|
-
locations: Optional[Annotated[List[Location], Field(min_length=0)]] = Field(default=None, description="The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.")
|
53
|
-
guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A stable, unique identifier for the result in the form of a GUID.")
|
54
|
-
correlation_guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.", alias="correlationGuid")
|
55
|
-
occurrence_count: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="A positive integer specifying the number of times this logically unique result was observed in this run.", alias="occurrenceCount")
|
56
|
-
partial_fingerprints: Optional[Dict[str, StrictStr]] = Field(default=None, description="A set of strings that contribute to the stable, unique identity of the result.", alias="partialFingerprints")
|
57
|
-
fingerprints: Optional[Dict[str, StrictStr]] = Field(default=None, description="A set of strings each of which individually defines a stable, unique identity for the result.")
|
58
|
-
stacks: Optional[Annotated[List[Stack], Field(min_length=0)]] = Field(default=None, description="An array of 'stack' objects relevant to the result.")
|
59
|
-
code_flows: Optional[Annotated[List[CodeFlow], Field(min_length=0)]] = Field(default=None, description="An array of 'codeFlow' objects relevant to the result.", alias="codeFlows")
|
60
|
-
graphs: Optional[Annotated[List[Graph], Field(min_length=0)]] = Field(default=None, description="An array of zero or more unique graph objects associated with the result.")
|
61
|
-
graph_traversals: Optional[Annotated[List[Optional[GraphTraversal]], Field(min_length=0)]] = Field(default=None, description="An array of one or more unique 'graphTraversal' objects.", alias="graphTraversals")
|
62
|
-
related_locations: Optional[Annotated[List[Location], Field(min_length=0)]] = Field(default=None, description="A set of locations relevant to this result.", alias="relatedLocations")
|
63
|
-
suppressions: Optional[Annotated[List[Suppression], Field(min_length=0)]] = Field(default=None, description="A set of suppressions relevant to this result.")
|
64
|
-
baseline_state: Optional[StrictStr] = Field(default=None, description="The state of a result relative to a baseline of a previous run.", alias="baselineState")
|
65
|
-
rank: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=-1)], Annotated[int, Field(le=100, strict=True, ge=-1)]]] = Field(default=-1, description="A number representing the priority or importance of the result.")
|
66
|
-
attachments: Optional[Annotated[List[Attachment], Field(min_length=0)]] = Field(default=None, description="A set of artifacts relevant to the result.")
|
67
|
-
hosted_viewer_uri: Optional[StrictStr] = Field(default=None, description="An absolute URI at which the result can be viewed.", alias="hostedViewerUri")
|
68
|
-
work_item_uris: Optional[Annotated[List[StrictStr], Field(min_length=0)]] = Field(default=None, description="The URIs of the work items associated with this result.", alias="workItemUris")
|
69
|
-
provenance: Optional[ResultProvenance] = None
|
70
|
-
fixes: Optional[Annotated[List[Fix], Field(min_length=0)]] = Field(default=None, description="An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.")
|
71
|
-
taxa: Optional[Annotated[List[Optional[ReportingDescriptorReference]], Field(min_length=0)]] = Field(default=None, description="An array of references to taxonomy reporting descriptors that are applicable to the result.")
|
72
|
-
web_request: Optional[WebRequest] = Field(default=None, alias="webRequest")
|
73
|
-
web_response: Optional[WebResponse] = Field(default=None, alias="webResponse")
|
74
|
-
properties: Optional[PropertyBag] = None
|
75
|
-
__properties: ClassVar[List[str]] = ["ruleId", "ruleIndex", "rule", "kind", "level", "message", "analysisTarget", "locations", "guid", "correlationGuid", "occurrenceCount", "partialFingerprints", "fingerprints", "stacks", "codeFlows", "graphs", "graphTraversals", "relatedLocations", "suppressions", "baselineState", "rank", "attachments", "hostedViewerUri", "workItemUris", "provenance", "fixes", "taxa", "webRequest", "webResponse", "properties"]
|
76
|
-
|
77
|
-
@field_validator('kind')
|
78
|
-
def kind_validate_enum(cls, value):
|
79
|
-
"""Validates the enum"""
|
80
|
-
if value is None:
|
81
|
-
return value
|
82
|
-
|
83
|
-
if value not in set(['notApplicable', 'pass', 'fail', 'review', 'open', 'informational']):
|
84
|
-
raise ValueError("must be one of enum values ('notApplicable', 'pass', 'fail', 'review', 'open', 'informational')")
|
85
|
-
return value
|
86
|
-
|
87
|
-
@field_validator('level')
|
88
|
-
def level_validate_enum(cls, value):
|
89
|
-
"""Validates the enum"""
|
90
|
-
if value is None:
|
91
|
-
return value
|
92
|
-
|
93
|
-
if value not in set(['none', 'note', 'warning', 'error']):
|
94
|
-
raise ValueError("must be one of enum values ('none', 'note', 'warning', 'error')")
|
95
|
-
return value
|
96
|
-
|
97
|
-
@field_validator('guid')
|
98
|
-
def guid_validate_regular_expression(cls, value):
|
99
|
-
"""Validates the regular expression"""
|
100
|
-
if value is None:
|
101
|
-
return value
|
102
|
-
|
103
|
-
if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
|
104
|
-
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
|
105
|
-
return value
|
106
|
-
|
107
|
-
@field_validator('correlation_guid')
|
108
|
-
def correlation_guid_validate_regular_expression(cls, value):
|
109
|
-
"""Validates the regular expression"""
|
110
|
-
if value is None:
|
111
|
-
return value
|
112
|
-
|
113
|
-
if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
|
114
|
-
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
|
115
|
-
return value
|
116
|
-
|
117
|
-
@field_validator('baseline_state')
|
118
|
-
def baseline_state_validate_enum(cls, value):
|
119
|
-
"""Validates the enum"""
|
120
|
-
if value is None:
|
121
|
-
return value
|
122
|
-
|
123
|
-
if value not in set(['new', 'unchanged', 'updated', 'absent']):
|
124
|
-
raise ValueError("must be one of enum values ('new', 'unchanged', 'updated', 'absent')")
|
125
|
-
return value
|
126
|
-
|
127
|
-
model_config = ConfigDict(
|
128
|
-
populate_by_name=True,
|
129
|
-
validate_assignment=True,
|
130
|
-
protected_namespaces=(),
|
131
|
-
)
|
132
|
-
|
133
|
-
|
134
|
-
def to_str(self) -> str:
|
135
|
-
"""Returns the string representation of the model using alias"""
|
136
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
137
|
-
|
138
|
-
def to_json(self) -> str:
|
139
|
-
"""Returns the JSON representation of the model using alias"""
|
140
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
141
|
-
return json.dumps(self.to_dict())
|
142
|
-
|
143
|
-
@classmethod
|
144
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
145
|
-
"""Create an instance of Result from a JSON string"""
|
146
|
-
return cls.from_dict(json.loads(json_str))
|
147
|
-
|
148
|
-
def to_dict(self) -> Dict[str, Any]:
|
149
|
-
"""Return the dictionary representation of the model using alias.
|
150
|
-
|
151
|
-
This has the following differences from calling pydantic's
|
152
|
-
`self.model_dump(by_alias=True)`:
|
153
|
-
|
154
|
-
* `None` is only added to the output dict for nullable fields that
|
155
|
-
were set at model initialization. Other fields with value `None`
|
156
|
-
are ignored.
|
157
|
-
"""
|
158
|
-
excluded_fields: Set[str] = set([
|
159
|
-
])
|
160
|
-
|
161
|
-
_dict = self.model_dump(
|
162
|
-
by_alias=True,
|
163
|
-
exclude=excluded_fields,
|
164
|
-
exclude_none=True,
|
165
|
-
)
|
166
|
-
# override the default output from pydantic by calling `to_dict()` of rule
|
167
|
-
if self.rule:
|
168
|
-
_dict['rule'] = self.rule.to_dict()
|
169
|
-
# override the default output from pydantic by calling `to_dict()` of message
|
170
|
-
if self.message:
|
171
|
-
_dict['message'] = self.message.to_dict()
|
172
|
-
# override the default output from pydantic by calling `to_dict()` of analysis_target
|
173
|
-
if self.analysis_target:
|
174
|
-
_dict['analysisTarget'] = self.analysis_target.to_dict()
|
175
|
-
# override the default output from pydantic by calling `to_dict()` of each item in locations (list)
|
176
|
-
_items = []
|
177
|
-
if self.locations:
|
178
|
-
for _item in self.locations:
|
179
|
-
if _item:
|
180
|
-
_items.append(_item.to_dict())
|
181
|
-
_dict['locations'] = _items
|
182
|
-
# override the default output from pydantic by calling `to_dict()` of each item in stacks (list)
|
183
|
-
_items = []
|
184
|
-
if self.stacks:
|
185
|
-
for _item in self.stacks:
|
186
|
-
if _item:
|
187
|
-
_items.append(_item.to_dict())
|
188
|
-
_dict['stacks'] = _items
|
189
|
-
# override the default output from pydantic by calling `to_dict()` of each item in code_flows (list)
|
190
|
-
_items = []
|
191
|
-
if self.code_flows:
|
192
|
-
for _item in self.code_flows:
|
193
|
-
if _item:
|
194
|
-
_items.append(_item.to_dict())
|
195
|
-
_dict['codeFlows'] = _items
|
196
|
-
# override the default output from pydantic by calling `to_dict()` of each item in graphs (list)
|
197
|
-
_items = []
|
198
|
-
if self.graphs:
|
199
|
-
for _item in self.graphs:
|
200
|
-
if _item:
|
201
|
-
_items.append(_item.to_dict())
|
202
|
-
_dict['graphs'] = _items
|
203
|
-
# override the default output from pydantic by calling `to_dict()` of each item in graph_traversals (list)
|
204
|
-
_items = []
|
205
|
-
if self.graph_traversals:
|
206
|
-
for _item in self.graph_traversals:
|
207
|
-
if _item:
|
208
|
-
_items.append(_item.to_dict())
|
209
|
-
_dict['graphTraversals'] = _items
|
210
|
-
# override the default output from pydantic by calling `to_dict()` of each item in related_locations (list)
|
211
|
-
_items = []
|
212
|
-
if self.related_locations:
|
213
|
-
for _item in self.related_locations:
|
214
|
-
if _item:
|
215
|
-
_items.append(_item.to_dict())
|
216
|
-
_dict['relatedLocations'] = _items
|
217
|
-
# override the default output from pydantic by calling `to_dict()` of each item in suppressions (list)
|
218
|
-
_items = []
|
219
|
-
if self.suppressions:
|
220
|
-
for _item in self.suppressions:
|
221
|
-
if _item:
|
222
|
-
_items.append(_item.to_dict())
|
223
|
-
_dict['suppressions'] = _items
|
224
|
-
# override the default output from pydantic by calling `to_dict()` of each item in attachments (list)
|
225
|
-
_items = []
|
226
|
-
if self.attachments:
|
227
|
-
for _item in self.attachments:
|
228
|
-
if _item:
|
229
|
-
_items.append(_item.to_dict())
|
230
|
-
_dict['attachments'] = _items
|
231
|
-
# override the default output from pydantic by calling `to_dict()` of provenance
|
232
|
-
if self.provenance:
|
233
|
-
_dict['provenance'] = self.provenance.to_dict()
|
234
|
-
# override the default output from pydantic by calling `to_dict()` of each item in fixes (list)
|
235
|
-
_items = []
|
236
|
-
if self.fixes:
|
237
|
-
for _item in self.fixes:
|
238
|
-
if _item:
|
239
|
-
_items.append(_item.to_dict())
|
240
|
-
_dict['fixes'] = _items
|
241
|
-
# override the default output from pydantic by calling `to_dict()` of each item in taxa (list)
|
242
|
-
_items = []
|
243
|
-
if self.taxa:
|
244
|
-
for _item in self.taxa:
|
245
|
-
if _item:
|
246
|
-
_items.append(_item.to_dict())
|
247
|
-
_dict['taxa'] = _items
|
248
|
-
# override the default output from pydantic by calling `to_dict()` of web_request
|
249
|
-
if self.web_request:
|
250
|
-
_dict['webRequest'] = self.web_request.to_dict()
|
251
|
-
# override the default output from pydantic by calling `to_dict()` of web_response
|
252
|
-
if self.web_response:
|
253
|
-
_dict['webResponse'] = self.web_response.to_dict()
|
254
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
255
|
-
if self.properties:
|
256
|
-
_dict['properties'] = self.properties.to_dict()
|
257
|
-
# set to None if rule (nullable) is None
|
258
|
-
# and model_fields_set contains the field
|
259
|
-
if self.rule is None and "rule" in self.model_fields_set:
|
260
|
-
_dict['rule'] = None
|
261
|
-
|
262
|
-
# set to None if message (nullable) is None
|
263
|
-
# and model_fields_set contains the field
|
264
|
-
if self.message is None and "message" in self.model_fields_set:
|
265
|
-
_dict['message'] = None
|
266
|
-
|
267
|
-
return _dict
|
268
|
-
|
269
|
-
@classmethod
|
270
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
271
|
-
"""Create an instance of Result from a dict"""
|
272
|
-
if obj is None:
|
273
|
-
return None
|
274
|
-
|
275
|
-
if not isinstance(obj, dict):
|
276
|
-
return cls.model_validate(obj)
|
277
|
-
|
278
|
-
_obj = cls.model_validate({
|
279
|
-
"ruleId": obj.get("ruleId"),
|
280
|
-
"ruleIndex": obj.get("ruleIndex") if obj.get("ruleIndex") is not None else -1,
|
281
|
-
"rule": ReportingDescriptorReference.from_dict(obj["rule"]) if obj.get("rule") is not None else None,
|
282
|
-
"kind": obj.get("kind") if obj.get("kind") is not None else 'fail',
|
283
|
-
"level": obj.get("level") if obj.get("level") is not None else 'warning',
|
284
|
-
"message": Message.from_dict(obj["message"]) if obj.get("message") is not None else None,
|
285
|
-
"analysisTarget": ArtifactLocation.from_dict(obj["analysisTarget"]) if obj.get("analysisTarget") is not None else None,
|
286
|
-
"locations": [Location.from_dict(_item) for _item in obj["locations"]] if obj.get("locations") is not None else None,
|
287
|
-
"guid": obj.get("guid"),
|
288
|
-
"correlationGuid": obj.get("correlationGuid"),
|
289
|
-
"occurrenceCount": obj.get("occurrenceCount"),
|
290
|
-
"partialFingerprints": obj.get("partialFingerprints"),
|
291
|
-
"fingerprints": obj.get("fingerprints"),
|
292
|
-
"stacks": [Stack.from_dict(_item) for _item in obj["stacks"]] if obj.get("stacks") is not None else None,
|
293
|
-
"codeFlows": [CodeFlow.from_dict(_item) for _item in obj["codeFlows"]] if obj.get("codeFlows") is not None else None,
|
294
|
-
"graphs": [Graph.from_dict(_item) for _item in obj["graphs"]] if obj.get("graphs") is not None else None,
|
295
|
-
"graphTraversals": [GraphTraversal.from_dict(_item) for _item in obj["graphTraversals"]] if obj.get("graphTraversals") is not None else None,
|
296
|
-
"relatedLocations": [Location.from_dict(_item) for _item in obj["relatedLocations"]] if obj.get("relatedLocations") is not None else None,
|
297
|
-
"suppressions": [Suppression.from_dict(_item) for _item in obj["suppressions"]] if obj.get("suppressions") is not None else None,
|
298
|
-
"baselineState": obj.get("baselineState"),
|
299
|
-
"rank": obj.get("rank") if obj.get("rank") is not None else -1,
|
300
|
-
"attachments": [Attachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None,
|
301
|
-
"hostedViewerUri": obj.get("hostedViewerUri"),
|
302
|
-
"workItemUris": obj.get("workItemUris"),
|
303
|
-
"provenance": ResultProvenance.from_dict(obj["provenance"]) if obj.get("provenance") is not None else None,
|
304
|
-
"fixes": [Fix.from_dict(_item) for _item in obj["fixes"]] if obj.get("fixes") is not None else None,
|
305
|
-
"taxa": [ReportingDescriptorReference.from_dict(_item) for _item in obj["taxa"]] if obj.get("taxa") is not None else None,
|
306
|
-
"webRequest": WebRequest.from_dict(obj["webRequest"]) if obj.get("webRequest") is not None else None,
|
307
|
-
"webResponse": WebResponse.from_dict(obj["webResponse"]) if obj.get("webResponse") is not None else None,
|
308
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
309
|
-
})
|
310
|
-
return _obj
|
311
|
-
|
312
|
-
|
@@ -1,133 +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, field_validator
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
-
from typing_extensions import Annotated
|
24
|
-
from hiddenlayer.sdk.rest.models.physical_location import PhysicalLocation
|
25
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
26
|
-
from typing import Optional, Set
|
27
|
-
from typing_extensions import Self
|
28
|
-
|
29
|
-
class ResultProvenance(BaseModel):
|
30
|
-
"""
|
31
|
-
Contains information about how and when a result was detected.
|
32
|
-
""" # noqa: E501
|
33
|
-
first_detection_time_utc: Optional[datetime] = Field(default=None, description="The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \"Date/time properties\" in the SARIF spec for the required format.", alias="firstDetectionTimeUtc")
|
34
|
-
last_detection_time_utc: Optional[datetime] = Field(default=None, description="The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \"Date/time properties\" in the SARIF spec for the required format.", alias="lastDetectionTimeUtc")
|
35
|
-
first_detection_run_guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.", alias="firstDetectionRunGuid")
|
36
|
-
last_detection_run_guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.", alias="lastDetectionRunGuid")
|
37
|
-
invocation_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, description="The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.", alias="invocationIndex")
|
38
|
-
conversion_sources: Optional[Annotated[List[Optional[PhysicalLocation]], Field(min_length=0)]] = Field(default=None, description="An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.", alias="conversionSources")
|
39
|
-
properties: Optional[PropertyBag] = None
|
40
|
-
__properties: ClassVar[List[str]] = ["firstDetectionTimeUtc", "lastDetectionTimeUtc", "firstDetectionRunGuid", "lastDetectionRunGuid", "invocationIndex", "conversionSources", "properties"]
|
41
|
-
|
42
|
-
@field_validator('first_detection_run_guid')
|
43
|
-
def first_detection_run_guid_validate_regular_expression(cls, value):
|
44
|
-
"""Validates the regular expression"""
|
45
|
-
if value is None:
|
46
|
-
return value
|
47
|
-
|
48
|
-
if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
|
49
|
-
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
|
50
|
-
return value
|
51
|
-
|
52
|
-
@field_validator('last_detection_run_guid')
|
53
|
-
def last_detection_run_guid_validate_regular_expression(cls, value):
|
54
|
-
"""Validates the regular expression"""
|
55
|
-
if value is None:
|
56
|
-
return value
|
57
|
-
|
58
|
-
if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
|
59
|
-
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
|
60
|
-
return value
|
61
|
-
|
62
|
-
model_config = ConfigDict(
|
63
|
-
populate_by_name=True,
|
64
|
-
validate_assignment=True,
|
65
|
-
protected_namespaces=(),
|
66
|
-
)
|
67
|
-
|
68
|
-
|
69
|
-
def to_str(self) -> str:
|
70
|
-
"""Returns the string representation of the model using alias"""
|
71
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
72
|
-
|
73
|
-
def to_json(self) -> str:
|
74
|
-
"""Returns the JSON representation of the model using alias"""
|
75
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
76
|
-
return json.dumps(self.to_dict())
|
77
|
-
|
78
|
-
@classmethod
|
79
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
80
|
-
"""Create an instance of ResultProvenance from a JSON string"""
|
81
|
-
return cls.from_dict(json.loads(json_str))
|
82
|
-
|
83
|
-
def to_dict(self) -> Dict[str, Any]:
|
84
|
-
"""Return the dictionary representation of the model using alias.
|
85
|
-
|
86
|
-
This has the following differences from calling pydantic's
|
87
|
-
`self.model_dump(by_alias=True)`:
|
88
|
-
|
89
|
-
* `None` is only added to the output dict for nullable fields that
|
90
|
-
were set at model initialization. Other fields with value `None`
|
91
|
-
are ignored.
|
92
|
-
"""
|
93
|
-
excluded_fields: Set[str] = set([
|
94
|
-
])
|
95
|
-
|
96
|
-
_dict = self.model_dump(
|
97
|
-
by_alias=True,
|
98
|
-
exclude=excluded_fields,
|
99
|
-
exclude_none=True,
|
100
|
-
)
|
101
|
-
# override the default output from pydantic by calling `to_dict()` of each item in conversion_sources (list)
|
102
|
-
_items = []
|
103
|
-
if self.conversion_sources:
|
104
|
-
for _item in self.conversion_sources:
|
105
|
-
if _item:
|
106
|
-
_items.append(_item.to_dict())
|
107
|
-
_dict['conversionSources'] = _items
|
108
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
109
|
-
if self.properties:
|
110
|
-
_dict['properties'] = self.properties.to_dict()
|
111
|
-
return _dict
|
112
|
-
|
113
|
-
@classmethod
|
114
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
115
|
-
"""Create an instance of ResultProvenance from a dict"""
|
116
|
-
if obj is None:
|
117
|
-
return None
|
118
|
-
|
119
|
-
if not isinstance(obj, dict):
|
120
|
-
return cls.model_validate(obj)
|
121
|
-
|
122
|
-
_obj = cls.model_validate({
|
123
|
-
"firstDetectionTimeUtc": obj.get("firstDetectionTimeUtc"),
|
124
|
-
"lastDetectionTimeUtc": obj.get("lastDetectionTimeUtc"),
|
125
|
-
"firstDetectionRunGuid": obj.get("firstDetectionRunGuid"),
|
126
|
-
"lastDetectionRunGuid": obj.get("lastDetectionRunGuid"),
|
127
|
-
"invocationIndex": obj.get("invocationIndex") if obj.get("invocationIndex") is not None else -1,
|
128
|
-
"conversionSources": [PhysicalLocation.from_dict(_item) for _item in obj["conversionSources"]] if obj.get("conversionSources") is not None else None,
|
129
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
130
|
-
})
|
131
|
-
return _obj
|
132
|
-
|
133
|
-
|
@@ -1,102 +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 typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
class RuleDetailsInner(BaseModel):
|
27
|
-
"""
|
28
|
-
RuleDetailsInner
|
29
|
-
""" # noqa: E501
|
30
|
-
status: Optional[StrictStr] = Field(default=None, description="status")
|
31
|
-
status_at: Optional[datetime] = Field(default=None, description="date-time when the details entry was created")
|
32
|
-
description: Optional[StrictStr] = Field(default=None, description="description of the deprecation")
|
33
|
-
__properties: ClassVar[List[str]] = ["status", "status_at", "description"]
|
34
|
-
|
35
|
-
@field_validator('status')
|
36
|
-
def status_validate_enum(cls, value):
|
37
|
-
"""Validates the enum"""
|
38
|
-
if value is None:
|
39
|
-
return value
|
40
|
-
|
41
|
-
if value not in set(['created', 'deprecated', 'updated', 'superseded']):
|
42
|
-
raise ValueError("must be one of enum values ('created', 'deprecated', 'updated', 'superseded')")
|
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 RuleDetailsInner 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 RuleDetailsInner 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
|
-
"status": obj.get("status"),
|
97
|
-
"status_at": obj.get("status_at"),
|
98
|
-
"description": obj.get("description")
|
99
|
-
})
|
100
|
-
return _obj
|
101
|
-
|
102
|
-
|