hiddenlayer-sdk 2.0.10__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 -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.0.dist-info/METADATA +431 -0
- hiddenlayer_sdk-3.0.0.dist-info/RECORD +82 -0
- {hiddenlayer_sdk-2.0.10.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/WHEEL +1 -2
- {hiddenlayer_sdk-2.0.10.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.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
@@ -1,109 +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.sensor_sor_query_filter import SensorSORQueryFilter
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
class SensorSORQueryRequest(BaseModel):
|
27
|
-
"""
|
28
|
-
SensorSORQueryRequest
|
29
|
-
""" # noqa: E501
|
30
|
-
filter: Optional[SensorSORQueryFilter] = None
|
31
|
-
order_by: Optional[StrictStr] = 'created_at'
|
32
|
-
order_dir: Optional[StrictStr] = None
|
33
|
-
page_size: Optional[StrictInt] = 25
|
34
|
-
page_number: Optional[StrictInt] = 0
|
35
|
-
__properties: ClassVar[List[str]] = ["filter", "order_by", "order_dir", "page_size", "page_number"]
|
36
|
-
|
37
|
-
@field_validator('order_dir')
|
38
|
-
def order_dir_validate_enum(cls, value):
|
39
|
-
"""Validates the enum"""
|
40
|
-
if value is None:
|
41
|
-
return value
|
42
|
-
|
43
|
-
if value not in set(['asc', 'desc', 'ASC', 'DESC']):
|
44
|
-
raise ValueError("must be one of enum values ('asc', 'desc', 'ASC', 'DESC')")
|
45
|
-
return value
|
46
|
-
|
47
|
-
model_config = ConfigDict(
|
48
|
-
populate_by_name=True,
|
49
|
-
validate_assignment=True,
|
50
|
-
protected_namespaces=(),
|
51
|
-
)
|
52
|
-
|
53
|
-
|
54
|
-
def to_str(self) -> str:
|
55
|
-
"""Returns the string representation of the model using alias"""
|
56
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
57
|
-
|
58
|
-
def to_json(self) -> str:
|
59
|
-
"""Returns the JSON representation of the model using alias"""
|
60
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
61
|
-
return json.dumps(self.to_dict())
|
62
|
-
|
63
|
-
@classmethod
|
64
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
65
|
-
"""Create an instance of SensorSORQueryRequest from a JSON string"""
|
66
|
-
return cls.from_dict(json.loads(json_str))
|
67
|
-
|
68
|
-
def to_dict(self) -> Dict[str, Any]:
|
69
|
-
"""Return the dictionary representation of the model using alias.
|
70
|
-
|
71
|
-
This has the following differences from calling pydantic's
|
72
|
-
`self.model_dump(by_alias=True)`:
|
73
|
-
|
74
|
-
* `None` is only added to the output dict for nullable fields that
|
75
|
-
were set at model initialization. Other fields with value `None`
|
76
|
-
are ignored.
|
77
|
-
"""
|
78
|
-
excluded_fields: Set[str] = set([
|
79
|
-
])
|
80
|
-
|
81
|
-
_dict = self.model_dump(
|
82
|
-
by_alias=True,
|
83
|
-
exclude=excluded_fields,
|
84
|
-
exclude_none=True,
|
85
|
-
)
|
86
|
-
# override the default output from pydantic by calling `to_dict()` of filter
|
87
|
-
if self.filter:
|
88
|
-
_dict['filter'] = self.filter.to_dict()
|
89
|
-
return _dict
|
90
|
-
|
91
|
-
@classmethod
|
92
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
-
"""Create an instance of SensorSORQueryRequest from a dict"""
|
94
|
-
if obj is None:
|
95
|
-
return None
|
96
|
-
|
97
|
-
if not isinstance(obj, dict):
|
98
|
-
return cls.model_validate(obj)
|
99
|
-
|
100
|
-
_obj = cls.model_validate({
|
101
|
-
"filter": SensorSORQueryFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
|
102
|
-
"order_by": obj.get("order_by") if obj.get("order_by") is not None else 'created_at',
|
103
|
-
"order_dir": obj.get("order_dir"),
|
104
|
-
"page_size": obj.get("page_size") if obj.get("page_size") is not None else 25,
|
105
|
-
"page_number": obj.get("page_number") if obj.get("page_number") is not None else 0
|
106
|
-
})
|
107
|
-
return _obj
|
108
|
-
|
109
|
-
|
@@ -1,97 +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 hiddenlayer.sdk.rest.models.artifact_location import ArtifactLocation
|
23
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
24
|
-
from typing import Optional, Set
|
25
|
-
from typing_extensions import Self
|
26
|
-
|
27
|
-
class SpecialLocations(BaseModel):
|
28
|
-
"""
|
29
|
-
Defines locations of special significance to SARIF consumers.
|
30
|
-
""" # noqa: E501
|
31
|
-
display_base: Optional[ArtifactLocation] = Field(default=None, alias="displayBase")
|
32
|
-
properties: Optional[PropertyBag] = None
|
33
|
-
__properties: ClassVar[List[str]] = ["displayBase", "properties"]
|
34
|
-
|
35
|
-
model_config = ConfigDict(
|
36
|
-
populate_by_name=True,
|
37
|
-
validate_assignment=True,
|
38
|
-
protected_namespaces=(),
|
39
|
-
)
|
40
|
-
|
41
|
-
|
42
|
-
def to_str(self) -> str:
|
43
|
-
"""Returns the string representation of the model using alias"""
|
44
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
-
|
46
|
-
def to_json(self) -> str:
|
47
|
-
"""Returns the JSON representation of the model using alias"""
|
48
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
-
return json.dumps(self.to_dict())
|
50
|
-
|
51
|
-
@classmethod
|
52
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
-
"""Create an instance of SpecialLocations from a JSON string"""
|
54
|
-
return cls.from_dict(json.loads(json_str))
|
55
|
-
|
56
|
-
def to_dict(self) -> Dict[str, Any]:
|
57
|
-
"""Return the dictionary representation of the model using alias.
|
58
|
-
|
59
|
-
This has the following differences from calling pydantic's
|
60
|
-
`self.model_dump(by_alias=True)`:
|
61
|
-
|
62
|
-
* `None` is only added to the output dict for nullable fields that
|
63
|
-
were set at model initialization. Other fields with value `None`
|
64
|
-
are ignored.
|
65
|
-
"""
|
66
|
-
excluded_fields: Set[str] = set([
|
67
|
-
])
|
68
|
-
|
69
|
-
_dict = self.model_dump(
|
70
|
-
by_alias=True,
|
71
|
-
exclude=excluded_fields,
|
72
|
-
exclude_none=True,
|
73
|
-
)
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of display_base
|
75
|
-
if self.display_base:
|
76
|
-
_dict['displayBase'] = self.display_base.to_dict()
|
77
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
78
|
-
if self.properties:
|
79
|
-
_dict['properties'] = self.properties.to_dict()
|
80
|
-
return _dict
|
81
|
-
|
82
|
-
@classmethod
|
83
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
84
|
-
"""Create an instance of SpecialLocations from a dict"""
|
85
|
-
if obj is None:
|
86
|
-
return None
|
87
|
-
|
88
|
-
if not isinstance(obj, dict):
|
89
|
-
return cls.model_validate(obj)
|
90
|
-
|
91
|
-
_obj = cls.model_validate({
|
92
|
-
"displayBase": ArtifactLocation.from_dict(obj["displayBase"]) if obj.get("displayBase") is not None else None,
|
93
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
94
|
-
})
|
95
|
-
return _obj
|
96
|
-
|
97
|
-
|
@@ -1,113 +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.message import Message
|
24
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
25
|
-
from hiddenlayer.sdk.rest.models.stack_frame import StackFrame
|
26
|
-
from typing import Optional, Set
|
27
|
-
from typing_extensions import Self
|
28
|
-
|
29
|
-
class Stack(BaseModel):
|
30
|
-
"""
|
31
|
-
A call stack that is relevant to a result.
|
32
|
-
""" # noqa: E501
|
33
|
-
message: Optional[Message] = None
|
34
|
-
frames: Annotated[List[StackFrame], Field(min_length=0)] = Field(description="An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.")
|
35
|
-
properties: Optional[PropertyBag] = None
|
36
|
-
__properties: ClassVar[List[str]] = ["message", "frames", "properties"]
|
37
|
-
|
38
|
-
model_config = ConfigDict(
|
39
|
-
populate_by_name=True,
|
40
|
-
validate_assignment=True,
|
41
|
-
protected_namespaces=(),
|
42
|
-
)
|
43
|
-
|
44
|
-
|
45
|
-
def to_str(self) -> str:
|
46
|
-
"""Returns the string representation of the model using alias"""
|
47
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
48
|
-
|
49
|
-
def to_json(self) -> str:
|
50
|
-
"""Returns the JSON representation of the model using alias"""
|
51
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
52
|
-
return json.dumps(self.to_dict())
|
53
|
-
|
54
|
-
@classmethod
|
55
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
56
|
-
"""Create an instance of Stack from a JSON string"""
|
57
|
-
return cls.from_dict(json.loads(json_str))
|
58
|
-
|
59
|
-
def to_dict(self) -> Dict[str, Any]:
|
60
|
-
"""Return the dictionary representation of the model using alias.
|
61
|
-
|
62
|
-
This has the following differences from calling pydantic's
|
63
|
-
`self.model_dump(by_alias=True)`:
|
64
|
-
|
65
|
-
* `None` is only added to the output dict for nullable fields that
|
66
|
-
were set at model initialization. Other fields with value `None`
|
67
|
-
are ignored.
|
68
|
-
"""
|
69
|
-
excluded_fields: Set[str] = set([
|
70
|
-
])
|
71
|
-
|
72
|
-
_dict = self.model_dump(
|
73
|
-
by_alias=True,
|
74
|
-
exclude=excluded_fields,
|
75
|
-
exclude_none=True,
|
76
|
-
)
|
77
|
-
# override the default output from pydantic by calling `to_dict()` of message
|
78
|
-
if self.message:
|
79
|
-
_dict['message'] = self.message.to_dict()
|
80
|
-
# override the default output from pydantic by calling `to_dict()` of each item in frames (list)
|
81
|
-
_items = []
|
82
|
-
if self.frames:
|
83
|
-
for _item in self.frames:
|
84
|
-
if _item:
|
85
|
-
_items.append(_item.to_dict())
|
86
|
-
_dict['frames'] = _items
|
87
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
88
|
-
if self.properties:
|
89
|
-
_dict['properties'] = self.properties.to_dict()
|
90
|
-
# set to None if message (nullable) is None
|
91
|
-
# and model_fields_set contains the field
|
92
|
-
if self.message is None and "message" in self.model_fields_set:
|
93
|
-
_dict['message'] = None
|
94
|
-
|
95
|
-
return _dict
|
96
|
-
|
97
|
-
@classmethod
|
98
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
|
-
"""Create an instance of Stack 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
|
-
"message": Message.from_dict(obj["message"]) if obj.get("message") is not None else None,
|
108
|
-
"frames": [StackFrame.from_dict(_item) for _item in obj["frames"]] if obj.get("frames") is not None else None,
|
109
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
110
|
-
})
|
111
|
-
return _obj
|
112
|
-
|
113
|
-
|
@@ -1,104 +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
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing_extensions import Annotated
|
23
|
-
from hiddenlayer.sdk.rest.models.location import Location
|
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 StackFrame(BaseModel):
|
29
|
-
"""
|
30
|
-
A function call within a stack trace.
|
31
|
-
""" # noqa: E501
|
32
|
-
location: Optional[Location] = None
|
33
|
-
module: Optional[StrictStr] = Field(default=None, description="The name of the module that contains the code of this stack frame.")
|
34
|
-
thread_id: Optional[StrictInt] = Field(default=None, description="The thread identifier of the stack frame.", alias="threadId")
|
35
|
-
parameters: Optional[Annotated[List[StrictStr], Field(min_length=0)]] = Field(default=None, description="The parameters of the call that is executing.")
|
36
|
-
properties: Optional[PropertyBag] = None
|
37
|
-
__properties: ClassVar[List[str]] = ["location", "module", "threadId", "parameters", "properties"]
|
38
|
-
|
39
|
-
model_config = ConfigDict(
|
40
|
-
populate_by_name=True,
|
41
|
-
validate_assignment=True,
|
42
|
-
protected_namespaces=(),
|
43
|
-
)
|
44
|
-
|
45
|
-
|
46
|
-
def to_str(self) -> str:
|
47
|
-
"""Returns the string representation of the model using alias"""
|
48
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
49
|
-
|
50
|
-
def to_json(self) -> str:
|
51
|
-
"""Returns the JSON representation of the model using alias"""
|
52
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
53
|
-
return json.dumps(self.to_dict())
|
54
|
-
|
55
|
-
@classmethod
|
56
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
|
-
"""Create an instance of StackFrame from a JSON string"""
|
58
|
-
return cls.from_dict(json.loads(json_str))
|
59
|
-
|
60
|
-
def to_dict(self) -> Dict[str, Any]:
|
61
|
-
"""Return the dictionary representation of the model using alias.
|
62
|
-
|
63
|
-
This has the following differences from calling pydantic's
|
64
|
-
`self.model_dump(by_alias=True)`:
|
65
|
-
|
66
|
-
* `None` is only added to the output dict for nullable fields that
|
67
|
-
were set at model initialization. Other fields with value `None`
|
68
|
-
are ignored.
|
69
|
-
"""
|
70
|
-
excluded_fields: Set[str] = set([
|
71
|
-
])
|
72
|
-
|
73
|
-
_dict = self.model_dump(
|
74
|
-
by_alias=True,
|
75
|
-
exclude=excluded_fields,
|
76
|
-
exclude_none=True,
|
77
|
-
)
|
78
|
-
# override the default output from pydantic by calling `to_dict()` of location
|
79
|
-
if self.location:
|
80
|
-
_dict['location'] = self.location.to_dict()
|
81
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
82
|
-
if self.properties:
|
83
|
-
_dict['properties'] = self.properties.to_dict()
|
84
|
-
return _dict
|
85
|
-
|
86
|
-
@classmethod
|
87
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
88
|
-
"""Create an instance of StackFrame 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
|
-
"location": Location.from_dict(obj["location"]) if obj.get("location") is not None else None,
|
97
|
-
"module": obj.get("module"),
|
98
|
-
"threadId": obj.get("threadId"),
|
99
|
-
"parameters": obj.get("parameters"),
|
100
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
101
|
-
})
|
102
|
-
return _obj
|
103
|
-
|
104
|
-
|
@@ -1,95 +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, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
22
|
-
from typing import Optional, Set
|
23
|
-
from typing_extensions import Self
|
24
|
-
|
25
|
-
class SubmissionResponse(BaseModel):
|
26
|
-
"""
|
27
|
-
SubmissionResponse
|
28
|
-
""" # noqa: E501
|
29
|
-
tenant_id: StrictStr
|
30
|
-
sensor_id: StrictStr
|
31
|
-
requester_id: StrictStr
|
32
|
-
group_id: StrictStr
|
33
|
-
event_time: StrictStr
|
34
|
-
__properties: ClassVar[List[str]] = ["tenant_id", "sensor_id", "requester_id", "group_id", "event_time"]
|
35
|
-
|
36
|
-
model_config = ConfigDict(
|
37
|
-
populate_by_name=True,
|
38
|
-
validate_assignment=True,
|
39
|
-
protected_namespaces=(),
|
40
|
-
)
|
41
|
-
|
42
|
-
|
43
|
-
def to_str(self) -> str:
|
44
|
-
"""Returns the string representation of the model using alias"""
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
-
|
47
|
-
def to_json(self) -> str:
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
-
return json.dumps(self.to_dict())
|
51
|
-
|
52
|
-
@classmethod
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
-
"""Create an instance of SubmissionResponse from a JSON string"""
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
56
|
-
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
59
|
-
|
60
|
-
This has the following differences from calling pydantic's
|
61
|
-
`self.model_dump(by_alias=True)`:
|
62
|
-
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
64
|
-
were set at model initialization. Other fields with value `None`
|
65
|
-
are ignored.
|
66
|
-
"""
|
67
|
-
excluded_fields: Set[str] = set([
|
68
|
-
])
|
69
|
-
|
70
|
-
_dict = self.model_dump(
|
71
|
-
by_alias=True,
|
72
|
-
exclude=excluded_fields,
|
73
|
-
exclude_none=True,
|
74
|
-
)
|
75
|
-
return _dict
|
76
|
-
|
77
|
-
@classmethod
|
78
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
79
|
-
"""Create an instance of SubmissionResponse from a dict"""
|
80
|
-
if obj is None:
|
81
|
-
return None
|
82
|
-
|
83
|
-
if not isinstance(obj, dict):
|
84
|
-
return cls.model_validate(obj)
|
85
|
-
|
86
|
-
_obj = cls.model_validate({
|
87
|
-
"tenant_id": obj.get("tenant_id"),
|
88
|
-
"sensor_id": obj.get("sensor_id"),
|
89
|
-
"requester_id": obj.get("requester_id"),
|
90
|
-
"group_id": obj.get("group_id"),
|
91
|
-
"event_time": obj.get("event_time")
|
92
|
-
})
|
93
|
-
return _obj
|
94
|
-
|
95
|
-
|
@@ -1,109 +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, StrictFloat, StrictInt, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
-
from typing import Optional, Set
|
23
|
-
from typing_extensions import Self
|
24
|
-
|
25
|
-
class SubmissionV2(BaseModel):
|
26
|
-
"""
|
27
|
-
SubmissionV2
|
28
|
-
""" # noqa: E501
|
29
|
-
metadata: Optional[Dict[str, Any]] = None
|
30
|
-
tags: Optional[List[StrictStr]] = None
|
31
|
-
sensor_id: StrictStr
|
32
|
-
requester_id: Optional[StrictStr] = 'UNKNOWN'
|
33
|
-
input_layer: StrictStr
|
34
|
-
input_layer_dtype: StrictStr
|
35
|
-
input_layer_shape: List[Union[StrictFloat, StrictInt]]
|
36
|
-
output_layer: StrictStr
|
37
|
-
output_layer_dtype: StrictStr
|
38
|
-
output_layer_shape: List[Union[StrictFloat, StrictInt]]
|
39
|
-
predictions: Optional[List[Union[StrictFloat, StrictInt]]] = None
|
40
|
-
event_time: Optional[StrictStr] = None
|
41
|
-
__properties: ClassVar[List[str]] = ["metadata", "tags", "sensor_id", "requester_id", "input_layer", "input_layer_dtype", "input_layer_shape", "output_layer", "output_layer_dtype", "output_layer_shape", "predictions", "event_time"]
|
42
|
-
|
43
|
-
model_config = ConfigDict(
|
44
|
-
populate_by_name=True,
|
45
|
-
validate_assignment=True,
|
46
|
-
protected_namespaces=(),
|
47
|
-
)
|
48
|
-
|
49
|
-
|
50
|
-
def to_str(self) -> str:
|
51
|
-
"""Returns the string representation of the model using alias"""
|
52
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
53
|
-
|
54
|
-
def to_json(self) -> str:
|
55
|
-
"""Returns the JSON representation of the model using alias"""
|
56
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
57
|
-
return json.dumps(self.to_dict())
|
58
|
-
|
59
|
-
@classmethod
|
60
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
61
|
-
"""Create an instance of SubmissionV2 from a JSON string"""
|
62
|
-
return cls.from_dict(json.loads(json_str))
|
63
|
-
|
64
|
-
def to_dict(self) -> Dict[str, Any]:
|
65
|
-
"""Return the dictionary representation of the model using alias.
|
66
|
-
|
67
|
-
This has the following differences from calling pydantic's
|
68
|
-
`self.model_dump(by_alias=True)`:
|
69
|
-
|
70
|
-
* `None` is only added to the output dict for nullable fields that
|
71
|
-
were set at model initialization. Other fields with value `None`
|
72
|
-
are ignored.
|
73
|
-
"""
|
74
|
-
excluded_fields: Set[str] = set([
|
75
|
-
])
|
76
|
-
|
77
|
-
_dict = self.model_dump(
|
78
|
-
by_alias=True,
|
79
|
-
exclude=excluded_fields,
|
80
|
-
exclude_none=True,
|
81
|
-
)
|
82
|
-
return _dict
|
83
|
-
|
84
|
-
@classmethod
|
85
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
86
|
-
"""Create an instance of SubmissionV2 from a dict"""
|
87
|
-
if obj is None:
|
88
|
-
return None
|
89
|
-
|
90
|
-
if not isinstance(obj, dict):
|
91
|
-
return cls.model_validate(obj)
|
92
|
-
|
93
|
-
_obj = cls.model_validate({
|
94
|
-
"metadata": obj.get("metadata"),
|
95
|
-
"tags": obj.get("tags"),
|
96
|
-
"sensor_id": obj.get("sensor_id"),
|
97
|
-
"requester_id": obj.get("requester_id") if obj.get("requester_id") is not None else 'UNKNOWN',
|
98
|
-
"input_layer": obj.get("input_layer"),
|
99
|
-
"input_layer_dtype": obj.get("input_layer_dtype"),
|
100
|
-
"input_layer_shape": obj.get("input_layer_shape"),
|
101
|
-
"output_layer": obj.get("output_layer"),
|
102
|
-
"output_layer_dtype": obj.get("output_layer_dtype"),
|
103
|
-
"output_layer_shape": obj.get("output_layer_shape"),
|
104
|
-
"predictions": obj.get("predictions"),
|
105
|
-
"event_time": obj.get("event_time")
|
106
|
-
})
|
107
|
-
return _obj
|
108
|
-
|
109
|
-
|