hiddenlayer-sdk 0.1.2__py3-none-any.whl → 1.0.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- hiddenlayer/sdk/models.py +45 -8
- hiddenlayer/sdk/rest/__init__.py +80 -3
- hiddenlayer/sdk/rest/api/__init__.py +3 -0
- hiddenlayer/sdk/rest/api/aidr_predictive_api.py +1 -1
- hiddenlayer/sdk/rest/api/health_api.py +272 -0
- hiddenlayer/sdk/rest/api/model_scan_api.py +1 -1
- hiddenlayer/sdk/rest/api/model_supply_chain_api.py +2927 -0
- hiddenlayer/sdk/rest/api/readiness_api.py +272 -0
- hiddenlayer/sdk/rest/api/sensor_api.py +345 -16
- hiddenlayer/sdk/rest/api_client.py +1 -1
- hiddenlayer/sdk/rest/configuration.py +4 -4
- hiddenlayer/sdk/rest/exceptions.py +1 -1
- hiddenlayer/sdk/rest/models/__init__.py +77 -3
- hiddenlayer/sdk/rest/models/address.py +110 -0
- hiddenlayer/sdk/rest/models/artifact.py +155 -0
- hiddenlayer/sdk/rest/models/artifact_change.py +108 -0
- hiddenlayer/sdk/rest/models/artifact_content.py +101 -0
- hiddenlayer/sdk/rest/models/artifact_location.py +109 -0
- hiddenlayer/sdk/rest/models/attachment.py +129 -0
- hiddenlayer/sdk/rest/models/code_flow.py +113 -0
- hiddenlayer/sdk/rest/models/configuration_override.py +108 -0
- hiddenlayer/sdk/rest/models/conversion.py +114 -0
- hiddenlayer/sdk/rest/models/create_sensor_request.py +1 -1
- hiddenlayer/sdk/rest/models/detections.py +101 -0
- hiddenlayer/sdk/rest/models/edge.py +108 -0
- hiddenlayer/sdk/rest/models/edge_traversal.py +122 -0
- hiddenlayer/sdk/rest/models/exception.py +113 -0
- hiddenlayer/sdk/rest/models/external_properties.py +273 -0
- hiddenlayer/sdk/rest/models/external_property_file_reference.py +102 -0
- hiddenlayer/sdk/rest/models/external_property_file_references.py +240 -0
- hiddenlayer/sdk/rest/models/file_details_v3.py +140 -0
- hiddenlayer/sdk/rest/models/file_results_inner.py +121 -0
- hiddenlayer/sdk/rest/models/file_scan_report_v3.py +95 -0
- hiddenlayer/sdk/rest/models/fix.py +113 -0
- hiddenlayer/sdk/rest/models/get_multipart_upload_response.py +1 -1
- hiddenlayer/sdk/rest/models/graph.py +123 -0
- hiddenlayer/sdk/rest/models/graph_traversal.py +97 -0
- hiddenlayer/sdk/rest/models/invocation.py +199 -0
- hiddenlayer/sdk/rest/models/location.py +146 -0
- hiddenlayer/sdk/rest/models/{validation_error_model_loc_inner.py → location_inner.py} +7 -7
- hiddenlayer/sdk/rest/models/location_relationship.py +107 -0
- hiddenlayer/sdk/rest/models/logical_location.py +104 -0
- hiddenlayer/sdk/rest/models/message.py +92 -0
- hiddenlayer/sdk/rest/models/mitre_atlas_inner.py +110 -0
- hiddenlayer/sdk/rest/models/model.py +1 -1
- hiddenlayer/sdk/rest/models/model_inventory_info.py +99 -0
- hiddenlayer/sdk/rest/models/model_query_response.py +1 -1
- hiddenlayer/sdk/rest/models/model_scan_api_v3_scan_model_version_id_patch200_response.py +87 -0
- hiddenlayer/sdk/rest/models/model_scan_api_v3_scan_query200_response.py +102 -0
- hiddenlayer/sdk/rest/models/multiformat_message_string.py +95 -0
- hiddenlayer/sdk/rest/models/multipart_upload_part.py +1 -1
- hiddenlayer/sdk/rest/models/node.py +122 -0
- hiddenlayer/sdk/rest/models/notification.py +157 -0
- hiddenlayer/sdk/rest/models/paged_response_with_total.py +94 -0
- hiddenlayer/sdk/rest/models/physical_location.py +94 -0
- hiddenlayer/sdk/rest/models/property_bag.py +101 -0
- hiddenlayer/sdk/rest/models/rectangle.py +110 -0
- hiddenlayer/sdk/rest/models/region.py +127 -0
- hiddenlayer/sdk/rest/models/replacement.py +103 -0
- hiddenlayer/sdk/rest/models/reporting_configuration.py +113 -0
- hiddenlayer/sdk/rest/models/reporting_descriptor.py +162 -0
- hiddenlayer/sdk/rest/models/reporting_descriptor_reference.py +103 -0
- hiddenlayer/sdk/rest/models/reporting_descriptor_relationship.py +115 -0
- hiddenlayer/sdk/rest/models/result.py +312 -0
- hiddenlayer/sdk/rest/models/result_provenance.py +133 -0
- hiddenlayer/sdk/rest/models/rule_details_inner.py +102 -0
- hiddenlayer/sdk/rest/models/run.py +318 -0
- hiddenlayer/sdk/rest/models/run_automation_details.py +129 -0
- hiddenlayer/sdk/rest/models/sarif210.py +123 -0
- hiddenlayer/sdk/rest/models/scan_create_request.py +87 -0
- hiddenlayer/sdk/rest/models/scan_detection_v3.py +156 -0
- hiddenlayer/sdk/rest/models/scan_header_v3.py +129 -0
- hiddenlayer/sdk/rest/models/scan_job.py +109 -0
- hiddenlayer/sdk/rest/models/scan_job_inventory.py +137 -0
- hiddenlayer/sdk/rest/models/scan_model_details_v3.py +95 -0
- hiddenlayer/sdk/rest/models/scan_model_ids_v3.py +89 -0
- hiddenlayer/sdk/rest/models/scan_model_request.py +1 -1
- hiddenlayer/sdk/rest/models/scan_report_v3.py +139 -0
- hiddenlayer/sdk/rest/models/{file_info.py → scan_results.py} +14 -6
- hiddenlayer/sdk/rest/models/scan_results_v2.py +30 -10
- hiddenlayer/sdk/rest/models/security_posture.py +89 -0
- hiddenlayer/sdk/rest/models/sensor_sor_model_card_query_response.py +101 -0
- hiddenlayer/sdk/rest/models/sensor_sor_model_card_response.py +127 -0
- hiddenlayer/sdk/rest/models/sensor_sor_query_filter.py +1 -1
- hiddenlayer/sdk/rest/models/sensor_sor_query_request.py +1 -1
- hiddenlayer/sdk/rest/models/special_locations.py +97 -0
- hiddenlayer/sdk/rest/models/stack.py +113 -0
- hiddenlayer/sdk/rest/models/stack_frame.py +104 -0
- hiddenlayer/sdk/rest/models/submission_response.py +1 -1
- hiddenlayer/sdk/rest/models/submission_v2.py +1 -1
- hiddenlayer/sdk/rest/models/suppression.py +133 -0
- hiddenlayer/sdk/rest/models/thread_flow.py +144 -0
- hiddenlayer/sdk/rest/models/thread_flow_location.py +166 -0
- hiddenlayer/sdk/rest/models/tool.py +107 -0
- hiddenlayer/sdk/rest/models/tool_component.py +251 -0
- hiddenlayer/sdk/rest/models/tool_component_reference.py +108 -0
- hiddenlayer/sdk/rest/models/translation_metadata.py +110 -0
- hiddenlayer/sdk/rest/models/validation_error_model.py +4 -4
- hiddenlayer/sdk/rest/models/version_control_details.py +108 -0
- hiddenlayer/sdk/rest/models/web_request.py +112 -0
- hiddenlayer/sdk/rest/models/web_response.py +112 -0
- hiddenlayer/sdk/rest/rest.py +1 -1
- hiddenlayer/sdk/services/model.py +5 -2
- hiddenlayer/sdk/services/model_scan.py +153 -105
- hiddenlayer/sdk/version.py +1 -1
- {hiddenlayer_sdk-0.1.2.dist-info → hiddenlayer_sdk-1.0.0.dist-info}/METADATA +39 -20
- hiddenlayer_sdk-1.0.0.dist-info/RECORD +118 -0
- {hiddenlayer_sdk-0.1.2.dist-info → hiddenlayer_sdk-1.0.0.dist-info}/WHEEL +1 -1
- hiddenlayer/sdk/enterprise/__init__.py +0 -0
- hiddenlayer/sdk/enterprise/enterprise_model_scan_api.py +0 -55
- hiddenlayer_sdk-0.1.2.dist-info/RECORD +0 -43
- {hiddenlayer_sdk-0.1.2.dist-info → hiddenlayer_sdk-1.0.0.dist-info}/LICENSE +0 -0
- {hiddenlayer_sdk-0.1.2.dist-info → hiddenlayer_sdk-1.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,251 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
HiddenLayer ModelScan V2
|
5
|
+
|
6
|
+
HiddenLayer ModelScan API for scanning of models
|
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, StrictBool, StrictStr, field_validator
|
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.multiformat_message_string import MultiformatMessageString
|
25
|
+
from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
|
26
|
+
from hiddenlayer.sdk.rest.models.reporting_descriptor import ReportingDescriptor
|
27
|
+
from hiddenlayer.sdk.rest.models.tool_component_reference import ToolComponentReference
|
28
|
+
from hiddenlayer.sdk.rest.models.translation_metadata import TranslationMetadata
|
29
|
+
from typing import Optional, Set
|
30
|
+
from typing_extensions import Self
|
31
|
+
|
32
|
+
class ToolComponent(BaseModel):
|
33
|
+
"""
|
34
|
+
A component, such as a plug-in or the driver, of the analysis tool that was run.
|
35
|
+
""" # noqa: E501
|
36
|
+
guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A unique identifier for the tool component in the form of a GUID.")
|
37
|
+
name: StrictStr = Field(description="The name of the tool component.")
|
38
|
+
organization: Optional[StrictStr] = Field(default=None, description="The organization or company that produced the tool component.")
|
39
|
+
product: Optional[StrictStr] = Field(default=None, description="A product suite to which the tool component belongs.")
|
40
|
+
product_suite: Optional[StrictStr] = Field(default=None, description="A localizable string containing the name of the suite of products to which the tool component belongs.", alias="productSuite")
|
41
|
+
short_description: Optional[MultiformatMessageString] = Field(default=None, alias="shortDescription")
|
42
|
+
full_description: Optional[MultiformatMessageString] = Field(default=None, alias="fullDescription")
|
43
|
+
full_name: Optional[StrictStr] = Field(default=None, description="The name of the tool component along with its version and any other useful identifying information, such as its locale.", alias="fullName")
|
44
|
+
version: Optional[StrictStr] = Field(default=None, description="The tool component version, in whatever format the component natively provides.")
|
45
|
+
semantic_version: Optional[StrictStr] = Field(default=None, description="The tool component version in the format specified by Semantic Versioning 2.0.", alias="semanticVersion")
|
46
|
+
dotted_quad_file_version: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).", alias="dottedQuadFileVersion")
|
47
|
+
release_date_utc: Optional[StrictStr] = Field(default=None, description="A string specifying the UTC date (and optionally, the time) of the component's release.", alias="releaseDateUtc")
|
48
|
+
download_uri: Optional[StrictStr] = Field(default=None, description="The absolute URI from which the tool component can be downloaded.", alias="downloadUri")
|
49
|
+
information_uri: Optional[StrictStr] = Field(default=None, description="The absolute URI at which information about this version of the tool component can be found.", alias="informationUri")
|
50
|
+
global_message_strings: Optional[Dict[str, MultiformatMessageString]] = Field(default=None, description="A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", alias="globalMessageStrings")
|
51
|
+
notifications: Optional[Annotated[List[ReportingDescriptor], Field(min_length=0)]] = Field(default=None, description="An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.")
|
52
|
+
rules: Optional[Annotated[List[ReportingDescriptor], Field(min_length=0)]] = Field(default=None, description="An array of reportingDescriptor objects relevant to the analysis performed by the tool component.")
|
53
|
+
taxa: Optional[Annotated[List[ReportingDescriptor], Field(min_length=0)]] = Field(default=None, description="An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.")
|
54
|
+
locations: Optional[Annotated[List[ArtifactLocation], Field(min_length=0)]] = Field(default=None, description="An array of the artifactLocation objects associated with the tool component.")
|
55
|
+
language: Optional[Annotated[str, Field(strict=True)]] = Field(default='en-US', description="The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).")
|
56
|
+
contents: Optional[List[StrictStr]] = Field(default=None, description="The kinds of data contained in this object.")
|
57
|
+
is_comprehensive: Optional[StrictBool] = Field(default=False, description="Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.", alias="isComprehensive")
|
58
|
+
localized_data_semantic_version: Optional[StrictStr] = Field(default=None, description="The semantic version of the localized strings defined in this component; maintained by components that provide translations.", alias="localizedDataSemanticVersion")
|
59
|
+
minimum_required_localized_data_semantic_version: Optional[StrictStr] = Field(default=None, description="The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.", alias="minimumRequiredLocalizedDataSemanticVersion")
|
60
|
+
associated_component: Optional[ToolComponentReference] = Field(default=None, alias="associatedComponent")
|
61
|
+
translation_metadata: Optional[TranslationMetadata] = Field(default=None, alias="translationMetadata")
|
62
|
+
supported_taxonomies: Optional[Annotated[List[ToolComponentReference], Field(min_length=0)]] = Field(default=None, description="An array of toolComponentReference objects to declare the taxonomies supported by the tool component.", alias="supportedTaxonomies")
|
63
|
+
properties: Optional[PropertyBag] = None
|
64
|
+
__properties: ClassVar[List[str]] = ["guid", "name", "organization", "product", "productSuite", "shortDescription", "fullDescription", "fullName", "version", "semanticVersion", "dottedQuadFileVersion", "releaseDateUtc", "downloadUri", "informationUri", "globalMessageStrings", "notifications", "rules", "taxa", "locations", "language", "contents", "isComprehensive", "localizedDataSemanticVersion", "minimumRequiredLocalizedDataSemanticVersion", "associatedComponent", "translationMetadata", "supportedTaxonomies", "properties"]
|
65
|
+
|
66
|
+
@field_validator('guid')
|
67
|
+
def guid_validate_regular_expression(cls, value):
|
68
|
+
"""Validates the regular expression"""
|
69
|
+
if value is None:
|
70
|
+
return value
|
71
|
+
|
72
|
+
if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
|
73
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
|
74
|
+
return value
|
75
|
+
|
76
|
+
@field_validator('dotted_quad_file_version')
|
77
|
+
def dotted_quad_file_version_validate_regular_expression(cls, value):
|
78
|
+
"""Validates the regular expression"""
|
79
|
+
if value is None:
|
80
|
+
return value
|
81
|
+
|
82
|
+
if not re.match(r"[0-9]+(\.[0-9]+){3}", value):
|
83
|
+
raise ValueError(r"must validate the regular expression /[0-9]+(\.[0-9]+){3}/")
|
84
|
+
return value
|
85
|
+
|
86
|
+
@field_validator('language')
|
87
|
+
def language_validate_regular_expression(cls, value):
|
88
|
+
"""Validates the regular expression"""
|
89
|
+
if value is None:
|
90
|
+
return value
|
91
|
+
|
92
|
+
if not re.match(r"^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}?$", value):
|
93
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}?$/")
|
94
|
+
return value
|
95
|
+
|
96
|
+
@field_validator('contents')
|
97
|
+
def contents_validate_enum(cls, value):
|
98
|
+
"""Validates the enum"""
|
99
|
+
if value is None:
|
100
|
+
return value
|
101
|
+
|
102
|
+
for i in value:
|
103
|
+
if i not in set(['localizedData', 'nonLocalizedData']):
|
104
|
+
raise ValueError("each list item must be one of ('localizedData', 'nonLocalizedData')")
|
105
|
+
return value
|
106
|
+
|
107
|
+
model_config = ConfigDict(
|
108
|
+
populate_by_name=True,
|
109
|
+
validate_assignment=True,
|
110
|
+
protected_namespaces=(),
|
111
|
+
)
|
112
|
+
|
113
|
+
|
114
|
+
def to_str(self) -> str:
|
115
|
+
"""Returns the string representation of the model using alias"""
|
116
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
117
|
+
|
118
|
+
def to_json(self) -> str:
|
119
|
+
"""Returns the JSON representation of the model using alias"""
|
120
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
121
|
+
return json.dumps(self.to_dict())
|
122
|
+
|
123
|
+
@classmethod
|
124
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
125
|
+
"""Create an instance of ToolComponent from a JSON string"""
|
126
|
+
return cls.from_dict(json.loads(json_str))
|
127
|
+
|
128
|
+
def to_dict(self) -> Dict[str, Any]:
|
129
|
+
"""Return the dictionary representation of the model using alias.
|
130
|
+
|
131
|
+
This has the following differences from calling pydantic's
|
132
|
+
`self.model_dump(by_alias=True)`:
|
133
|
+
|
134
|
+
* `None` is only added to the output dict for nullable fields that
|
135
|
+
were set at model initialization. Other fields with value `None`
|
136
|
+
are ignored.
|
137
|
+
"""
|
138
|
+
excluded_fields: Set[str] = set([
|
139
|
+
])
|
140
|
+
|
141
|
+
_dict = self.model_dump(
|
142
|
+
by_alias=True,
|
143
|
+
exclude=excluded_fields,
|
144
|
+
exclude_none=True,
|
145
|
+
)
|
146
|
+
# override the default output from pydantic by calling `to_dict()` of short_description
|
147
|
+
if self.short_description:
|
148
|
+
_dict['shortDescription'] = self.short_description.to_dict()
|
149
|
+
# override the default output from pydantic by calling `to_dict()` of full_description
|
150
|
+
if self.full_description:
|
151
|
+
_dict['fullDescription'] = self.full_description.to_dict()
|
152
|
+
# override the default output from pydantic by calling `to_dict()` of each value in global_message_strings (dict)
|
153
|
+
_field_dict = {}
|
154
|
+
if self.global_message_strings:
|
155
|
+
for _key in self.global_message_strings:
|
156
|
+
if self.global_message_strings[_key]:
|
157
|
+
_field_dict[_key] = self.global_message_strings[_key].to_dict()
|
158
|
+
_dict['globalMessageStrings'] = _field_dict
|
159
|
+
# override the default output from pydantic by calling `to_dict()` of each item in notifications (list)
|
160
|
+
_items = []
|
161
|
+
if self.notifications:
|
162
|
+
for _item in self.notifications:
|
163
|
+
if _item:
|
164
|
+
_items.append(_item.to_dict())
|
165
|
+
_dict['notifications'] = _items
|
166
|
+
# override the default output from pydantic by calling `to_dict()` of each item in rules (list)
|
167
|
+
_items = []
|
168
|
+
if self.rules:
|
169
|
+
for _item in self.rules:
|
170
|
+
if _item:
|
171
|
+
_items.append(_item.to_dict())
|
172
|
+
_dict['rules'] = _items
|
173
|
+
# override the default output from pydantic by calling `to_dict()` of each item in taxa (list)
|
174
|
+
_items = []
|
175
|
+
if self.taxa:
|
176
|
+
for _item in self.taxa:
|
177
|
+
if _item:
|
178
|
+
_items.append(_item.to_dict())
|
179
|
+
_dict['taxa'] = _items
|
180
|
+
# override the default output from pydantic by calling `to_dict()` of each item in locations (list)
|
181
|
+
_items = []
|
182
|
+
if self.locations:
|
183
|
+
for _item in self.locations:
|
184
|
+
if _item:
|
185
|
+
_items.append(_item.to_dict())
|
186
|
+
_dict['locations'] = _items
|
187
|
+
# override the default output from pydantic by calling `to_dict()` of associated_component
|
188
|
+
if self.associated_component:
|
189
|
+
_dict['associatedComponent'] = self.associated_component.to_dict()
|
190
|
+
# override the default output from pydantic by calling `to_dict()` of translation_metadata
|
191
|
+
if self.translation_metadata:
|
192
|
+
_dict['translationMetadata'] = self.translation_metadata.to_dict()
|
193
|
+
# override the default output from pydantic by calling `to_dict()` of each item in supported_taxonomies (list)
|
194
|
+
_items = []
|
195
|
+
if self.supported_taxonomies:
|
196
|
+
for _item in self.supported_taxonomies:
|
197
|
+
if _item:
|
198
|
+
_items.append(_item.to_dict())
|
199
|
+
_dict['supportedTaxonomies'] = _items
|
200
|
+
# override the default output from pydantic by calling `to_dict()` of properties
|
201
|
+
if self.properties:
|
202
|
+
_dict['properties'] = self.properties.to_dict()
|
203
|
+
return _dict
|
204
|
+
|
205
|
+
@classmethod
|
206
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
207
|
+
"""Create an instance of ToolComponent from a dict"""
|
208
|
+
if obj is None:
|
209
|
+
return None
|
210
|
+
|
211
|
+
if not isinstance(obj, dict):
|
212
|
+
return cls.model_validate(obj)
|
213
|
+
|
214
|
+
_obj = cls.model_validate({
|
215
|
+
"guid": obj.get("guid"),
|
216
|
+
"name": obj.get("name"),
|
217
|
+
"organization": obj.get("organization"),
|
218
|
+
"product": obj.get("product"),
|
219
|
+
"productSuite": obj.get("productSuite"),
|
220
|
+
"shortDescription": MultiformatMessageString.from_dict(obj["shortDescription"]) if obj.get("shortDescription") is not None else None,
|
221
|
+
"fullDescription": MultiformatMessageString.from_dict(obj["fullDescription"]) if obj.get("fullDescription") is not None else None,
|
222
|
+
"fullName": obj.get("fullName"),
|
223
|
+
"version": obj.get("version"),
|
224
|
+
"semanticVersion": obj.get("semanticVersion"),
|
225
|
+
"dottedQuadFileVersion": obj.get("dottedQuadFileVersion"),
|
226
|
+
"releaseDateUtc": obj.get("releaseDateUtc"),
|
227
|
+
"downloadUri": obj.get("downloadUri"),
|
228
|
+
"informationUri": obj.get("informationUri"),
|
229
|
+
"globalMessageStrings": dict(
|
230
|
+
(_k, MultiformatMessageString.from_dict(_v))
|
231
|
+
for _k, _v in obj["globalMessageStrings"].items()
|
232
|
+
)
|
233
|
+
if obj.get("globalMessageStrings") is not None
|
234
|
+
else None,
|
235
|
+
"notifications": [ReportingDescriptor.from_dict(_item) for _item in obj["notifications"]] if obj.get("notifications") is not None else None,
|
236
|
+
"rules": [ReportingDescriptor.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None,
|
237
|
+
"taxa": [ReportingDescriptor.from_dict(_item) for _item in obj["taxa"]] if obj.get("taxa") is not None else None,
|
238
|
+
"locations": [ArtifactLocation.from_dict(_item) for _item in obj["locations"]] if obj.get("locations") is not None else None,
|
239
|
+
"language": obj.get("language") if obj.get("language") is not None else 'en-US',
|
240
|
+
"contents": obj.get("contents"),
|
241
|
+
"isComprehensive": obj.get("isComprehensive") if obj.get("isComprehensive") is not None else False,
|
242
|
+
"localizedDataSemanticVersion": obj.get("localizedDataSemanticVersion"),
|
243
|
+
"minimumRequiredLocalizedDataSemanticVersion": obj.get("minimumRequiredLocalizedDataSemanticVersion"),
|
244
|
+
"associatedComponent": ToolComponentReference.from_dict(obj["associatedComponent"]) if obj.get("associatedComponent") is not None else None,
|
245
|
+
"translationMetadata": TranslationMetadata.from_dict(obj["translationMetadata"]) if obj.get("translationMetadata") is not None else None,
|
246
|
+
"supportedTaxonomies": [ToolComponentReference.from_dict(_item) for _item in obj["supportedTaxonomies"]] if obj.get("supportedTaxonomies") is not None else None,
|
247
|
+
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
248
|
+
})
|
249
|
+
return _obj
|
250
|
+
|
251
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
HiddenLayer ModelScan V2
|
5
|
+
|
6
|
+
HiddenLayer ModelScan API for scanning of models
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing_extensions import Annotated
|
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 ToolComponentReference(BaseModel):
|
28
|
+
"""
|
29
|
+
Identifies a particular toolComponent object, either the driver or an extension.
|
30
|
+
""" # noqa: E501
|
31
|
+
name: Optional[StrictStr] = Field(default=None, description="The 'name' property of the referenced toolComponent.")
|
32
|
+
index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = Field(default=-1, description="An index into the referenced toolComponent in tool.extensions.")
|
33
|
+
guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The 'guid' property of the referenced toolComponent.")
|
34
|
+
properties: Optional[PropertyBag] = None
|
35
|
+
__properties: ClassVar[List[str]] = ["name", "index", "guid", "properties"]
|
36
|
+
|
37
|
+
@field_validator('guid')
|
38
|
+
def guid_validate_regular_expression(cls, value):
|
39
|
+
"""Validates the regular expression"""
|
40
|
+
if value is None:
|
41
|
+
return value
|
42
|
+
|
43
|
+
if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
|
44
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
|
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 ToolComponentReference 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 properties
|
87
|
+
if self.properties:
|
88
|
+
_dict['properties'] = self.properties.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 ToolComponentReference 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
|
+
"name": obj.get("name"),
|
102
|
+
"index": obj.get("index") if obj.get("index") is not None else -1,
|
103
|
+
"guid": obj.get("guid"),
|
104
|
+
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
105
|
+
})
|
106
|
+
return _obj
|
107
|
+
|
108
|
+
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
HiddenLayer ModelScan V2
|
5
|
+
|
6
|
+
HiddenLayer ModelScan API for scanning of models
|
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.multiformat_message_string import MultiformatMessageString
|
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 TranslationMetadata(BaseModel):
|
28
|
+
"""
|
29
|
+
Provides additional metadata related to translation.
|
30
|
+
""" # noqa: E501
|
31
|
+
name: StrictStr = Field(description="The name associated with the translation metadata.")
|
32
|
+
full_name: Optional[StrictStr] = Field(default=None, description="The full name associated with the translation metadata.", alias="fullName")
|
33
|
+
short_description: Optional[MultiformatMessageString] = Field(default=None, alias="shortDescription")
|
34
|
+
full_description: Optional[MultiformatMessageString] = Field(default=None, alias="fullDescription")
|
35
|
+
download_uri: Optional[StrictStr] = Field(default=None, description="The absolute URI from which the translation metadata can be downloaded.", alias="downloadUri")
|
36
|
+
information_uri: Optional[StrictStr] = Field(default=None, description="The absolute URI from which information related to the translation metadata can be downloaded.", alias="informationUri")
|
37
|
+
properties: Optional[PropertyBag] = None
|
38
|
+
__properties: ClassVar[List[str]] = ["name", "fullName", "shortDescription", "fullDescription", "downloadUri", "informationUri", "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 TranslationMetadata 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 short_description
|
80
|
+
if self.short_description:
|
81
|
+
_dict['shortDescription'] = self.short_description.to_dict()
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of full_description
|
83
|
+
if self.full_description:
|
84
|
+
_dict['fullDescription'] = self.full_description.to_dict()
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of properties
|
86
|
+
if self.properties:
|
87
|
+
_dict['properties'] = self.properties.to_dict()
|
88
|
+
return _dict
|
89
|
+
|
90
|
+
@classmethod
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
92
|
+
"""Create an instance of TranslationMetadata 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
|
+
"name": obj.get("name"),
|
101
|
+
"fullName": obj.get("fullName"),
|
102
|
+
"shortDescription": MultiformatMessageString.from_dict(obj["shortDescription"]) if obj.get("shortDescription") is not None else None,
|
103
|
+
"fullDescription": MultiformatMessageString.from_dict(obj["fullDescription"]) if obj.get("fullDescription") is not None else None,
|
104
|
+
"downloadUri": obj.get("downloadUri"),
|
105
|
+
"informationUri": obj.get("informationUri"),
|
106
|
+
"properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
107
|
+
})
|
108
|
+
return _obj
|
109
|
+
|
110
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
HiddenLayer ModelScan
|
4
|
+
HiddenLayer ModelScan V2
|
5
5
|
|
6
6
|
HiddenLayer ModelScan API for scanning of models
|
7
7
|
|
@@ -19,7 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
22
|
-
from hiddenlayer.sdk.rest.models.
|
22
|
+
from hiddenlayer.sdk.rest.models.location_inner import LocationInner
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
@@ -27,7 +27,7 @@ class ValidationErrorModel(BaseModel):
|
|
27
27
|
"""
|
28
28
|
ValidationErrorModel
|
29
29
|
""" # noqa: E501
|
30
|
-
loc: List[
|
30
|
+
loc: List[LocationInner]
|
31
31
|
msg: StrictStr
|
32
32
|
type: StrictStr
|
33
33
|
__properties: ClassVar[List[str]] = ["loc", "msg", "type"]
|
@@ -90,7 +90,7 @@ class ValidationErrorModel(BaseModel):
|
|
90
90
|
return cls.model_validate(obj)
|
91
91
|
|
92
92
|
_obj = cls.model_validate({
|
93
|
-
"loc": [
|
93
|
+
"loc": [LocationInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None,
|
94
94
|
"msg": obj.get("msg"),
|
95
95
|
"type": obj.get("type")
|
96
96
|
})
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
HiddenLayer ModelScan V2
|
5
|
+
|
6
|
+
HiddenLayer ModelScan API for scanning of models
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from hiddenlayer.sdk.rest.models.artifact_location import ArtifactLocation
|
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 VersionControlDetails(BaseModel):
|
29
|
+
"""
|
30
|
+
Specifies the information necessary to retrieve a desired revision from a version control system.
|
31
|
+
""" # noqa: E501
|
32
|
+
repository_uri: StrictStr = Field(description="The absolute URI of the repository.", alias="repositoryUri")
|
33
|
+
revision_id: Optional[StrictStr] = Field(default=None, description="A string that uniquely and permanently identifies the revision within the repository.", alias="revisionId")
|
34
|
+
branch: Optional[StrictStr] = Field(default=None, description="The name of a branch containing the revision.")
|
35
|
+
revision_tag: Optional[StrictStr] = Field(default=None, description="A tag that has been applied to the revision.", alias="revisionTag")
|
36
|
+
as_of_time_utc: Optional[datetime] = Field(default=None, description="A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.", alias="asOfTimeUtc")
|
37
|
+
mapped_to: Optional[ArtifactLocation] = Field(default=None, alias="mappedTo")
|
38
|
+
properties: Optional[PropertyBag] = None
|
39
|
+
__properties: ClassVar[List[str]] = ["repositoryUri", "revisionId", "branch", "revisionTag", "asOfTimeUtc", "mappedTo", "properties"]
|
40
|
+
|
41
|
+
model_config = ConfigDict(
|
42
|
+
populate_by_name=True,
|
43
|
+
validate_assignment=True,
|
44
|
+
protected_namespaces=(),
|
45
|
+
)
|
46
|
+
|
47
|
+
|
48
|
+
def to_str(self) -> str:
|
49
|
+
"""Returns the string representation of the model using alias"""
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
51
|
+
|
52
|
+
def to_json(self) -> str:
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
55
|
+
return json.dumps(self.to_dict())
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
59
|
+
"""Create an instance of VersionControlDetails from a JSON string"""
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
61
|
+
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
64
|
+
|
65
|
+
This has the following differences from calling pydantic's
|
66
|
+
`self.model_dump(by_alias=True)`:
|
67
|
+
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
69
|
+
were set at model initialization. Other fields with value `None`
|
70
|
+
are ignored.
|
71
|
+
"""
|
72
|
+
excluded_fields: Set[str] = set([
|
73
|
+
])
|
74
|
+
|
75
|
+
_dict = self.model_dump(
|
76
|
+
by_alias=True,
|
77
|
+
exclude=excluded_fields,
|
78
|
+
exclude_none=True,
|
79
|
+
)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of mapped_to
|
81
|
+
if self.mapped_to:
|
82
|
+
_dict['mappedTo'] = self.mapped_to.to_dict()
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of properties
|
84
|
+
if self.properties:
|
85
|
+
_dict['properties'] = self.properties.to_dict()
|
86
|
+
return _dict
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
90
|
+
"""Create an instance of VersionControlDetails from a dict"""
|
91
|
+
if obj is None:
|
92
|
+
return None
|
93
|
+
|
94
|
+
if not isinstance(obj, dict):
|
95
|
+
return cls.model_validate(obj)
|
96
|
+
|
97
|
+
_obj = cls.model_validate({
|
98
|
+
"repositoryUri": obj.get("repositoryUri"),
|
99
|
+
"revisionId": obj.get("revisionId"),
|
100
|
+
"branch": obj.get("branch"),
|
101
|
+
"revisionTag": obj.get("revisionTag"),
|
102
|
+
"asOfTimeUtc": obj.get("asOfTimeUtc"),
|
103
|
+
"mappedTo": ArtifactLocation.from_dict(obj["mappedTo"]) if obj.get("mappedTo") 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
|
+
|