hiddenlayer-sdk 2.0.9__py3-none-any.whl → 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. hiddenlayer/__init__.py +109 -105
  2. hiddenlayer/_base_client.py +1995 -0
  3. hiddenlayer/_client.py +761 -0
  4. hiddenlayer/_compat.py +219 -0
  5. hiddenlayer/_constants.py +14 -0
  6. hiddenlayer/_exceptions.py +108 -0
  7. hiddenlayer/_files.py +123 -0
  8. hiddenlayer/_models.py +835 -0
  9. hiddenlayer/_oauth2.py +118 -0
  10. hiddenlayer/_qs.py +150 -0
  11. hiddenlayer/_resource.py +43 -0
  12. hiddenlayer/_response.py +832 -0
  13. hiddenlayer/_streaming.py +333 -0
  14. hiddenlayer/_types.py +260 -0
  15. hiddenlayer/_utils/__init__.py +64 -0
  16. hiddenlayer/_utils/_compat.py +45 -0
  17. hiddenlayer/_utils/_datetime_parse.py +136 -0
  18. hiddenlayer/_utils/_logs.py +25 -0
  19. hiddenlayer/_utils/_proxy.py +65 -0
  20. hiddenlayer/_utils/_reflection.py +42 -0
  21. hiddenlayer/_utils/_resources_proxy.py +24 -0
  22. hiddenlayer/_utils/_streams.py +12 -0
  23. hiddenlayer/_utils/_sync.py +86 -0
  24. hiddenlayer/_utils/_transform.py +457 -0
  25. hiddenlayer/_utils/_typing.py +156 -0
  26. hiddenlayer/_utils/_utils.py +421 -0
  27. hiddenlayer/_version.py +4 -0
  28. hiddenlayer/lib/.keep +4 -0
  29. hiddenlayer/lib/__init__.py +6 -0
  30. hiddenlayer/lib/community_scan.py +174 -0
  31. hiddenlayer/lib/model_scan.py +752 -0
  32. hiddenlayer/lib/scan_utils.py +142 -0
  33. hiddenlayer/pagination.py +127 -0
  34. hiddenlayer/resources/__init__.py +75 -0
  35. hiddenlayer/resources/interactions.py +205 -0
  36. hiddenlayer/resources/models/__init__.py +33 -0
  37. hiddenlayer/resources/models/cards.py +259 -0
  38. hiddenlayer/resources/models/models.py +284 -0
  39. hiddenlayer/resources/prompt_analyzer.py +207 -0
  40. hiddenlayer/resources/scans/__init__.py +61 -0
  41. hiddenlayer/resources/scans/jobs.py +499 -0
  42. hiddenlayer/resources/scans/results.py +169 -0
  43. hiddenlayer/resources/scans/scans.py +166 -0
  44. hiddenlayer/resources/scans/upload/__init__.py +33 -0
  45. hiddenlayer/resources/scans/upload/file.py +279 -0
  46. hiddenlayer/resources/scans/upload/upload.py +340 -0
  47. hiddenlayer/resources/sensors.py +575 -0
  48. hiddenlayer/types/__init__.py +16 -0
  49. hiddenlayer/types/interaction_analyze_params.py +62 -0
  50. hiddenlayer/types/interaction_analyze_response.py +199 -0
  51. hiddenlayer/types/model_retrieve_response.py +50 -0
  52. hiddenlayer/types/models/__init__.py +6 -0
  53. hiddenlayer/types/models/card_list_params.py +65 -0
  54. hiddenlayer/types/models/card_list_response.py +50 -0
  55. hiddenlayer/types/prompt_analyzer_create_params.py +23 -0
  56. hiddenlayer/types/prompt_analyzer_create_response.py +381 -0
  57. hiddenlayer/types/scans/__init__.py +14 -0
  58. hiddenlayer/types/scans/job_list_params.py +75 -0
  59. hiddenlayer/types/scans/job_list_response.py +22 -0
  60. hiddenlayer/types/scans/job_request_params.py +49 -0
  61. hiddenlayer/types/scans/job_retrieve_params.py +16 -0
  62. hiddenlayer/types/scans/result_sarif_response.py +7 -0
  63. hiddenlayer/types/scans/scan_job.py +46 -0
  64. hiddenlayer/types/scans/scan_report.py +367 -0
  65. hiddenlayer/types/scans/upload/__init__.py +6 -0
  66. hiddenlayer/types/scans/upload/file_add_response.py +24 -0
  67. hiddenlayer/types/scans/upload/file_complete_response.py +12 -0
  68. hiddenlayer/types/scans/upload_complete_all_response.py +12 -0
  69. hiddenlayer/types/scans/upload_start_params.py +34 -0
  70. hiddenlayer/types/scans/upload_start_response.py +12 -0
  71. hiddenlayer/types/sensor_create_params.py +24 -0
  72. hiddenlayer/types/sensor_create_response.py +33 -0
  73. hiddenlayer/types/sensor_query_params.py +39 -0
  74. hiddenlayer/types/sensor_query_response.py +43 -0
  75. hiddenlayer/types/sensor_retrieve_response.py +33 -0
  76. hiddenlayer/types/sensor_update_params.py +20 -0
  77. hiddenlayer/types/sensor_update_response.py +9 -0
  78. hiddenlayer_sdk-3.0.0.dist-info/METADATA +431 -0
  79. hiddenlayer_sdk-3.0.0.dist-info/RECORD +82 -0
  80. {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/WHEEL +1 -2
  81. {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/licenses/LICENSE +1 -1
  82. hiddenlayer/sdk/constants.py +0 -26
  83. hiddenlayer/sdk/exceptions.py +0 -12
  84. hiddenlayer/sdk/models.py +0 -58
  85. hiddenlayer/sdk/rest/__init__.py +0 -135
  86. hiddenlayer/sdk/rest/api/__init__.py +0 -10
  87. hiddenlayer/sdk/rest/api/aidr_predictive_api.py +0 -308
  88. hiddenlayer/sdk/rest/api/health_api.py +0 -272
  89. hiddenlayer/sdk/rest/api/model_api.py +0 -559
  90. hiddenlayer/sdk/rest/api/model_supply_chain_api.py +0 -4063
  91. hiddenlayer/sdk/rest/api/readiness_api.py +0 -272
  92. hiddenlayer/sdk/rest/api/sensor_api.py +0 -1432
  93. hiddenlayer/sdk/rest/api_client.py +0 -770
  94. hiddenlayer/sdk/rest/api_response.py +0 -21
  95. hiddenlayer/sdk/rest/configuration.py +0 -445
  96. hiddenlayer/sdk/rest/exceptions.py +0 -199
  97. hiddenlayer/sdk/rest/models/__init__.py +0 -113
  98. hiddenlayer/sdk/rest/models/address.py +0 -110
  99. hiddenlayer/sdk/rest/models/artifact.py +0 -155
  100. hiddenlayer/sdk/rest/models/artifact_change.py +0 -108
  101. hiddenlayer/sdk/rest/models/artifact_content.py +0 -101
  102. hiddenlayer/sdk/rest/models/artifact_location.py +0 -109
  103. hiddenlayer/sdk/rest/models/attachment.py +0 -129
  104. hiddenlayer/sdk/rest/models/begin_multi_file_upload200_response.py +0 -87
  105. hiddenlayer/sdk/rest/models/begin_multipart_file_upload200_response.py +0 -97
  106. hiddenlayer/sdk/rest/models/begin_multipart_file_upload200_response_parts_inner.py +0 -94
  107. hiddenlayer/sdk/rest/models/code_flow.py +0 -113
  108. hiddenlayer/sdk/rest/models/configuration_override.py +0 -108
  109. hiddenlayer/sdk/rest/models/conversion.py +0 -114
  110. hiddenlayer/sdk/rest/models/create_sensor_request.py +0 -95
  111. hiddenlayer/sdk/rest/models/edge.py +0 -108
  112. hiddenlayer/sdk/rest/models/edge_traversal.py +0 -122
  113. hiddenlayer/sdk/rest/models/errors_inner.py +0 -91
  114. hiddenlayer/sdk/rest/models/exception.py +0 -113
  115. hiddenlayer/sdk/rest/models/external_properties.py +0 -273
  116. hiddenlayer/sdk/rest/models/external_property_file_reference.py +0 -102
  117. hiddenlayer/sdk/rest/models/external_property_file_references.py +0 -240
  118. hiddenlayer/sdk/rest/models/file_details_v3.py +0 -139
  119. hiddenlayer/sdk/rest/models/file_result_v3.py +0 -117
  120. hiddenlayer/sdk/rest/models/file_scan_report_v3.py +0 -132
  121. hiddenlayer/sdk/rest/models/file_scan_reports_v3.py +0 -95
  122. hiddenlayer/sdk/rest/models/fix.py +0 -113
  123. hiddenlayer/sdk/rest/models/get_condensed_model_scan_reports200_response.py +0 -102
  124. hiddenlayer/sdk/rest/models/graph.py +0 -123
  125. hiddenlayer/sdk/rest/models/graph_traversal.py +0 -97
  126. hiddenlayer/sdk/rest/models/inventory_v3.py +0 -101
  127. hiddenlayer/sdk/rest/models/invocation.py +0 -199
  128. hiddenlayer/sdk/rest/models/location.py +0 -146
  129. hiddenlayer/sdk/rest/models/location_inner.py +0 -138
  130. hiddenlayer/sdk/rest/models/location_relationship.py +0 -107
  131. hiddenlayer/sdk/rest/models/logical_location.py +0 -104
  132. hiddenlayer/sdk/rest/models/message.py +0 -92
  133. hiddenlayer/sdk/rest/models/mitre_atlas_inner.py +0 -110
  134. hiddenlayer/sdk/rest/models/model.py +0 -103
  135. hiddenlayer/sdk/rest/models/model_inventory_info.py +0 -103
  136. hiddenlayer/sdk/rest/models/model_version.py +0 -97
  137. hiddenlayer/sdk/rest/models/multi_file_upload_request_v3.py +0 -97
  138. hiddenlayer/sdk/rest/models/multiformat_message_string.py +0 -95
  139. hiddenlayer/sdk/rest/models/node.py +0 -122
  140. hiddenlayer/sdk/rest/models/notification.py +0 -157
  141. hiddenlayer/sdk/rest/models/notify_model_scan_completed200_response.py +0 -87
  142. hiddenlayer/sdk/rest/models/paged_response_with_total.py +0 -94
  143. hiddenlayer/sdk/rest/models/pagination_v3.py +0 -95
  144. hiddenlayer/sdk/rest/models/physical_location.py +0 -94
  145. hiddenlayer/sdk/rest/models/problem_details.py +0 -103
  146. hiddenlayer/sdk/rest/models/property_bag.py +0 -101
  147. hiddenlayer/sdk/rest/models/rectangle.py +0 -110
  148. hiddenlayer/sdk/rest/models/region.py +0 -127
  149. hiddenlayer/sdk/rest/models/replacement.py +0 -103
  150. hiddenlayer/sdk/rest/models/reporting_configuration.py +0 -113
  151. hiddenlayer/sdk/rest/models/reporting_descriptor.py +0 -162
  152. hiddenlayer/sdk/rest/models/reporting_descriptor_reference.py +0 -103
  153. hiddenlayer/sdk/rest/models/reporting_descriptor_relationship.py +0 -115
  154. hiddenlayer/sdk/rest/models/result.py +0 -312
  155. hiddenlayer/sdk/rest/models/result_provenance.py +0 -133
  156. hiddenlayer/sdk/rest/models/rule_details_inner.py +0 -102
  157. hiddenlayer/sdk/rest/models/run.py +0 -318
  158. hiddenlayer/sdk/rest/models/run_automation_details.py +0 -129
  159. hiddenlayer/sdk/rest/models/sarif210.py +0 -123
  160. hiddenlayer/sdk/rest/models/scan_create_request.py +0 -87
  161. hiddenlayer/sdk/rest/models/scan_detection_v3.py +0 -159
  162. hiddenlayer/sdk/rest/models/scan_detection_v31.py +0 -158
  163. hiddenlayer/sdk/rest/models/scan_header_v3.py +0 -129
  164. hiddenlayer/sdk/rest/models/scan_job.py +0 -115
  165. hiddenlayer/sdk/rest/models/scan_job_access.py +0 -97
  166. hiddenlayer/sdk/rest/models/scan_model_details_v3.py +0 -99
  167. hiddenlayer/sdk/rest/models/scan_model_details_v31.py +0 -97
  168. hiddenlayer/sdk/rest/models/scan_model_ids_v3.py +0 -89
  169. hiddenlayer/sdk/rest/models/scan_report_v3.py +0 -139
  170. hiddenlayer/sdk/rest/models/scan_results_map_v3.py +0 -105
  171. hiddenlayer/sdk/rest/models/scan_results_v3.py +0 -120
  172. hiddenlayer/sdk/rest/models/security_posture.py +0 -89
  173. hiddenlayer/sdk/rest/models/sensor.py +0 -100
  174. hiddenlayer/sdk/rest/models/sensor_query_response.py +0 -101
  175. hiddenlayer/sdk/rest/models/sensor_sor_model_card_query_response.py +0 -101
  176. hiddenlayer/sdk/rest/models/sensor_sor_model_card_response.py +0 -127
  177. hiddenlayer/sdk/rest/models/sensor_sor_query_filter.py +0 -108
  178. hiddenlayer/sdk/rest/models/sensor_sor_query_request.py +0 -109
  179. hiddenlayer/sdk/rest/models/special_locations.py +0 -97
  180. hiddenlayer/sdk/rest/models/stack.py +0 -113
  181. hiddenlayer/sdk/rest/models/stack_frame.py +0 -104
  182. hiddenlayer/sdk/rest/models/submission_response.py +0 -95
  183. hiddenlayer/sdk/rest/models/submission_v2.py +0 -109
  184. hiddenlayer/sdk/rest/models/suppression.py +0 -133
  185. hiddenlayer/sdk/rest/models/thread_flow.py +0 -144
  186. hiddenlayer/sdk/rest/models/thread_flow_location.py +0 -166
  187. hiddenlayer/sdk/rest/models/tool.py +0 -107
  188. hiddenlayer/sdk/rest/models/tool_component.py +0 -251
  189. hiddenlayer/sdk/rest/models/tool_component_reference.py +0 -108
  190. hiddenlayer/sdk/rest/models/translation_metadata.py +0 -110
  191. hiddenlayer/sdk/rest/models/validation_error_model.py +0 -99
  192. hiddenlayer/sdk/rest/models/version_control_details.py +0 -108
  193. hiddenlayer/sdk/rest/models/web_request.py +0 -112
  194. hiddenlayer/sdk/rest/models/web_response.py +0 -112
  195. hiddenlayer/sdk/rest/rest.py +0 -257
  196. hiddenlayer/sdk/services/__init__.py +0 -0
  197. hiddenlayer/sdk/services/aidr_predictive.py +0 -130
  198. hiddenlayer/sdk/services/model_scan.py +0 -505
  199. hiddenlayer/sdk/utils.py +0 -92
  200. hiddenlayer/sdk/version.py +0 -1
  201. hiddenlayer_sdk-2.0.9.dist-info/METADATA +0 -368
  202. hiddenlayer_sdk-2.0.9.dist-info/RECORD +0 -126
  203. hiddenlayer_sdk-2.0.9.dist-info/top_level.txt +0 -1
  204. /hiddenlayer/{sdk/__init__.py → py.typed} +0 -0
@@ -1,318 +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, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing_extensions import Annotated
23
- from hiddenlayer.sdk.rest.models.address import Address
24
- from hiddenlayer.sdk.rest.models.artifact import Artifact
25
- from hiddenlayer.sdk.rest.models.artifact_location import ArtifactLocation
26
- from hiddenlayer.sdk.rest.models.conversion import Conversion
27
- from hiddenlayer.sdk.rest.models.external_property_file_references import ExternalPropertyFileReferences
28
- from hiddenlayer.sdk.rest.models.graph import Graph
29
- from hiddenlayer.sdk.rest.models.invocation import Invocation
30
- from hiddenlayer.sdk.rest.models.logical_location import LogicalLocation
31
- from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
32
- from hiddenlayer.sdk.rest.models.result import Result
33
- from hiddenlayer.sdk.rest.models.run_automation_details import RunAutomationDetails
34
- from hiddenlayer.sdk.rest.models.special_locations import SpecialLocations
35
- from hiddenlayer.sdk.rest.models.thread_flow_location import ThreadFlowLocation
36
- from hiddenlayer.sdk.rest.models.tool import Tool
37
- from hiddenlayer.sdk.rest.models.tool_component import ToolComponent
38
- from hiddenlayer.sdk.rest.models.version_control_details import VersionControlDetails
39
- from hiddenlayer.sdk.rest.models.web_request import WebRequest
40
- from hiddenlayer.sdk.rest.models.web_response import WebResponse
41
- from typing import Optional, Set
42
- from typing_extensions import Self
43
-
44
- class Run(BaseModel):
45
- """
46
- Describes a single run of an analysis tool, and contains the reported output of that run.
47
- """ # noqa: E501
48
- tool: Tool
49
- invocations: Optional[Annotated[List[Invocation], Field(min_length=0)]] = Field(default=None, description="Describes the invocation of the analysis tool.")
50
- conversion: Optional[Conversion] = None
51
- 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 culture 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).")
52
- version_control_provenance: Optional[Annotated[List[VersionControlDetails], Field(min_length=0)]] = Field(default=None, description="Specifies the revision in version control of the artifacts that were scanned.", alias="versionControlProvenance")
53
- original_uri_base_ids: Optional[Dict[str, ArtifactLocation]] = Field(default=None, description="The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.", alias="originalUriBaseIds")
54
- artifacts: Optional[Annotated[List[Artifact], Field(min_length=0)]] = Field(default=None, description="An array of artifact objects relevant to the run.")
55
- logical_locations: Optional[Annotated[List[LogicalLocation], Field(min_length=0)]] = Field(default=None, description="An array of logical locations such as namespaces, types or functions.", alias="logicalLocations")
56
- graphs: Optional[Annotated[List[Graph], Field(min_length=0)]] = Field(default=None, description="An array of zero or more unique graph objects associated with the run.")
57
- results: Optional[Annotated[List[Result], Field(min_length=0)]] = Field(default=None, description="The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.")
58
- automation_details: Optional[RunAutomationDetails] = Field(default=None, alias="automationDetails")
59
- run_aggregates: Optional[Annotated[List[RunAutomationDetails], Field(min_length=0)]] = Field(default=None, description="Automation details that describe the aggregate of runs to which this run belongs.", alias="runAggregates")
60
- baseline_guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.", alias="baselineGuid")
61
- redaction_tokens: Optional[Annotated[List[StrictStr], Field(min_length=0)]] = Field(default=None, description="An array of strings used to replace sensitive information in a redaction-aware property.", alias="redactionTokens")
62
- default_encoding: Optional[StrictStr] = Field(default=None, description="Specifies the default encoding for any artifact object that refers to a text file.", alias="defaultEncoding")
63
- default_source_language: Optional[StrictStr] = Field(default=None, description="Specifies the default source language for any artifact object that refers to a text file that contains source code.", alias="defaultSourceLanguage")
64
- newline_sequences: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="An ordered list of character sequences that were treated as line breaks when computing region information for the run.", alias="newlineSequences")
65
- column_kind: Optional[StrictStr] = Field(default=None, description="Specifies the unit in which the tool measures columns.", alias="columnKind")
66
- external_property_file_references: Optional[ExternalPropertyFileReferences] = Field(default=None, alias="externalPropertyFileReferences")
67
- thread_flow_locations: Optional[Annotated[List[ThreadFlowLocation], Field(min_length=0)]] = Field(default=None, description="An array of threadFlowLocation objects cached at run level.", alias="threadFlowLocations")
68
- taxonomies: Optional[Annotated[List[ToolComponent], Field(min_length=0)]] = Field(default=None, description="An array of toolComponent objects relevant to a taxonomy in which results are categorized.")
69
- addresses: Optional[Annotated[List[Address], Field(min_length=0)]] = Field(default=None, description="Addresses associated with this run instance, if any.")
70
- translations: Optional[Annotated[List[ToolComponent], Field(min_length=0)]] = Field(default=None, description="The set of available translations of the localized data provided by the tool.")
71
- policies: Optional[Annotated[List[ToolComponent], Field(min_length=0)]] = Field(default=None, description="Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).")
72
- web_requests: Optional[Annotated[List[WebRequest], Field(min_length=0)]] = Field(default=None, description="An array of request objects cached at run level.", alias="webRequests")
73
- web_responses: Optional[Annotated[List[WebResponse], Field(min_length=0)]] = Field(default=None, description="An array of response objects cached at run level.", alias="webResponses")
74
- special_locations: Optional[SpecialLocations] = Field(default=None, alias="specialLocations")
75
- properties: Optional[PropertyBag] = None
76
- __properties: ClassVar[List[str]] = ["tool", "invocations", "conversion", "language", "versionControlProvenance", "originalUriBaseIds", "artifacts", "logicalLocations", "graphs", "results", "automationDetails", "runAggregates", "baselineGuid", "redactionTokens", "defaultEncoding", "defaultSourceLanguage", "newlineSequences", "columnKind", "externalPropertyFileReferences", "threadFlowLocations", "taxonomies", "addresses", "translations", "policies", "webRequests", "webResponses", "specialLocations", "properties"]
77
-
78
- @field_validator('language')
79
- def language_validate_regular_expression(cls, value):
80
- """Validates the regular expression"""
81
- if value is None:
82
- return value
83
-
84
- if not re.match(r"^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}?$", value):
85
- raise ValueError(r"must validate the regular expression /^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}?$/")
86
- return value
87
-
88
- @field_validator('baseline_guid')
89
- def baseline_guid_validate_regular_expression(cls, value):
90
- """Validates the regular expression"""
91
- if value is None:
92
- return value
93
-
94
- 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):
95
- 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}$/")
96
- return value
97
-
98
- @field_validator('column_kind')
99
- def column_kind_validate_enum(cls, value):
100
- """Validates the enum"""
101
- if value is None:
102
- return value
103
-
104
- if value not in set(['utf16CodeUnits', 'unicodeCodePoints']):
105
- raise ValueError("must be one of enum values ('utf16CodeUnits', 'unicodeCodePoints')")
106
- return value
107
-
108
- model_config = ConfigDict(
109
- populate_by_name=True,
110
- validate_assignment=True,
111
- protected_namespaces=(),
112
- )
113
-
114
-
115
- def to_str(self) -> str:
116
- """Returns the string representation of the model using alias"""
117
- return pprint.pformat(self.model_dump(by_alias=True))
118
-
119
- def to_json(self) -> str:
120
- """Returns the JSON representation of the model using alias"""
121
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
122
- return json.dumps(self.to_dict())
123
-
124
- @classmethod
125
- def from_json(cls, json_str: str) -> Optional[Self]:
126
- """Create an instance of Run from a JSON string"""
127
- return cls.from_dict(json.loads(json_str))
128
-
129
- def to_dict(self) -> Dict[str, Any]:
130
- """Return the dictionary representation of the model using alias.
131
-
132
- This has the following differences from calling pydantic's
133
- `self.model_dump(by_alias=True)`:
134
-
135
- * `None` is only added to the output dict for nullable fields that
136
- were set at model initialization. Other fields with value `None`
137
- are ignored.
138
- """
139
- excluded_fields: Set[str] = set([
140
- ])
141
-
142
- _dict = self.model_dump(
143
- by_alias=True,
144
- exclude=excluded_fields,
145
- exclude_none=True,
146
- )
147
- # override the default output from pydantic by calling `to_dict()` of tool
148
- if self.tool:
149
- _dict['tool'] = self.tool.to_dict()
150
- # override the default output from pydantic by calling `to_dict()` of each item in invocations (list)
151
- _items = []
152
- if self.invocations:
153
- for _item in self.invocations:
154
- if _item:
155
- _items.append(_item.to_dict())
156
- _dict['invocations'] = _items
157
- # override the default output from pydantic by calling `to_dict()` of conversion
158
- if self.conversion:
159
- _dict['conversion'] = self.conversion.to_dict()
160
- # override the default output from pydantic by calling `to_dict()` of each item in version_control_provenance (list)
161
- _items = []
162
- if self.version_control_provenance:
163
- for _item in self.version_control_provenance:
164
- if _item:
165
- _items.append(_item.to_dict())
166
- _dict['versionControlProvenance'] = _items
167
- # override the default output from pydantic by calling `to_dict()` of each value in original_uri_base_ids (dict)
168
- _field_dict = {}
169
- if self.original_uri_base_ids:
170
- for _key in self.original_uri_base_ids:
171
- if self.original_uri_base_ids[_key]:
172
- _field_dict[_key] = self.original_uri_base_ids[_key].to_dict()
173
- _dict['originalUriBaseIds'] = _field_dict
174
- # override the default output from pydantic by calling `to_dict()` of each item in artifacts (list)
175
- _items = []
176
- if self.artifacts:
177
- for _item in self.artifacts:
178
- if _item:
179
- _items.append(_item.to_dict())
180
- _dict['artifacts'] = _items
181
- # override the default output from pydantic by calling `to_dict()` of each item in logical_locations (list)
182
- _items = []
183
- if self.logical_locations:
184
- for _item in self.logical_locations:
185
- if _item:
186
- _items.append(_item.to_dict())
187
- _dict['logicalLocations'] = _items
188
- # override the default output from pydantic by calling `to_dict()` of each item in graphs (list)
189
- _items = []
190
- if self.graphs:
191
- for _item in self.graphs:
192
- if _item:
193
- _items.append(_item.to_dict())
194
- _dict['graphs'] = _items
195
- # override the default output from pydantic by calling `to_dict()` of each item in results (list)
196
- _items = []
197
- if self.results:
198
- for _item in self.results:
199
- if _item:
200
- _items.append(_item.to_dict())
201
- _dict['results'] = _items
202
- # override the default output from pydantic by calling `to_dict()` of automation_details
203
- if self.automation_details:
204
- _dict['automationDetails'] = self.automation_details.to_dict()
205
- # override the default output from pydantic by calling `to_dict()` of each item in run_aggregates (list)
206
- _items = []
207
- if self.run_aggregates:
208
- for _item in self.run_aggregates:
209
- if _item:
210
- _items.append(_item.to_dict())
211
- _dict['runAggregates'] = _items
212
- # override the default output from pydantic by calling `to_dict()` of external_property_file_references
213
- if self.external_property_file_references:
214
- _dict['externalPropertyFileReferences'] = self.external_property_file_references.to_dict()
215
- # override the default output from pydantic by calling `to_dict()` of each item in thread_flow_locations (list)
216
- _items = []
217
- if self.thread_flow_locations:
218
- for _item in self.thread_flow_locations:
219
- if _item:
220
- _items.append(_item.to_dict())
221
- _dict['threadFlowLocations'] = _items
222
- # override the default output from pydantic by calling `to_dict()` of each item in taxonomies (list)
223
- _items = []
224
- if self.taxonomies:
225
- for _item in self.taxonomies:
226
- if _item:
227
- _items.append(_item.to_dict())
228
- _dict['taxonomies'] = _items
229
- # override the default output from pydantic by calling `to_dict()` of each item in addresses (list)
230
- _items = []
231
- if self.addresses:
232
- for _item in self.addresses:
233
- if _item:
234
- _items.append(_item.to_dict())
235
- _dict['addresses'] = _items
236
- # override the default output from pydantic by calling `to_dict()` of each item in translations (list)
237
- _items = []
238
- if self.translations:
239
- for _item in self.translations:
240
- if _item:
241
- _items.append(_item.to_dict())
242
- _dict['translations'] = _items
243
- # override the default output from pydantic by calling `to_dict()` of each item in policies (list)
244
- _items = []
245
- if self.policies:
246
- for _item in self.policies:
247
- if _item:
248
- _items.append(_item.to_dict())
249
- _dict['policies'] = _items
250
- # override the default output from pydantic by calling `to_dict()` of each item in web_requests (list)
251
- _items = []
252
- if self.web_requests:
253
- for _item in self.web_requests:
254
- if _item:
255
- _items.append(_item.to_dict())
256
- _dict['webRequests'] = _items
257
- # override the default output from pydantic by calling `to_dict()` of each item in web_responses (list)
258
- _items = []
259
- if self.web_responses:
260
- for _item in self.web_responses:
261
- if _item:
262
- _items.append(_item.to_dict())
263
- _dict['webResponses'] = _items
264
- # override the default output from pydantic by calling `to_dict()` of special_locations
265
- if self.special_locations:
266
- _dict['specialLocations'] = self.special_locations.to_dict()
267
- # override the default output from pydantic by calling `to_dict()` of properties
268
- if self.properties:
269
- _dict['properties'] = self.properties.to_dict()
270
- return _dict
271
-
272
- @classmethod
273
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
274
- """Create an instance of Run from a dict"""
275
- if obj is None:
276
- return None
277
-
278
- if not isinstance(obj, dict):
279
- return cls.model_validate(obj)
280
-
281
- _obj = cls.model_validate({
282
- "tool": Tool.from_dict(obj["tool"]) if obj.get("tool") is not None else None,
283
- "invocations": [Invocation.from_dict(_item) for _item in obj["invocations"]] if obj.get("invocations") is not None else None,
284
- "conversion": Conversion.from_dict(obj["conversion"]) if obj.get("conversion") is not None else None,
285
- "language": obj.get("language") if obj.get("language") is not None else 'en-US',
286
- "versionControlProvenance": [VersionControlDetails.from_dict(_item) for _item in obj["versionControlProvenance"]] if obj.get("versionControlProvenance") is not None else None,
287
- "originalUriBaseIds": dict(
288
- (_k, ArtifactLocation.from_dict(_v))
289
- for _k, _v in obj["originalUriBaseIds"].items()
290
- )
291
- if obj.get("originalUriBaseIds") is not None
292
- else None,
293
- "artifacts": [Artifact.from_dict(_item) for _item in obj["artifacts"]] if obj.get("artifacts") is not None else None,
294
- "logicalLocations": [LogicalLocation.from_dict(_item) for _item in obj["logicalLocations"]] if obj.get("logicalLocations") is not None else None,
295
- "graphs": [Graph.from_dict(_item) for _item in obj["graphs"]] if obj.get("graphs") is not None else None,
296
- "results": [Result.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None,
297
- "automationDetails": RunAutomationDetails.from_dict(obj["automationDetails"]) if obj.get("automationDetails") is not None else None,
298
- "runAggregates": [RunAutomationDetails.from_dict(_item) for _item in obj["runAggregates"]] if obj.get("runAggregates") is not None else None,
299
- "baselineGuid": obj.get("baselineGuid"),
300
- "redactionTokens": obj.get("redactionTokens"),
301
- "defaultEncoding": obj.get("defaultEncoding"),
302
- "defaultSourceLanguage": obj.get("defaultSourceLanguage"),
303
- "newlineSequences": obj.get("newlineSequences"),
304
- "columnKind": obj.get("columnKind"),
305
- "externalPropertyFileReferences": ExternalPropertyFileReferences.from_dict(obj["externalPropertyFileReferences"]) if obj.get("externalPropertyFileReferences") is not None else None,
306
- "threadFlowLocations": [ThreadFlowLocation.from_dict(_item) for _item in obj["threadFlowLocations"]] if obj.get("threadFlowLocations") is not None else None,
307
- "taxonomies": [ToolComponent.from_dict(_item) for _item in obj["taxonomies"]] if obj.get("taxonomies") is not None else None,
308
- "addresses": [Address.from_dict(_item) for _item in obj["addresses"]] if obj.get("addresses") is not None else None,
309
- "translations": [ToolComponent.from_dict(_item) for _item in obj["translations"]] if obj.get("translations") is not None else None,
310
- "policies": [ToolComponent.from_dict(_item) for _item in obj["policies"]] if obj.get("policies") is not None else None,
311
- "webRequests": [WebRequest.from_dict(_item) for _item in obj["webRequests"]] if obj.get("webRequests") is not None else None,
312
- "webResponses": [WebResponse.from_dict(_item) for _item in obj["webResponses"]] if obj.get("webResponses") is not None else None,
313
- "specialLocations": SpecialLocations.from_dict(obj["specialLocations"]) if obj.get("specialLocations") is not None else None,
314
- "properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
315
- })
316
- return _obj
317
-
318
-
@@ -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, StrictStr, field_validator
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 RunAutomationDetails(BaseModel):
29
- """
30
- Information that describes a run's identity and role within an engineering system process.
31
- """ # noqa: E501
32
- description: Optional[Message] = None
33
- id: Optional[StrictStr] = Field(default=None, description="A hierarchical string that uniquely identifies this object's containing run object.")
34
- guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A stable, unique identifier for this object's containing run object in the form of a GUID.")
35
- correlation_guid: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.", alias="correlationGuid")
36
- properties: Optional[PropertyBag] = None
37
- __properties: ClassVar[List[str]] = ["description", "id", "guid", "correlationGuid", "properties"]
38
-
39
- @field_validator('guid')
40
- def guid_validate_regular_expression(cls, value):
41
- """Validates the regular expression"""
42
- if value is None:
43
- return value
44
-
45
- 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):
46
- 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}$/")
47
- return value
48
-
49
- @field_validator('correlation_guid')
50
- def correlation_guid_validate_regular_expression(cls, value):
51
- """Validates the regular expression"""
52
- if value is None:
53
- return value
54
-
55
- 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):
56
- 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}$/")
57
- return value
58
-
59
- model_config = ConfigDict(
60
- populate_by_name=True,
61
- validate_assignment=True,
62
- protected_namespaces=(),
63
- )
64
-
65
-
66
- def to_str(self) -> str:
67
- """Returns the string representation of the model using alias"""
68
- return pprint.pformat(self.model_dump(by_alias=True))
69
-
70
- def to_json(self) -> str:
71
- """Returns the JSON representation of the model using alias"""
72
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
73
- return json.dumps(self.to_dict())
74
-
75
- @classmethod
76
- def from_json(cls, json_str: str) -> Optional[Self]:
77
- """Create an instance of RunAutomationDetails from a JSON string"""
78
- return cls.from_dict(json.loads(json_str))
79
-
80
- def to_dict(self) -> Dict[str, Any]:
81
- """Return the dictionary representation of the model using alias.
82
-
83
- This has the following differences from calling pydantic's
84
- `self.model_dump(by_alias=True)`:
85
-
86
- * `None` is only added to the output dict for nullable fields that
87
- were set at model initialization. Other fields with value `None`
88
- are ignored.
89
- """
90
- excluded_fields: Set[str] = set([
91
- ])
92
-
93
- _dict = self.model_dump(
94
- by_alias=True,
95
- exclude=excluded_fields,
96
- exclude_none=True,
97
- )
98
- # override the default output from pydantic by calling `to_dict()` of description
99
- if self.description:
100
- _dict['description'] = self.description.to_dict()
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 RunAutomationDetails 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
- "id": obj.get("id"),
123
- "guid": obj.get("guid"),
124
- "correlationGuid": obj.get("correlationGuid"),
125
- "properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
126
- })
127
- return _obj
128
-
129
-
@@ -1,123 +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, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing_extensions import Annotated
23
- from hiddenlayer.sdk.rest.models.external_properties import ExternalProperties
24
- from hiddenlayer.sdk.rest.models.property_bag import PropertyBag
25
- from hiddenlayer.sdk.rest.models.run import Run
26
- from typing import Optional, Set
27
- from typing_extensions import Self
28
-
29
- class Sarif210(BaseModel):
30
- """
31
- Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.
32
- """ # noqa: E501
33
- var_schema: Optional[StrictStr] = Field(default=None, description="The URI of the JSON schema corresponding to the version.", alias="$schema")
34
- version: Dict[str, Any] = Field(description="The SARIF format version of this log file.")
35
- runs: Annotated[List[Run], Field(min_length=0)] = Field(description="The set of runs contained in this log file.")
36
- inline_external_properties: Optional[Annotated[List[ExternalProperties], Field(min_length=0)]] = Field(default=None, description="References to external property files that share data between runs.", alias="inlineExternalProperties")
37
- properties: Optional[PropertyBag] = None
38
- __properties: ClassVar[List[str]] = ["$schema", "version", "runs", "inlineExternalProperties", "properties"]
39
-
40
- @field_validator('version')
41
- def version_validate_enum(cls, value):
42
- """Validates the enum"""
43
- if value not in set(['2.1.0']):
44
- raise ValueError("must be one of enum values ('2.1.0')")
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 Sarif210 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 each item in runs (list)
87
- _items = []
88
- if self.runs:
89
- for _item in self.runs:
90
- if _item:
91
- _items.append(_item.to_dict())
92
- _dict['runs'] = _items
93
- # override the default output from pydantic by calling `to_dict()` of each item in inline_external_properties (list)
94
- _items = []
95
- if self.inline_external_properties:
96
- for _item in self.inline_external_properties:
97
- if _item:
98
- _items.append(_item.to_dict())
99
- _dict['inlineExternalProperties'] = _items
100
- # override the default output from pydantic by calling `to_dict()` of properties
101
- if self.properties:
102
- _dict['properties'] = self.properties.to_dict()
103
- return _dict
104
-
105
- @classmethod
106
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107
- """Create an instance of Sarif210 from a dict"""
108
- if obj is None:
109
- return None
110
-
111
- if not isinstance(obj, dict):
112
- return cls.model_validate(obj)
113
-
114
- _obj = cls.model_validate({
115
- "$schema": obj.get("$schema"),
116
- "version": obj.get("version"),
117
- "runs": [Run.from_dict(_item) for _item in obj["runs"]] if obj.get("runs") is not None else None,
118
- "inlineExternalProperties": [ExternalProperties.from_dict(_item) for _item in obj["inlineExternalProperties"]] if obj.get("inlineExternalProperties") is not None else None,
119
- "properties": PropertyBag.from_dict(obj["properties"]) if obj.get("properties") is not None else None
120
- })
121
- return _obj
122
-
123
-
@@ -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, StrictStr
21
- from typing import Any, ClassVar, Dict, List
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class ScanCreateRequest(BaseModel):
26
- """
27
- ScanCreateRequest
28
- """ # noqa: E501
29
- location: StrictStr
30
- __properties: ClassVar[List[str]] = ["location"]
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 ScanCreateRequest 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 ScanCreateRequest 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
- "location": obj.get("location")
84
- })
85
- return _obj
86
-
87
-