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
@@ -1,108 +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
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
23
|
-
from hiddenlayer.sdk.rest.models.reporting_configuration import ReportingConfiguration
|
24
|
-
from hiddenlayer.sdk.rest.models.reporting_descriptor_reference import ReportingDescriptorReference
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
class ConfigurationOverride(BaseModel):
|
29
|
-
"""
|
30
|
-
Information about how a specific rule or notification was reconfigured at runtime.
|
31
|
-
""" # noqa: E501
|
32
|
-
configuration: ReportingConfiguration
|
33
|
-
descriptor: Optional[ReportingDescriptorReference]
|
34
|
-
properties: Optional[PropertyBag] = None
|
35
|
-
__properties: ClassVar[List[str]] = ["configuration", "descriptor", "properties"]
|
36
|
-
|
37
|
-
model_config = ConfigDict(
|
38
|
-
populate_by_name=True,
|
39
|
-
validate_assignment=True,
|
40
|
-
protected_namespaces=(),
|
41
|
-
)
|
42
|
-
|
43
|
-
|
44
|
-
def to_str(self) -> str:
|
45
|
-
"""Returns the string representation of the model using alias"""
|
46
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
-
|
48
|
-
def to_json(self) -> str:
|
49
|
-
"""Returns the JSON representation of the model using alias"""
|
50
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
-
return json.dumps(self.to_dict())
|
52
|
-
|
53
|
-
@classmethod
|
54
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
-
"""Create an instance of ConfigurationOverride from a JSON string"""
|
56
|
-
return cls.from_dict(json.loads(json_str))
|
57
|
-
|
58
|
-
def to_dict(self) -> Dict[str, Any]:
|
59
|
-
"""Return the dictionary representation of the model using alias.
|
60
|
-
|
61
|
-
This has the following differences from calling pydantic's
|
62
|
-
`self.model_dump(by_alias=True)`:
|
63
|
-
|
64
|
-
* `None` is only added to the output dict for nullable fields that
|
65
|
-
were set at model initialization. Other fields with value `None`
|
66
|
-
are ignored.
|
67
|
-
"""
|
68
|
-
excluded_fields: Set[str] = set([
|
69
|
-
])
|
70
|
-
|
71
|
-
_dict = self.model_dump(
|
72
|
-
by_alias=True,
|
73
|
-
exclude=excluded_fields,
|
74
|
-
exclude_none=True,
|
75
|
-
)
|
76
|
-
# override the default output from pydantic by calling `to_dict()` of configuration
|
77
|
-
if self.configuration:
|
78
|
-
_dict['configuration'] = self.configuration.to_dict()
|
79
|
-
# override the default output from pydantic by calling `to_dict()` of descriptor
|
80
|
-
if self.descriptor:
|
81
|
-
_dict['descriptor'] = self.descriptor.to_dict()
|
82
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
83
|
-
if self.properties:
|
84
|
-
_dict['properties'] = self.properties.to_dict()
|
85
|
-
# set to None if descriptor (nullable) is None
|
86
|
-
# and model_fields_set contains the field
|
87
|
-
if self.descriptor is None and "descriptor" in self.model_fields_set:
|
88
|
-
_dict['descriptor'] = None
|
89
|
-
|
90
|
-
return _dict
|
91
|
-
|
92
|
-
@classmethod
|
93
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
94
|
-
"""Create an instance of ConfigurationOverride from a dict"""
|
95
|
-
if obj is None:
|
96
|
-
return None
|
97
|
-
|
98
|
-
if not isinstance(obj, dict):
|
99
|
-
return cls.model_validate(obj)
|
100
|
-
|
101
|
-
_obj = cls.model_validate({
|
102
|
-
"configuration": ReportingConfiguration.from_dict(obj["configuration"]) if obj.get("configuration") is not None else None,
|
103
|
-
"descriptor": ReportingDescriptorReference.from_dict(obj["descriptor"]) if obj.get("descriptor") is not None else None,
|
104
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
105
|
-
})
|
106
|
-
return _obj
|
107
|
-
|
108
|
-
|
@@ -1,114 +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.artifact_location import ArtifactLocation
|
24
|
-
from hiddenlayer.sdk.rest.models.invocation import Invocation
|
25
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
26
|
-
from hiddenlayer.sdk.rest.models.tool import Tool
|
27
|
-
from typing import Optional, Set
|
28
|
-
from typing_extensions import Self
|
29
|
-
|
30
|
-
class Conversion(BaseModel):
|
31
|
-
"""
|
32
|
-
Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.
|
33
|
-
""" # noqa: E501
|
34
|
-
tool: Tool
|
35
|
-
invocation: Optional[Invocation] = None
|
36
|
-
analysis_tool_log_files: Optional[Annotated[List[ArtifactLocation], Field(min_length=0)]] = Field(default=None, description="The locations of the analysis tool's per-run log files.", alias="analysisToolLogFiles")
|
37
|
-
properties: Optional[PropertyBag] = None
|
38
|
-
__properties: ClassVar[List[str]] = ["tool", "invocation", "analysisToolLogFiles", "properties"]
|
39
|
-
|
40
|
-
model_config = ConfigDict(
|
41
|
-
populate_by_name=True,
|
42
|
-
validate_assignment=True,
|
43
|
-
protected_namespaces=(),
|
44
|
-
)
|
45
|
-
|
46
|
-
|
47
|
-
def to_str(self) -> str:
|
48
|
-
"""Returns the string representation of the model using alias"""
|
49
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
-
|
51
|
-
def to_json(self) -> str:
|
52
|
-
"""Returns the JSON representation of the model using alias"""
|
53
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
-
return json.dumps(self.to_dict())
|
55
|
-
|
56
|
-
@classmethod
|
57
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
-
"""Create an instance of Conversion from a JSON string"""
|
59
|
-
return cls.from_dict(json.loads(json_str))
|
60
|
-
|
61
|
-
def to_dict(self) -> Dict[str, Any]:
|
62
|
-
"""Return the dictionary representation of the model using alias.
|
63
|
-
|
64
|
-
This has the following differences from calling pydantic's
|
65
|
-
`self.model_dump(by_alias=True)`:
|
66
|
-
|
67
|
-
* `None` is only added to the output dict for nullable fields that
|
68
|
-
were set at model initialization. Other fields with value `None`
|
69
|
-
are ignored.
|
70
|
-
"""
|
71
|
-
excluded_fields: Set[str] = set([
|
72
|
-
])
|
73
|
-
|
74
|
-
_dict = self.model_dump(
|
75
|
-
by_alias=True,
|
76
|
-
exclude=excluded_fields,
|
77
|
-
exclude_none=True,
|
78
|
-
)
|
79
|
-
# override the default output from pydantic by calling `to_dict()` of tool
|
80
|
-
if self.tool:
|
81
|
-
_dict['tool'] = self.tool.to_dict()
|
82
|
-
# override the default output from pydantic by calling `to_dict()` of invocation
|
83
|
-
if self.invocation:
|
84
|
-
_dict['invocation'] = self.invocation.to_dict()
|
85
|
-
# override the default output from pydantic by calling `to_dict()` of each item in analysis_tool_log_files (list)
|
86
|
-
_items = []
|
87
|
-
if self.analysis_tool_log_files:
|
88
|
-
for _item in self.analysis_tool_log_files:
|
89
|
-
if _item:
|
90
|
-
_items.append(_item.to_dict())
|
91
|
-
_dict['analysisToolLogFiles'] = _items
|
92
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
93
|
-
if self.properties:
|
94
|
-
_dict['properties'] = self.properties.to_dict()
|
95
|
-
return _dict
|
96
|
-
|
97
|
-
@classmethod
|
98
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
|
-
"""Create an instance of Conversion 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
|
-
"tool": Tool.from_dict(obj["tool"]) if obj.get("tool") is not None else None,
|
108
|
-
"invocation": Invocation.from_dict(obj["invocation"]) if obj.get("invocation") is not None else None,
|
109
|
-
"analysisToolLogFiles": [ArtifactLocation.from_dict(_item) for _item in obj["analysisToolLogFiles"]] if obj.get("analysisToolLogFiles") is not None else None,
|
110
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
111
|
-
})
|
112
|
-
return _obj
|
113
|
-
|
114
|
-
|
@@ -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, StrictBool, StrictInt, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing import Optional, Set
|
23
|
-
from typing_extensions import Self
|
24
|
-
|
25
|
-
class CreateSensorRequest(BaseModel):
|
26
|
-
"""
|
27
|
-
CreateSensorRequest
|
28
|
-
""" # noqa: E501
|
29
|
-
plaintext_name: StrictStr
|
30
|
-
version: Optional[StrictInt] = None
|
31
|
-
active: Optional[StrictBool] = True
|
32
|
-
tags: Optional[Dict[str, Any]] = None
|
33
|
-
adhoc: Optional[StrictBool] = False
|
34
|
-
__properties: ClassVar[List[str]] = ["plaintext_name", "version", "active", "tags", "adhoc"]
|
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 CreateSensorRequest 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 CreateSensorRequest 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
|
-
"plaintext_name": obj.get("plaintext_name"),
|
88
|
-
"version": obj.get("version"),
|
89
|
-
"active": obj.get("active") if obj.get("active") is not None else True,
|
90
|
-
"tags": obj.get("tags"),
|
91
|
-
"adhoc": obj.get("adhoc") if obj.get("adhoc") is not None else False
|
92
|
-
})
|
93
|
-
return _obj
|
94
|
-
|
95
|
-
|
@@ -1,108 +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
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from hiddenlayer.sdk.rest.models.message import Message
|
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 Edge(BaseModel):
|
28
|
-
"""
|
29
|
-
Represents a directed edge in a graph.
|
30
|
-
""" # noqa: E501
|
31
|
-
id: StrictStr = Field(description="A string that uniquely identifies the edge within its graph.")
|
32
|
-
label: Optional[Message] = None
|
33
|
-
source_node_id: StrictStr = Field(description="Identifies the source node (the node at which the edge starts).", alias="sourceNodeId")
|
34
|
-
target_node_id: StrictStr = Field(description="Identifies the target node (the node at which the edge ends).", alias="targetNodeId")
|
35
|
-
properties: Optional[PropertyBag] = None
|
36
|
-
__properties: ClassVar[List[str]] = ["id", "label", "sourceNodeId", "targetNodeId", "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 Edge 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 label
|
78
|
-
if self.label:
|
79
|
-
_dict['label'] = self.label.to_dict()
|
80
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
81
|
-
if self.properties:
|
82
|
-
_dict['properties'] = self.properties.to_dict()
|
83
|
-
# set to None if label (nullable) is None
|
84
|
-
# and model_fields_set contains the field
|
85
|
-
if self.label is None and "label" in self.model_fields_set:
|
86
|
-
_dict['label'] = None
|
87
|
-
|
88
|
-
return _dict
|
89
|
-
|
90
|
-
@classmethod
|
91
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
92
|
-
"""Create an instance of Edge from a dict"""
|
93
|
-
if obj is None:
|
94
|
-
return None
|
95
|
-
|
96
|
-
if not isinstance(obj, dict):
|
97
|
-
return cls.model_validate(obj)
|
98
|
-
|
99
|
-
_obj = cls.model_validate({
|
100
|
-
"id": obj.get("id"),
|
101
|
-
"label": Message.from_dict(obj["label"]) if obj.get("label") is not None else None,
|
102
|
-
"sourceNodeId": obj.get("sourceNodeId"),
|
103
|
-
"targetNodeId": obj.get("targetNodeId"),
|
104
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
105
|
-
})
|
106
|
-
return _obj
|
107
|
-
|
108
|
-
|
@@ -1,122 +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
|
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.multiformat_message_string import MultiformatMessageString
|
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 EdgeTraversal(BaseModel):
|
30
|
-
"""
|
31
|
-
Represents the traversal of a single edge during a graph traversal.
|
32
|
-
""" # noqa: E501
|
33
|
-
edge_id: StrictStr = Field(description="Identifies the edge being traversed.", alias="edgeId")
|
34
|
-
message: Optional[Message] = None
|
35
|
-
final_state: Optional[Dict[str, MultiformatMessageString]] = Field(default=None, description="The values of relevant expressions after the edge has been traversed.", alias="finalState")
|
36
|
-
step_over_edge_count: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The number of edge traversals necessary to return from a nested graph.", alias="stepOverEdgeCount")
|
37
|
-
properties: Optional[PropertyBag] = None
|
38
|
-
__properties: ClassVar[List[str]] = ["edgeId", "message", "finalState", "stepOverEdgeCount", "properties"]
|
39
|
-
|
40
|
-
model_config = ConfigDict(
|
41
|
-
populate_by_name=True,
|
42
|
-
validate_assignment=True,
|
43
|
-
protected_namespaces=(),
|
44
|
-
)
|
45
|
-
|
46
|
-
|
47
|
-
def to_str(self) -> str:
|
48
|
-
"""Returns the string representation of the model using alias"""
|
49
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
-
|
51
|
-
def to_json(self) -> str:
|
52
|
-
"""Returns the JSON representation of the model using alias"""
|
53
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
-
return json.dumps(self.to_dict())
|
55
|
-
|
56
|
-
@classmethod
|
57
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
-
"""Create an instance of EdgeTraversal from a JSON string"""
|
59
|
-
return cls.from_dict(json.loads(json_str))
|
60
|
-
|
61
|
-
def to_dict(self) -> Dict[str, Any]:
|
62
|
-
"""Return the dictionary representation of the model using alias.
|
63
|
-
|
64
|
-
This has the following differences from calling pydantic's
|
65
|
-
`self.model_dump(by_alias=True)`:
|
66
|
-
|
67
|
-
* `None` is only added to the output dict for nullable fields that
|
68
|
-
were set at model initialization. Other fields with value `None`
|
69
|
-
are ignored.
|
70
|
-
"""
|
71
|
-
excluded_fields: Set[str] = set([
|
72
|
-
])
|
73
|
-
|
74
|
-
_dict = self.model_dump(
|
75
|
-
by_alias=True,
|
76
|
-
exclude=excluded_fields,
|
77
|
-
exclude_none=True,
|
78
|
-
)
|
79
|
-
# override the default output from pydantic by calling `to_dict()` of message
|
80
|
-
if self.message:
|
81
|
-
_dict['message'] = self.message.to_dict()
|
82
|
-
# override the default output from pydantic by calling `to_dict()` of each value in final_state (dict)
|
83
|
-
_field_dict = {}
|
84
|
-
if self.final_state:
|
85
|
-
for _key in self.final_state:
|
86
|
-
if self.final_state[_key]:
|
87
|
-
_field_dict[_key] = self.final_state[_key].to_dict()
|
88
|
-
_dict['finalState'] = _field_dict
|
89
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
90
|
-
if self.properties:
|
91
|
-
_dict['properties'] = self.properties.to_dict()
|
92
|
-
# set to None if message (nullable) is None
|
93
|
-
# and model_fields_set contains the field
|
94
|
-
if self.message is None and "message" in self.model_fields_set:
|
95
|
-
_dict['message'] = None
|
96
|
-
|
97
|
-
return _dict
|
98
|
-
|
99
|
-
@classmethod
|
100
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
101
|
-
"""Create an instance of EdgeTraversal from a dict"""
|
102
|
-
if obj is None:
|
103
|
-
return None
|
104
|
-
|
105
|
-
if not isinstance(obj, dict):
|
106
|
-
return cls.model_validate(obj)
|
107
|
-
|
108
|
-
_obj = cls.model_validate({
|
109
|
-
"edgeId": obj.get("edgeId"),
|
110
|
-
"message": Message.from_dict(obj["message"]) if obj.get("message") is not None else None,
|
111
|
-
"finalState": dict(
|
112
|
-
(_k, MultiformatMessageString.from_dict(_v))
|
113
|
-
for _k, _v in obj["finalState"].items()
|
114
|
-
)
|
115
|
-
if obj.get("finalState") is not None
|
116
|
-
else None,
|
117
|
-
"stepOverEdgeCount": obj.get("stepOverEdgeCount"),
|
118
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
119
|
-
})
|
120
|
-
return _obj
|
121
|
-
|
122
|
-
|
@@ -1,91 +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
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing import Optional, Set
|
23
|
-
from typing_extensions import Self
|
24
|
-
|
25
|
-
class ErrorsInner(BaseModel):
|
26
|
-
"""
|
27
|
-
ErrorsInner
|
28
|
-
""" # noqa: E501
|
29
|
-
code: Optional[StrictStr] = None
|
30
|
-
detail: Optional[StrictStr] = None
|
31
|
-
pointer: Optional[List[StrictStr]] = Field(default=None, description="array of JSON Pointers")
|
32
|
-
__properties: ClassVar[List[str]] = ["code", "detail", "pointer"]
|
33
|
-
|
34
|
-
model_config = ConfigDict(
|
35
|
-
populate_by_name=True,
|
36
|
-
validate_assignment=True,
|
37
|
-
protected_namespaces=(),
|
38
|
-
)
|
39
|
-
|
40
|
-
|
41
|
-
def to_str(self) -> str:
|
42
|
-
"""Returns the string representation of the model using alias"""
|
43
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
44
|
-
|
45
|
-
def to_json(self) -> str:
|
46
|
-
"""Returns the JSON representation of the model using alias"""
|
47
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
|
-
return json.dumps(self.to_dict())
|
49
|
-
|
50
|
-
@classmethod
|
51
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
-
"""Create an instance of ErrorsInner from a JSON string"""
|
53
|
-
return cls.from_dict(json.loads(json_str))
|
54
|
-
|
55
|
-
def to_dict(self) -> Dict[str, Any]:
|
56
|
-
"""Return the dictionary representation of the model using alias.
|
57
|
-
|
58
|
-
This has the following differences from calling pydantic's
|
59
|
-
`self.model_dump(by_alias=True)`:
|
60
|
-
|
61
|
-
* `None` is only added to the output dict for nullable fields that
|
62
|
-
were set at model initialization. Other fields with value `None`
|
63
|
-
are ignored.
|
64
|
-
"""
|
65
|
-
excluded_fields: Set[str] = set([
|
66
|
-
])
|
67
|
-
|
68
|
-
_dict = self.model_dump(
|
69
|
-
by_alias=True,
|
70
|
-
exclude=excluded_fields,
|
71
|
-
exclude_none=True,
|
72
|
-
)
|
73
|
-
return _dict
|
74
|
-
|
75
|
-
@classmethod
|
76
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
-
"""Create an instance of ErrorsInner from a dict"""
|
78
|
-
if obj is None:
|
79
|
-
return None
|
80
|
-
|
81
|
-
if not isinstance(obj, dict):
|
82
|
-
return cls.model_validate(obj)
|
83
|
-
|
84
|
-
_obj = cls.model_validate({
|
85
|
-
"code": obj.get("code"),
|
86
|
-
"detail": obj.get("detail"),
|
87
|
-
"pointer": obj.get("pointer")
|
88
|
-
})
|
89
|
-
return _obj
|
90
|
-
|
91
|
-
|