hiddenlayer-sdk 2.0.10__py3-none-any.whl → 3.0.1__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 -114
- 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.1.dist-info/METADATA +521 -0
- hiddenlayer_sdk-3.0.1.dist-info/RECORD +82 -0
- {hiddenlayer_sdk-2.0.10.dist-info → hiddenlayer_sdk-3.0.1.dist-info}/WHEEL +1 -2
- {hiddenlayer_sdk-2.0.10.dist-info → hiddenlayer_sdk-3.0.1.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.10.dist-info/METADATA +0 -368
- hiddenlayer_sdk-2.0.10.dist-info/RECORD +0 -126
- hiddenlayer_sdk-2.0.10.dist-info/top_level.txt +0 -1
- /hiddenlayer/{sdk/__init__.py → py.typed} +0 -0
@@ -0,0 +1,367 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Union, Optional
|
4
|
+
from datetime import datetime
|
5
|
+
from typing_extensions import Literal, TypeAlias
|
6
|
+
|
7
|
+
from pydantic import Field as FieldInfo
|
8
|
+
|
9
|
+
from ..._compat import PYDANTIC_V1, ConfigDict
|
10
|
+
from ..._models import BaseModel
|
11
|
+
|
12
|
+
__all__ = [
|
13
|
+
"ScanReport",
|
14
|
+
"Inventory",
|
15
|
+
"InventoryScanModelDetailsV3",
|
16
|
+
"InventoryScanModelIDsV3",
|
17
|
+
"InventoryScanModelComboV3",
|
18
|
+
"Compliance",
|
19
|
+
"FileResult",
|
20
|
+
"FileResultDetails",
|
21
|
+
"FileResultDetailsFileTypeDetails",
|
22
|
+
"FileResultDetailsFileTypeDetailsGgufFileAttributes",
|
23
|
+
"FileResultDetailsFileTypeDetailsKerasFileAttributes",
|
24
|
+
"FileResultDetailsFileTypeDetailsNumpyFileAttributes",
|
25
|
+
"FileResultDetailsFileTypeDetailsRdsFileAttributes",
|
26
|
+
"FileResultDetection",
|
27
|
+
"FileResultDetectionMitreAtlas",
|
28
|
+
"FileResultDetectionRuleDetail",
|
29
|
+
"Summary",
|
30
|
+
]
|
31
|
+
|
32
|
+
|
33
|
+
class InventoryScanModelDetailsV3(BaseModel):
|
34
|
+
model_name: str
|
35
|
+
"""name of the model"""
|
36
|
+
|
37
|
+
requested_scan_location: str
|
38
|
+
"""Location to be scanned"""
|
39
|
+
|
40
|
+
model_source: Optional[str] = None
|
41
|
+
"""source (provider) info"""
|
42
|
+
|
43
|
+
model_version: Optional[str] = None
|
44
|
+
"""version of the model"""
|
45
|
+
|
46
|
+
origin: Optional[str] = None
|
47
|
+
"""
|
48
|
+
Specifies the platform or service where the model originated before being
|
49
|
+
scanned
|
50
|
+
"""
|
51
|
+
|
52
|
+
request_source: Optional[Literal["Hybrid Upload", "API Upload", "Integration", "UI Upload"]] = None
|
53
|
+
"""Identifies the system that requested the scan"""
|
54
|
+
|
55
|
+
requesting_entity: Optional[str] = None
|
56
|
+
"""Entity that requested the scan"""
|
57
|
+
|
58
|
+
if not PYDANTIC_V1:
|
59
|
+
# allow fields with a `model_` prefix
|
60
|
+
model_config = ConfigDict(protected_namespaces=tuple())
|
61
|
+
|
62
|
+
|
63
|
+
class InventoryScanModelIDsV3(BaseModel):
|
64
|
+
model_id: str
|
65
|
+
"""Unique identifier for the model"""
|
66
|
+
|
67
|
+
model_version_id: str
|
68
|
+
"""unique identifier for the model version"""
|
69
|
+
|
70
|
+
if not PYDANTIC_V1:
|
71
|
+
# allow fields with a `model_` prefix
|
72
|
+
model_config = ConfigDict(protected_namespaces=tuple())
|
73
|
+
|
74
|
+
|
75
|
+
class InventoryScanModelComboV3(BaseModel):
|
76
|
+
model_id: str
|
77
|
+
"""Unique identifier for the model"""
|
78
|
+
|
79
|
+
model_name: str
|
80
|
+
"""name of the model"""
|
81
|
+
|
82
|
+
model_version_id: str
|
83
|
+
"""unique identifier for the model version"""
|
84
|
+
|
85
|
+
requested_scan_location: str
|
86
|
+
"""Location to be scanned"""
|
87
|
+
|
88
|
+
model_source: Optional[str] = None
|
89
|
+
"""source (provider) info"""
|
90
|
+
|
91
|
+
model_version: Optional[str] = None
|
92
|
+
"""version of the model"""
|
93
|
+
|
94
|
+
origin: Optional[str] = None
|
95
|
+
"""
|
96
|
+
Specifies the platform or service where the model originated before being
|
97
|
+
scanned
|
98
|
+
"""
|
99
|
+
|
100
|
+
request_source: Optional[Literal["Hybrid Upload", "API Upload", "Integration", "UI Upload"]] = None
|
101
|
+
"""Identifies the system that requested the scan"""
|
102
|
+
|
103
|
+
requesting_entity: Optional[str] = None
|
104
|
+
"""Entity that requested the scan"""
|
105
|
+
|
106
|
+
if not PYDANTIC_V1:
|
107
|
+
# allow fields with a `model_` prefix
|
108
|
+
model_config = ConfigDict(protected_namespaces=tuple())
|
109
|
+
|
110
|
+
|
111
|
+
Inventory: TypeAlias = Union[InventoryScanModelDetailsV3, InventoryScanModelIDsV3, InventoryScanModelComboV3]
|
112
|
+
|
113
|
+
|
114
|
+
class Compliance(BaseModel):
|
115
|
+
evaluated_at: Optional[datetime] = None
|
116
|
+
"""The datetime when the rule set was evaluated against the scan result"""
|
117
|
+
|
118
|
+
rule_set_ids: Optional[List[str]] = None
|
119
|
+
"""A list of non-default rule sets that were used when evaluating the scan result"""
|
120
|
+
|
121
|
+
status: Optional[Literal["COMPLIANT", "NONCOMPLIANT"]] = None
|
122
|
+
|
123
|
+
|
124
|
+
class FileResultDetailsFileTypeDetailsGgufFileAttributes(BaseModel):
|
125
|
+
subtype: List[str]
|
126
|
+
|
127
|
+
|
128
|
+
class FileResultDetailsFileTypeDetailsKerasFileAttributes(BaseModel):
|
129
|
+
pickle_modules: List[str]
|
130
|
+
|
131
|
+
subtype: List[str]
|
132
|
+
|
133
|
+
keras_class_name: Optional[str] = None
|
134
|
+
|
135
|
+
keras_date_saved_at: Optional[str] = None
|
136
|
+
|
137
|
+
keras_module: Optional[str] = None
|
138
|
+
|
139
|
+
keras_version: Optional[str] = None
|
140
|
+
"""version of the Keras file"""
|
141
|
+
|
142
|
+
|
143
|
+
class FileResultDetailsFileTypeDetailsNumpyFileAttributes(BaseModel):
|
144
|
+
numpy_arrays: str
|
145
|
+
|
146
|
+
numpy_shape: List[str]
|
147
|
+
|
148
|
+
subtype: List[str]
|
149
|
+
|
150
|
+
|
151
|
+
class FileResultDetailsFileTypeDetailsRdsFileAttributes(BaseModel):
|
152
|
+
rds_encoding: str
|
153
|
+
"""encoding of the RDS file"""
|
154
|
+
|
155
|
+
rds_min_reader_version: str
|
156
|
+
"""minimum reader version for the RDS file"""
|
157
|
+
|
158
|
+
rds_version: str
|
159
|
+
"""version of the RDS file"""
|
160
|
+
|
161
|
+
rds_writer_version: str
|
162
|
+
"""version of the RDS writer"""
|
163
|
+
|
164
|
+
subtype: List[str]
|
165
|
+
|
166
|
+
|
167
|
+
FileResultDetailsFileTypeDetails: TypeAlias = Union[
|
168
|
+
FileResultDetailsFileTypeDetailsGgufFileAttributes,
|
169
|
+
FileResultDetailsFileTypeDetailsKerasFileAttributes,
|
170
|
+
FileResultDetailsFileTypeDetailsNumpyFileAttributes,
|
171
|
+
FileResultDetailsFileTypeDetailsRdsFileAttributes,
|
172
|
+
]
|
173
|
+
|
174
|
+
|
175
|
+
class FileResultDetails(BaseModel):
|
176
|
+
estimated_time: str
|
177
|
+
"""estimated time to scan the file"""
|
178
|
+
|
179
|
+
file_type: str
|
180
|
+
"""type of the file"""
|
181
|
+
|
182
|
+
sha256: str
|
183
|
+
"""hexadecimal sha256 hash of file"""
|
184
|
+
|
185
|
+
file_size: Optional[str] = None
|
186
|
+
"""size of the file in human readable format"""
|
187
|
+
|
188
|
+
file_size_bytes: Optional[int] = None
|
189
|
+
"""size of the file in bytes"""
|
190
|
+
|
191
|
+
file_type_details: Optional[FileResultDetailsFileTypeDetails] = None
|
192
|
+
|
193
|
+
md5: Optional[str] = None
|
194
|
+
"""hexadecimal md5 hash of file"""
|
195
|
+
|
196
|
+
tlsh: Optional[str] = None
|
197
|
+
"""TLSH hash of file"""
|
198
|
+
|
199
|
+
|
200
|
+
class FileResultDetectionMitreAtlas(BaseModel):
|
201
|
+
tactic: Optional[str] = None
|
202
|
+
"""MITRE Atlas Tactic"""
|
203
|
+
|
204
|
+
technique: Optional[str] = None
|
205
|
+
"""MITRE Atlas Technique"""
|
206
|
+
|
207
|
+
|
208
|
+
class FileResultDetectionRuleDetail(BaseModel):
|
209
|
+
description: Optional[str] = None
|
210
|
+
"""description of the deprecation"""
|
211
|
+
|
212
|
+
status: Optional[Literal["created", "deprecated", "updated", "superseded"]] = None
|
213
|
+
"""status"""
|
214
|
+
|
215
|
+
status_at: Optional[datetime] = None
|
216
|
+
"""date-time when the details entry was created"""
|
217
|
+
|
218
|
+
|
219
|
+
class FileResultDetection(BaseModel):
|
220
|
+
category: str
|
221
|
+
"""Vulnerability category for the detection"""
|
222
|
+
|
223
|
+
cve: List[str]
|
224
|
+
|
225
|
+
cwe: str
|
226
|
+
|
227
|
+
cwe_href: str
|
228
|
+
"""CWE URL for the detection"""
|
229
|
+
|
230
|
+
description: str
|
231
|
+
"""detection description"""
|
232
|
+
|
233
|
+
detection_id: str
|
234
|
+
"""unique identifier for the detection"""
|
235
|
+
|
236
|
+
impact: str
|
237
|
+
"""detection impact"""
|
238
|
+
|
239
|
+
likelihood: str
|
240
|
+
"""detection likelihood"""
|
241
|
+
|
242
|
+
mitre_atlas: List[FileResultDetectionMitreAtlas]
|
243
|
+
|
244
|
+
owasp: List[str]
|
245
|
+
|
246
|
+
risk: Literal["MALICIOUS", "SUSPICIOUS"]
|
247
|
+
"""detection risk"""
|
248
|
+
|
249
|
+
rule_id: str
|
250
|
+
"""unique identifier for the rule that sourced the detection"""
|
251
|
+
|
252
|
+
severity: Literal["critical", "high", "medium", "low"]
|
253
|
+
"""The severity of the detection."""
|
254
|
+
|
255
|
+
rule_details: Optional[List[FileResultDetectionRuleDetail]] = None
|
256
|
+
|
257
|
+
technical_blog_href: Optional[str] = None
|
258
|
+
"""Hiddenlayer Technical Blog URL for the detection"""
|
259
|
+
|
260
|
+
technical_blog_hrefs: Optional[List[str]] = None
|
261
|
+
"""Hiddenlayer Technical Blog URLs for the detection"""
|
262
|
+
|
263
|
+
|
264
|
+
class FileResult(BaseModel):
|
265
|
+
details: FileResultDetails
|
266
|
+
|
267
|
+
detections: List[FileResultDetection]
|
268
|
+
|
269
|
+
end_time: datetime
|
270
|
+
"""time the scan ended"""
|
271
|
+
|
272
|
+
file_instance_id: str
|
273
|
+
"""unique ID of the file"""
|
274
|
+
|
275
|
+
file_location: str
|
276
|
+
"""full file path"""
|
277
|
+
|
278
|
+
seen: datetime
|
279
|
+
"""time the scan was seen at"""
|
280
|
+
|
281
|
+
start_time: datetime
|
282
|
+
"""time the scan started"""
|
283
|
+
|
284
|
+
status: Literal["skipped", "pending", "running", "done", "failed", "canceled"]
|
285
|
+
"""status of the scan"""
|
286
|
+
|
287
|
+
file_error: Optional[List[str]] = None
|
288
|
+
"""Error messages returned by the scanner"""
|
289
|
+
|
290
|
+
|
291
|
+
class Summary(BaseModel):
|
292
|
+
detection_categories: Optional[List[str]] = None
|
293
|
+
"""list of unique detection categories found"""
|
294
|
+
|
295
|
+
detection_count: Optional[int] = None
|
296
|
+
"""total number of detections found"""
|
297
|
+
|
298
|
+
file_count: Optional[int] = None
|
299
|
+
"""total number of files scanned"""
|
300
|
+
|
301
|
+
files_failed_to_scan: Optional[int] = None
|
302
|
+
"""number of files that failed during scanning"""
|
303
|
+
|
304
|
+
files_with_detections_count: Optional[int] = None
|
305
|
+
"""number of files that contain detections"""
|
306
|
+
|
307
|
+
severity: Optional[Literal["critical", "high", "medium", "low", "safe", "unknown"]] = None
|
308
|
+
"""The severity of the detection.
|
309
|
+
|
310
|
+
Use ScanDetectionSeverity (without safe) or ScanDetectionSeverityWithNone
|
311
|
+
instead.
|
312
|
+
"""
|
313
|
+
|
314
|
+
unknown_files: Optional[int] = None
|
315
|
+
"""number of files with unknown file type"""
|
316
|
+
|
317
|
+
|
318
|
+
class ScanReport(BaseModel):
|
319
|
+
detection_count: int
|
320
|
+
"""number of detections found"""
|
321
|
+
|
322
|
+
file_count: int
|
323
|
+
"""number of files scanned"""
|
324
|
+
|
325
|
+
files_with_detections_count: int
|
326
|
+
"""number of files with detections found"""
|
327
|
+
|
328
|
+
inventory: Inventory
|
329
|
+
"""information about model and version that this scan relates to"""
|
330
|
+
|
331
|
+
scan_id: str
|
332
|
+
"""unique identifier for the scan"""
|
333
|
+
|
334
|
+
start_time: datetime
|
335
|
+
"""time the scan started"""
|
336
|
+
|
337
|
+
status: Literal["pending", "running", "done", "failed", "canceled"]
|
338
|
+
"""status of the scan"""
|
339
|
+
|
340
|
+
version: str
|
341
|
+
"""scanner version"""
|
342
|
+
|
343
|
+
schema_version: Optional[str] = FieldInfo(alias="$schema_version", default=None)
|
344
|
+
"""version of the scan report schema format"""
|
345
|
+
|
346
|
+
compliance: Optional[Compliance] = None
|
347
|
+
|
348
|
+
detection_categories: Optional[List[str]] = None
|
349
|
+
"""list of detection categories found"""
|
350
|
+
|
351
|
+
end_time: Optional[datetime] = None
|
352
|
+
"""time the scan ended"""
|
353
|
+
|
354
|
+
file_results: Optional[List[FileResult]] = None
|
355
|
+
|
356
|
+
has_genealogy: Optional[bool] = None
|
357
|
+
"""if there is model geneaology info available"""
|
358
|
+
|
359
|
+
severity: Optional[Literal["critical", "high", "medium", "low", "safe", "unknown"]] = None
|
360
|
+
"""The severity of the detection.
|
361
|
+
|
362
|
+
Use ScanDetectionSeverity (without safe) or ScanDetectionSeverityWithNone
|
363
|
+
instead.
|
364
|
+
"""
|
365
|
+
|
366
|
+
summary: Optional[Summary] = None
|
367
|
+
"""aggregated summary statistics for the scan"""
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from .file_add_response import FileAddResponse as FileAddResponse
|
6
|
+
from .file_complete_response import FileCompleteResponse as FileCompleteResponse
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
|
5
|
+
from ...._models import BaseModel
|
6
|
+
|
7
|
+
__all__ = ["FileAddResponse", "Part"]
|
8
|
+
|
9
|
+
|
10
|
+
class Part(BaseModel):
|
11
|
+
end_offset: Optional[int] = None
|
12
|
+
|
13
|
+
part_number: Optional[int] = None
|
14
|
+
|
15
|
+
start_offset: Optional[int] = None
|
16
|
+
|
17
|
+
upload_url: Optional[str] = None
|
18
|
+
|
19
|
+
|
20
|
+
class FileAddResponse(BaseModel):
|
21
|
+
parts: List[Part]
|
22
|
+
|
23
|
+
upload_id: str
|
24
|
+
"""UploadId for the current file"""
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
from ...._models import BaseModel
|
6
|
+
|
7
|
+
__all__ = ["FileCompleteResponse"]
|
8
|
+
|
9
|
+
|
10
|
+
class FileCompleteResponse(BaseModel):
|
11
|
+
scan_id: Optional[str] = None
|
12
|
+
"""Request to resource is successful"""
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
from ..._models import BaseModel
|
6
|
+
|
7
|
+
__all__ = ["UploadCompleteAllResponse"]
|
8
|
+
|
9
|
+
|
10
|
+
class UploadCompleteAllResponse(BaseModel):
|
11
|
+
scan_id: Optional[str] = None
|
12
|
+
"""Request to resource is successful"""
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing_extensions import Literal, Required, Annotated, TypedDict
|
6
|
+
|
7
|
+
from ..._utils import PropertyInfo
|
8
|
+
|
9
|
+
__all__ = ["UploadStartParams"]
|
10
|
+
|
11
|
+
|
12
|
+
class UploadStartParams(TypedDict, total=False):
|
13
|
+
model_name: Required[str]
|
14
|
+
"""Model name"""
|
15
|
+
|
16
|
+
model_version: Required[str]
|
17
|
+
"""Model version"""
|
18
|
+
|
19
|
+
requesting_entity: Required[str]
|
20
|
+
"""Requesting entity"""
|
21
|
+
|
22
|
+
location_alias: str
|
23
|
+
"""Requested location alias"""
|
24
|
+
|
25
|
+
origin: str
|
26
|
+
"""
|
27
|
+
Specifies the platform or service where the model originated before being
|
28
|
+
scanned
|
29
|
+
"""
|
30
|
+
|
31
|
+
request_source: Literal["Hybrid Upload", "API Upload", "Integration", "UI Upload"]
|
32
|
+
"""Identifies the system that requested the scan"""
|
33
|
+
|
34
|
+
x_correlation_id: Annotated[str, PropertyInfo(alias="X-Correlation-Id")]
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
from ..._models import BaseModel
|
6
|
+
|
7
|
+
__all__ = ["UploadStartResponse"]
|
8
|
+
|
9
|
+
|
10
|
+
class UploadStartResponse(BaseModel):
|
11
|
+
scan_id: Optional[str] = None
|
12
|
+
"""Request to resource is successful"""
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
7
|
+
|
8
|
+
from .._utils import PropertyInfo
|
9
|
+
|
10
|
+
__all__ = ["SensorCreateParams"]
|
11
|
+
|
12
|
+
|
13
|
+
class SensorCreateParams(TypedDict, total=False):
|
14
|
+
plaintext_name: Required[str]
|
15
|
+
|
16
|
+
active: bool
|
17
|
+
|
18
|
+
adhoc: bool
|
19
|
+
|
20
|
+
tags: Dict[str, object]
|
21
|
+
|
22
|
+
version: int
|
23
|
+
|
24
|
+
x_correlation_id: Annotated[str, PropertyInfo(alias="X-Correlation-Id")]
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Dict, Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._compat import PYDANTIC_V1, ConfigDict
|
7
|
+
from .._models import BaseModel
|
8
|
+
|
9
|
+
__all__ = ["SensorCreateResponse"]
|
10
|
+
|
11
|
+
|
12
|
+
class SensorCreateResponse(BaseModel):
|
13
|
+
active: bool
|
14
|
+
|
15
|
+
created_at: datetime
|
16
|
+
|
17
|
+
model_id: str
|
18
|
+
|
19
|
+
plaintext_name: str
|
20
|
+
|
21
|
+
sensor_id: str
|
22
|
+
|
23
|
+
tags: Dict[str, object]
|
24
|
+
|
25
|
+
tenant_id: str
|
26
|
+
|
27
|
+
adhoc: Optional[bool] = None
|
28
|
+
|
29
|
+
version: Optional[int] = None
|
30
|
+
|
31
|
+
if not PYDANTIC_V1:
|
32
|
+
# allow fields with a `model_` prefix
|
33
|
+
model_config = ConfigDict(protected_namespaces=tuple())
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Union
|
6
|
+
from datetime import datetime
|
7
|
+
from typing_extensions import Literal, Annotated, TypedDict
|
8
|
+
|
9
|
+
from .._utils import PropertyInfo
|
10
|
+
|
11
|
+
__all__ = ["SensorQueryParams", "Filter"]
|
12
|
+
|
13
|
+
|
14
|
+
class SensorQueryParams(TypedDict, total=False):
|
15
|
+
filter: Filter
|
16
|
+
|
17
|
+
order_by: str
|
18
|
+
|
19
|
+
order_dir: Literal["asc", "desc"]
|
20
|
+
|
21
|
+
page_number: int
|
22
|
+
|
23
|
+
page_size: int
|
24
|
+
|
25
|
+
x_correlation_id: Annotated[str, PropertyInfo(alias="X-Correlation-Id")]
|
26
|
+
|
27
|
+
|
28
|
+
class Filter(TypedDict, total=False):
|
29
|
+
active: bool
|
30
|
+
|
31
|
+
created_at_start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
32
|
+
|
33
|
+
created_at_stop: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
34
|
+
|
35
|
+
plaintext_name: str
|
36
|
+
|
37
|
+
source: Literal["adhoc"]
|
38
|
+
|
39
|
+
version: int
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Dict, List, Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._compat import PYDANTIC_V1, ConfigDict
|
7
|
+
from .._models import BaseModel
|
8
|
+
|
9
|
+
__all__ = ["SensorQueryResponse", "Result"]
|
10
|
+
|
11
|
+
|
12
|
+
class Result(BaseModel):
|
13
|
+
active: bool
|
14
|
+
|
15
|
+
created_at: datetime
|
16
|
+
|
17
|
+
model_id: str
|
18
|
+
|
19
|
+
plaintext_name: str
|
20
|
+
|
21
|
+
sensor_id: str
|
22
|
+
|
23
|
+
tags: Dict[str, object]
|
24
|
+
|
25
|
+
tenant_id: str
|
26
|
+
|
27
|
+
adhoc: Optional[bool] = None
|
28
|
+
|
29
|
+
version: Optional[int] = None
|
30
|
+
|
31
|
+
if not PYDANTIC_V1:
|
32
|
+
# allow fields with a `model_` prefix
|
33
|
+
model_config = ConfigDict(protected_namespaces=tuple())
|
34
|
+
|
35
|
+
|
36
|
+
class SensorQueryResponse(BaseModel):
|
37
|
+
page_number: int
|
38
|
+
|
39
|
+
page_size: int
|
40
|
+
|
41
|
+
results: List[Result]
|
42
|
+
|
43
|
+
total_count: int
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Dict, Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._compat import PYDANTIC_V1, ConfigDict
|
7
|
+
from .._models import BaseModel
|
8
|
+
|
9
|
+
__all__ = ["SensorRetrieveResponse"]
|
10
|
+
|
11
|
+
|
12
|
+
class SensorRetrieveResponse(BaseModel):
|
13
|
+
active: bool
|
14
|
+
|
15
|
+
created_at: datetime
|
16
|
+
|
17
|
+
model_id: str
|
18
|
+
|
19
|
+
plaintext_name: str
|
20
|
+
|
21
|
+
sensor_id: str
|
22
|
+
|
23
|
+
tags: Dict[str, object]
|
24
|
+
|
25
|
+
tenant_id: str
|
26
|
+
|
27
|
+
adhoc: Optional[bool] = None
|
28
|
+
|
29
|
+
version: Optional[int] = None
|
30
|
+
|
31
|
+
if not PYDANTIC_V1:
|
32
|
+
# allow fields with a `model_` prefix
|
33
|
+
model_config = ConfigDict(protected_namespaces=tuple())
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
7
|
+
|
8
|
+
from .._utils import PropertyInfo
|
9
|
+
|
10
|
+
__all__ = ["SensorUpdateParams"]
|
11
|
+
|
12
|
+
|
13
|
+
class SensorUpdateParams(TypedDict, total=False):
|
14
|
+
active: bool
|
15
|
+
|
16
|
+
plaintext_name: str
|
17
|
+
|
18
|
+
tags: Dict[str, object]
|
19
|
+
|
20
|
+
x_correlation_id: Annotated[str, PropertyInfo(alias="X-Correlation-Id")]
|