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,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, 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.property_bag import PropertyBag
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
class ArtifactLocation(BaseModel):
|
29
|
-
"""
|
30
|
-
Specifies the location of an artifact.
|
31
|
-
""" # noqa: E501
|
32
|
-
uri: Optional[StrictStr] = Field(default=None, description="A string containing a valid relative or absolute URI.")
|
33
|
-
uri_base_id: Optional[StrictStr] = Field(default=None, description="A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.", alias="uriBaseId")
|
34
|
-
index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, description="The index within the run artifacts array of the artifact object associated with the artifact location.")
|
35
|
-
description: Optional[Message] = None
|
36
|
-
properties: Optional[PropertyBag] = None
|
37
|
-
__properties: ClassVar[List[str]] = ["uri", "uriBaseId", "index", "description", "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 ArtifactLocation 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 description
|
79
|
-
if self.description:
|
80
|
-
_dict['description'] = self.description.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
|
-
# set to None if description (nullable) is None
|
85
|
-
# and model_fields_set contains the field
|
86
|
-
if self.description is None and "description" in self.model_fields_set:
|
87
|
-
_dict['description'] = None
|
88
|
-
|
89
|
-
return _dict
|
90
|
-
|
91
|
-
@classmethod
|
92
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
-
"""Create an instance of ArtifactLocation 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
|
-
"uri": obj.get("uri"),
|
102
|
-
"uriBaseId": obj.get("uriBaseId"),
|
103
|
-
"index": obj.get("index") if obj.get("index") is not None else -1,
|
104
|
-
"description": Message.from_dict(obj["description"]) if obj.get("description") is not None else None,
|
105
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
106
|
-
})
|
107
|
-
return _obj
|
108
|
-
|
109
|
-
|
@@ -1,129 +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.message import Message
|
25
|
-
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
26
|
-
from hiddenlayer.sdk.rest.models.rectangle import Rectangle
|
27
|
-
from hiddenlayer.sdk.rest.models.region import Region
|
28
|
-
from typing import Optional, Set
|
29
|
-
from typing_extensions import Self
|
30
|
-
|
31
|
-
class Attachment(BaseModel):
|
32
|
-
"""
|
33
|
-
An artifact relevant to a result.
|
34
|
-
""" # noqa: E501
|
35
|
-
description: Optional[Message] = None
|
36
|
-
artifact_location: ArtifactLocation = Field(alias="artifactLocation")
|
37
|
-
regions: Optional[Annotated[List[Region], Field(min_length=0)]] = Field(default=None, description="An array of regions of interest within the attachment.")
|
38
|
-
rectangles: Optional[Annotated[List[Rectangle], Field(min_length=0)]] = Field(default=None, description="An array of rectangles specifying areas of interest within the image.")
|
39
|
-
properties: Optional[PropertyBag] = None
|
40
|
-
__properties: ClassVar[List[str]] = ["description", "artifactLocation", "regions", "rectangles", "properties"]
|
41
|
-
|
42
|
-
model_config = ConfigDict(
|
43
|
-
populate_by_name=True,
|
44
|
-
validate_assignment=True,
|
45
|
-
protected_namespaces=(),
|
46
|
-
)
|
47
|
-
|
48
|
-
|
49
|
-
def to_str(self) -> str:
|
50
|
-
"""Returns the string representation of the model using alias"""
|
51
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
52
|
-
|
53
|
-
def to_json(self) -> str:
|
54
|
-
"""Returns the JSON representation of the model using alias"""
|
55
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
56
|
-
return json.dumps(self.to_dict())
|
57
|
-
|
58
|
-
@classmethod
|
59
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
60
|
-
"""Create an instance of Attachment from a JSON string"""
|
61
|
-
return cls.from_dict(json.loads(json_str))
|
62
|
-
|
63
|
-
def to_dict(self) -> Dict[str, Any]:
|
64
|
-
"""Return the dictionary representation of the model using alias.
|
65
|
-
|
66
|
-
This has the following differences from calling pydantic's
|
67
|
-
`self.model_dump(by_alias=True)`:
|
68
|
-
|
69
|
-
* `None` is only added to the output dict for nullable fields that
|
70
|
-
were set at model initialization. Other fields with value `None`
|
71
|
-
are ignored.
|
72
|
-
"""
|
73
|
-
excluded_fields: Set[str] = set([
|
74
|
-
])
|
75
|
-
|
76
|
-
_dict = self.model_dump(
|
77
|
-
by_alias=True,
|
78
|
-
exclude=excluded_fields,
|
79
|
-
exclude_none=True,
|
80
|
-
)
|
81
|
-
# override the default output from pydantic by calling `to_dict()` of description
|
82
|
-
if self.description:
|
83
|
-
_dict['description'] = self.description.to_dict()
|
84
|
-
# override the default output from pydantic by calling `to_dict()` of artifact_location
|
85
|
-
if self.artifact_location:
|
86
|
-
_dict['artifactLocation'] = self.artifact_location.to_dict()
|
87
|
-
# override the default output from pydantic by calling `to_dict()` of each item in regions (list)
|
88
|
-
_items = []
|
89
|
-
if self.regions:
|
90
|
-
for _item in self.regions:
|
91
|
-
if _item:
|
92
|
-
_items.append(_item.to_dict())
|
93
|
-
_dict['regions'] = _items
|
94
|
-
# override the default output from pydantic by calling `to_dict()` of each item in rectangles (list)
|
95
|
-
_items = []
|
96
|
-
if self.rectangles:
|
97
|
-
for _item in self.rectangles:
|
98
|
-
if _item:
|
99
|
-
_items.append(_item.to_dict())
|
100
|
-
_dict['rectangles'] = _items
|
101
|
-
# override the default output from pydantic by calling `to_dict()` of properties
|
102
|
-
if self.properties:
|
103
|
-
_dict['properties'] = self.properties.to_dict()
|
104
|
-
# set to None if description (nullable) is None
|
105
|
-
# and model_fields_set contains the field
|
106
|
-
if self.description is None and "description" in self.model_fields_set:
|
107
|
-
_dict['description'] = None
|
108
|
-
|
109
|
-
return _dict
|
110
|
-
|
111
|
-
@classmethod
|
112
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
113
|
-
"""Create an instance of Attachment from a dict"""
|
114
|
-
if obj is None:
|
115
|
-
return None
|
116
|
-
|
117
|
-
if not isinstance(obj, dict):
|
118
|
-
return cls.model_validate(obj)
|
119
|
-
|
120
|
-
_obj = cls.model_validate({
|
121
|
-
"description": Message.from_dict(obj["description"]) if obj.get("description") is not None else None,
|
122
|
-
"artifactLocation": ArtifactLocation.from_dict(obj["artifactLocation"]) if obj.get("artifactLocation") is not None else None,
|
123
|
-
"regions": [Region.from_dict(_item) for _item in obj["regions"]] if obj.get("regions") is not None else None,
|
124
|
-
"rectangles": [Rectangle.from_dict(_item) for _item in obj["rectangles"]] if obj.get("rectangles") is not None else None,
|
125
|
-
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
126
|
-
})
|
127
|
-
return _obj
|
128
|
-
|
129
|
-
|
@@ -1,87 +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 BeginMultiFileUpload200Response(BaseModel):
|
26
|
-
"""
|
27
|
-
BeginMultiFileUpload200Response
|
28
|
-
""" # noqa: E501
|
29
|
-
scan_id: Optional[StrictStr] = Field(default=None, description="Request to resource is successful")
|
30
|
-
__properties: ClassVar[List[str]] = ["scan_id"]
|
31
|
-
|
32
|
-
model_config = ConfigDict(
|
33
|
-
populate_by_name=True,
|
34
|
-
validate_assignment=True,
|
35
|
-
protected_namespaces=(),
|
36
|
-
)
|
37
|
-
|
38
|
-
|
39
|
-
def to_str(self) -> str:
|
40
|
-
"""Returns the string representation of the model using alias"""
|
41
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
42
|
-
|
43
|
-
def to_json(self) -> str:
|
44
|
-
"""Returns the JSON representation of the model using alias"""
|
45
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
|
-
return json.dumps(self.to_dict())
|
47
|
-
|
48
|
-
@classmethod
|
49
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
|
-
"""Create an instance of BeginMultiFileUpload200Response from a JSON string"""
|
51
|
-
return cls.from_dict(json.loads(json_str))
|
52
|
-
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
54
|
-
"""Return the dictionary representation of the model using alias.
|
55
|
-
|
56
|
-
This has the following differences from calling pydantic's
|
57
|
-
`self.model_dump(by_alias=True)`:
|
58
|
-
|
59
|
-
* `None` is only added to the output dict for nullable fields that
|
60
|
-
were set at model initialization. Other fields with value `None`
|
61
|
-
are ignored.
|
62
|
-
"""
|
63
|
-
excluded_fields: Set[str] = set([
|
64
|
-
])
|
65
|
-
|
66
|
-
_dict = self.model_dump(
|
67
|
-
by_alias=True,
|
68
|
-
exclude=excluded_fields,
|
69
|
-
exclude_none=True,
|
70
|
-
)
|
71
|
-
return _dict
|
72
|
-
|
73
|
-
@classmethod
|
74
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
-
"""Create an instance of BeginMultiFileUpload200Response from a dict"""
|
76
|
-
if obj is None:
|
77
|
-
return None
|
78
|
-
|
79
|
-
if not isinstance(obj, dict):
|
80
|
-
return cls.model_validate(obj)
|
81
|
-
|
82
|
-
_obj = cls.model_validate({
|
83
|
-
"scan_id": obj.get("scan_id")
|
84
|
-
})
|
85
|
-
return _obj
|
86
|
-
|
87
|
-
|
@@ -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, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
22
|
-
from hiddenlayer.sdk.rest.models.begin_multipart_file_upload200_response_parts_inner import BeginMultipartFileUpload200ResponsePartsInner
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
class BeginMultipartFileUpload200Response(BaseModel):
|
27
|
-
"""
|
28
|
-
BeginMultipartFileUpload200Response
|
29
|
-
""" # noqa: E501
|
30
|
-
upload_id: StrictStr = Field(description="UploadId for the current file")
|
31
|
-
parts: List[BeginMultipartFileUpload200ResponsePartsInner]
|
32
|
-
__properties: ClassVar[List[str]] = ["upload_id", "parts"]
|
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 BeginMultipartFileUpload200Response 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
|
-
# override the default output from pydantic by calling `to_dict()` of each item in parts (list)
|
74
|
-
_items = []
|
75
|
-
if self.parts:
|
76
|
-
for _item in self.parts:
|
77
|
-
if _item:
|
78
|
-
_items.append(_item.to_dict())
|
79
|
-
_dict['parts'] = _items
|
80
|
-
return _dict
|
81
|
-
|
82
|
-
@classmethod
|
83
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
84
|
-
"""Create an instance of BeginMultipartFileUpload200Response 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
|
-
"upload_id": obj.get("upload_id"),
|
93
|
-
"parts": [BeginMultipartFileUpload200ResponsePartsInner.from_dict(_item) for _item in obj["parts"]] if obj.get("parts") is not None else None
|
94
|
-
})
|
95
|
-
return _obj
|
96
|
-
|
97
|
-
|
@@ -1,94 +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 typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
class BeginMultipartFileUpload200ResponsePartsInner(BaseModel):
|
27
|
-
"""
|
28
|
-
BeginMultipartFileUpload200ResponsePartsInner
|
29
|
-
""" # noqa: E501
|
30
|
-
part_number: Optional[Annotated[int, Field(strict=True, ge=0)]] = None
|
31
|
-
start_offset: Optional[StrictInt] = None
|
32
|
-
end_offset: Optional[StrictInt] = None
|
33
|
-
upload_url: Optional[StrictStr] = None
|
34
|
-
__properties: ClassVar[List[str]] = ["part_number", "start_offset", "end_offset", "upload_url"]
|
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 BeginMultipartFileUpload200ResponsePartsInner 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 BeginMultipartFileUpload200ResponsePartsInner 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
|
-
"part_number": obj.get("part_number"),
|
88
|
-
"start_offset": obj.get("start_offset"),
|
89
|
-
"end_offset": obj.get("end_offset"),
|
90
|
-
"upload_url": obj.get("upload_url")
|
91
|
-
})
|
92
|
-
return _obj
|
93
|
-
|
94
|
-
|
@@ -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.thread_flow import ThreadFlow
|
26
|
-
from typing import Optional, Set
|
27
|
-
from typing_extensions import Self
|
28
|
-
|
29
|
-
class CodeFlow(BaseModel):
|
30
|
-
"""
|
31
|
-
A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.
|
32
|
-
""" # noqa: E501
|
33
|
-
message: Optional[Message] = None
|
34
|
-
thread_flows: Annotated[List[ThreadFlow], Field(min_length=1)] = Field(description="An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.", alias="threadFlows")
|
35
|
-
properties: Optional[PropertyBag] = None
|
36
|
-
__properties: ClassVar[List[str]] = ["message", "threadFlows", "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 CodeFlow 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 thread_flows (list)
|
81
|
-
_items = []
|
82
|
-
if self.thread_flows:
|
83
|
-
for _item in self.thread_flows:
|
84
|
-
if _item:
|
85
|
-
_items.append(_item.to_dict())
|
86
|
-
_dict['threadFlows'] = _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 CodeFlow 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
|
-
"threadFlows": [ThreadFlow.from_dict(_item) for _item in obj["threadFlows"]] if obj.get("threadFlows") 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
|
-
|