hiddenlayer-sdk 1.2.1__py3-none-any.whl → 2.0.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- hiddenlayer/__init__.py +0 -10
- hiddenlayer/sdk/exceptions.py +1 -1
- hiddenlayer/sdk/models.py +2 -3
- hiddenlayer/sdk/rest/__init__.py +16 -11
- hiddenlayer/sdk/rest/api/__init__.py +0 -1
- hiddenlayer/sdk/rest/api/model_supply_chain_api.py +1706 -571
- hiddenlayer/sdk/rest/api/sensor_api.py +214 -1320
- hiddenlayer/sdk/rest/models/__init__.py +16 -10
- hiddenlayer/sdk/rest/models/{scan_model_request.py → begin_multi_file_upload200_response.py} +9 -9
- hiddenlayer/sdk/rest/models/{get_multipart_upload_response.py → begin_multipart_file_upload200_response.py} +9 -9
- hiddenlayer/sdk/rest/models/{multipart_upload_part.py → begin_multipart_file_upload200_response_parts_inner.py} +11 -10
- hiddenlayer/sdk/rest/models/errors_inner.py +91 -0
- hiddenlayer/sdk/rest/models/file_details_v3.py +8 -2
- hiddenlayer/sdk/rest/models/{scan_results_v2.py → file_result_v3.py} +21 -32
- hiddenlayer/sdk/rest/models/{model_scan_api_v3_scan_query200_response.py → get_condensed_model_scan_reports200_response.py} +4 -4
- hiddenlayer/sdk/rest/models/inventory_v3.py +97 -0
- hiddenlayer/sdk/rest/models/model_inventory_info.py +1 -1
- hiddenlayer/sdk/rest/models/{detections.py → multi_file_upload_request_v3.py} +14 -22
- hiddenlayer/sdk/rest/models/{model_scan_api_v3_scan_model_version_id_patch200_response.py → notify_model_scan_completed200_response.py} +4 -4
- hiddenlayer/sdk/rest/models/pagination_v3.py +95 -0
- hiddenlayer/sdk/rest/models/problem_details.py +103 -0
- hiddenlayer/sdk/rest/models/scan_detection_v31.py +155 -0
- hiddenlayer/sdk/rest/models/scan_model_details_v3.py +1 -1
- hiddenlayer/sdk/rest/models/scan_results_map_v3.py +105 -0
- hiddenlayer/sdk/rest/models/scan_results_v3.py +120 -0
- hiddenlayer/sdk/rest/models/{model.py → sensor.py} +4 -4
- hiddenlayer/sdk/rest/models/{model_query_response.py → sensor_query_response.py} +7 -7
- hiddenlayer/sdk/services/aidr_predictive.py +57 -3
- hiddenlayer/sdk/services/model_scan.py +98 -135
- hiddenlayer/sdk/version.py +1 -1
- {hiddenlayer_sdk-1.2.1.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/METADATA +12 -2
- {hiddenlayer_sdk-1.2.1.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/RECORD +35 -31
- hiddenlayer/sdk/rest/api/model_scan_api.py +0 -591
- hiddenlayer/sdk/rest/models/scan_results.py +0 -118
- hiddenlayer/sdk/services/model.py +0 -149
- {hiddenlayer_sdk-1.2.1.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/LICENSE +0 -0
- {hiddenlayer_sdk-1.2.1.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/WHEEL +0 -0
- {hiddenlayer_sdk-1.2.1.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/top_level.txt +0 -0
@@ -17,15 +17,18 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from datetime import datetime
|
20
|
-
from pydantic import Field, StrictBool, StrictStr, field_validator
|
20
|
+
from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
|
21
21
|
from typing import List, Optional
|
22
22
|
from typing_extensions import Annotated
|
23
|
-
from hiddenlayer.sdk.rest.models.
|
24
|
-
from hiddenlayer.sdk.rest.models.
|
23
|
+
from hiddenlayer.sdk.rest.models.begin_multi_file_upload200_response import BeginMultiFileUpload200Response
|
24
|
+
from hiddenlayer.sdk.rest.models.begin_multipart_file_upload200_response import BeginMultipartFileUpload200Response
|
25
|
+
from hiddenlayer.sdk.rest.models.get_condensed_model_scan_reports200_response import GetCondensedModelScanReports200Response
|
26
|
+
from hiddenlayer.sdk.rest.models.multi_file_upload_request_v3 import MultiFileUploadRequestV3
|
27
|
+
from hiddenlayer.sdk.rest.models.notify_model_scan_completed200_response import NotifyModelScanCompleted200Response
|
25
28
|
from hiddenlayer.sdk.rest.models.scan_create_request import ScanCreateRequest
|
26
29
|
from hiddenlayer.sdk.rest.models.scan_job import ScanJob
|
27
30
|
from hiddenlayer.sdk.rest.models.scan_report_v3 import ScanReportV3
|
28
|
-
from hiddenlayer.sdk.rest.models.
|
31
|
+
from hiddenlayer.sdk.rest.models.scan_results_map_v3 import ScanResultsMapV3
|
29
32
|
|
30
33
|
from hiddenlayer.sdk.rest.api_client import ApiClient, RequestSerialized
|
31
34
|
from hiddenlayer.sdk.rest.api_response import ApiResponse
|
@@ -46,10 +49,9 @@ class ModelSupplyChainApi:
|
|
46
49
|
|
47
50
|
|
48
51
|
@validate_call
|
49
|
-
def
|
52
|
+
def begin_multi_file_upload(
|
50
53
|
self,
|
51
|
-
|
52
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
54
|
+
multi_file_upload_request_v3: Annotated[MultiFileUploadRequestV3, Field(description="Request body for create")],
|
53
55
|
_request_timeout: Union[
|
54
56
|
None,
|
55
57
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -62,14 +64,12 @@ class ModelSupplyChainApi:
|
|
62
64
|
_content_type: Optional[StrictStr] = None,
|
63
65
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
64
66
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
65
|
-
) ->
|
66
|
-
"""
|
67
|
+
) -> BeginMultiFileUpload200Response:
|
68
|
+
"""Start V3 Upload
|
67
69
|
|
68
70
|
|
69
|
-
:param
|
70
|
-
:type
|
71
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
72
|
-
:type has_detections: bool
|
71
|
+
:param multi_file_upload_request_v3: Request body for create (required)
|
72
|
+
:type multi_file_upload_request_v3: MultiFileUploadRequestV3
|
73
73
|
:param _request_timeout: timeout setting for this request. If one
|
74
74
|
number provided, it will be total request
|
75
75
|
timeout. It can also be a pair (tuple) of
|
@@ -92,9 +92,8 @@ class ModelSupplyChainApi:
|
|
92
92
|
:return: Returns the result object.
|
93
93
|
""" # noqa: E501
|
94
94
|
|
95
|
-
_param = self.
|
96
|
-
|
97
|
-
has_detections=has_detections,
|
95
|
+
_param = self._begin_multi_file_upload_serialize(
|
96
|
+
multi_file_upload_request_v3=multi_file_upload_request_v3,
|
98
97
|
_request_auth=_request_auth,
|
99
98
|
_content_type=_content_type,
|
100
99
|
_headers=_headers,
|
@@ -102,9 +101,9 @@ class ModelSupplyChainApi:
|
|
102
101
|
)
|
103
102
|
|
104
103
|
_response_types_map: Dict[str, Optional[str]] = {
|
105
|
-
'200': "
|
104
|
+
'200': "BeginMultiFileUpload200Response",
|
106
105
|
'400': None,
|
107
|
-
'
|
106
|
+
'422': "ValidationErrorModel",
|
108
107
|
}
|
109
108
|
response_data = self.api_client.call_api(
|
110
109
|
*_param,
|
@@ -118,10 +117,9 @@ class ModelSupplyChainApi:
|
|
118
117
|
|
119
118
|
|
120
119
|
@validate_call
|
121
|
-
def
|
120
|
+
def begin_multi_file_upload_with_http_info(
|
122
121
|
self,
|
123
|
-
|
124
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
122
|
+
multi_file_upload_request_v3: Annotated[MultiFileUploadRequestV3, Field(description="Request body for create")],
|
125
123
|
_request_timeout: Union[
|
126
124
|
None,
|
127
125
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -134,14 +132,12 @@ class ModelSupplyChainApi:
|
|
134
132
|
_content_type: Optional[StrictStr] = None,
|
135
133
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
136
134
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
137
|
-
) -> ApiResponse[
|
138
|
-
"""
|
135
|
+
) -> ApiResponse[BeginMultiFileUpload200Response]:
|
136
|
+
"""Start V3 Upload
|
139
137
|
|
140
138
|
|
141
|
-
:param
|
142
|
-
:type
|
143
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
144
|
-
:type has_detections: bool
|
139
|
+
:param multi_file_upload_request_v3: Request body for create (required)
|
140
|
+
:type multi_file_upload_request_v3: MultiFileUploadRequestV3
|
145
141
|
:param _request_timeout: timeout setting for this request. If one
|
146
142
|
number provided, it will be total request
|
147
143
|
timeout. It can also be a pair (tuple) of
|
@@ -164,9 +160,8 @@ class ModelSupplyChainApi:
|
|
164
160
|
:return: Returns the result object.
|
165
161
|
""" # noqa: E501
|
166
162
|
|
167
|
-
_param = self.
|
168
|
-
|
169
|
-
has_detections=has_detections,
|
163
|
+
_param = self._begin_multi_file_upload_serialize(
|
164
|
+
multi_file_upload_request_v3=multi_file_upload_request_v3,
|
170
165
|
_request_auth=_request_auth,
|
171
166
|
_content_type=_content_type,
|
172
167
|
_headers=_headers,
|
@@ -174,9 +169,9 @@ class ModelSupplyChainApi:
|
|
174
169
|
)
|
175
170
|
|
176
171
|
_response_types_map: Dict[str, Optional[str]] = {
|
177
|
-
'200': "
|
172
|
+
'200': "BeginMultiFileUpload200Response",
|
178
173
|
'400': None,
|
179
|
-
'
|
174
|
+
'422': "ValidationErrorModel",
|
180
175
|
}
|
181
176
|
response_data = self.api_client.call_api(
|
182
177
|
*_param,
|
@@ -190,10 +185,9 @@ class ModelSupplyChainApi:
|
|
190
185
|
|
191
186
|
|
192
187
|
@validate_call
|
193
|
-
def
|
188
|
+
def begin_multi_file_upload_without_preload_content(
|
194
189
|
self,
|
195
|
-
|
196
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
190
|
+
multi_file_upload_request_v3: Annotated[MultiFileUploadRequestV3, Field(description="Request body for create")],
|
197
191
|
_request_timeout: Union[
|
198
192
|
None,
|
199
193
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -207,13 +201,11 @@ class ModelSupplyChainApi:
|
|
207
201
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
208
202
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
209
203
|
) -> RESTResponseType:
|
210
|
-
"""
|
204
|
+
"""Start V3 Upload
|
211
205
|
|
212
206
|
|
213
|
-
:param
|
214
|
-
:type
|
215
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
216
|
-
:type has_detections: bool
|
207
|
+
:param multi_file_upload_request_v3: Request body for create (required)
|
208
|
+
:type multi_file_upload_request_v3: MultiFileUploadRequestV3
|
217
209
|
:param _request_timeout: timeout setting for this request. If one
|
218
210
|
number provided, it will be total request
|
219
211
|
timeout. It can also be a pair (tuple) of
|
@@ -236,9 +228,8 @@ class ModelSupplyChainApi:
|
|
236
228
|
:return: Returns the result object.
|
237
229
|
""" # noqa: E501
|
238
230
|
|
239
|
-
_param = self.
|
240
|
-
|
241
|
-
has_detections=has_detections,
|
231
|
+
_param = self._begin_multi_file_upload_serialize(
|
232
|
+
multi_file_upload_request_v3=multi_file_upload_request_v3,
|
242
233
|
_request_auth=_request_auth,
|
243
234
|
_content_type=_content_type,
|
244
235
|
_headers=_headers,
|
@@ -246,9 +237,9 @@ class ModelSupplyChainApi:
|
|
246
237
|
)
|
247
238
|
|
248
239
|
_response_types_map: Dict[str, Optional[str]] = {
|
249
|
-
'200': "
|
240
|
+
'200': "BeginMultiFileUpload200Response",
|
250
241
|
'400': None,
|
251
|
-
'
|
242
|
+
'422': "ValidationErrorModel",
|
252
243
|
}
|
253
244
|
response_data = self.api_client.call_api(
|
254
245
|
*_param,
|
@@ -257,10 +248,9 @@ class ModelSupplyChainApi:
|
|
257
248
|
return response_data.response
|
258
249
|
|
259
250
|
|
260
|
-
def
|
251
|
+
def _begin_multi_file_upload_serialize(
|
261
252
|
self,
|
262
|
-
|
263
|
-
has_detections,
|
253
|
+
multi_file_upload_request_v3,
|
264
254
|
_request_auth,
|
265
255
|
_content_type,
|
266
256
|
_headers,
|
@@ -280,26 +270,34 @@ class ModelSupplyChainApi:
|
|
280
270
|
_body_params: Optional[bytes] = None
|
281
271
|
|
282
272
|
# process the path parameters
|
283
|
-
if scan_id is not None:
|
284
|
-
_path_params['scan_id'] = scan_id
|
285
273
|
# process the query parameters
|
286
|
-
if has_detections is not None:
|
287
|
-
|
288
|
-
_query_params.append(('has_detections', has_detections))
|
289
|
-
|
290
274
|
# process the header parameters
|
291
275
|
# process the form parameters
|
292
276
|
# process the body parameter
|
277
|
+
if multi_file_upload_request_v3 is not None:
|
278
|
+
_body_params = multi_file_upload_request_v3
|
293
279
|
|
294
280
|
|
295
281
|
# set the HTTP header `Accept`
|
296
282
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
297
283
|
[
|
298
|
-
'application/json
|
299
|
-
'application/sarif+json'
|
284
|
+
'application/json'
|
300
285
|
]
|
301
286
|
)
|
302
287
|
|
288
|
+
# set the HTTP header `Content-Type`
|
289
|
+
if _content_type:
|
290
|
+
_header_params['Content-Type'] = _content_type
|
291
|
+
else:
|
292
|
+
_default_content_type = (
|
293
|
+
self.api_client.select_header_content_type(
|
294
|
+
[
|
295
|
+
'application/json'
|
296
|
+
]
|
297
|
+
)
|
298
|
+
)
|
299
|
+
if _default_content_type is not None:
|
300
|
+
_header_params['Content-Type'] = _default_content_type
|
303
301
|
|
304
302
|
# authentication setting
|
305
303
|
_auth_settings: List[str] = [
|
@@ -307,8 +305,8 @@ class ModelSupplyChainApi:
|
|
307
305
|
]
|
308
306
|
|
309
307
|
return self.api_client.param_serialize(
|
310
|
-
method='
|
311
|
-
resource_path='/scan/v3/
|
308
|
+
method='POST',
|
309
|
+
resource_path='/scan/v3/upload',
|
312
310
|
path_params=_path_params,
|
313
311
|
query_params=_query_params,
|
314
312
|
header_params=_header_params,
|
@@ -325,11 +323,11 @@ class ModelSupplyChainApi:
|
|
325
323
|
|
326
324
|
|
327
325
|
@validate_call
|
328
|
-
def
|
326
|
+
def begin_multipart_file_upload(
|
329
327
|
self,
|
328
|
+
file_content_length: Annotated[StrictInt, Field(description="Added file size in bytes")],
|
329
|
+
file_name: Annotated[StrictStr, Field(description="Added file name")],
|
330
330
|
scan_id: StrictStr,
|
331
|
-
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for partial update")],
|
332
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
333
331
|
_request_timeout: Union[
|
334
332
|
None,
|
335
333
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -342,16 +340,16 @@ class ModelSupplyChainApi:
|
|
342
340
|
_content_type: Optional[StrictStr] = None,
|
343
341
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
344
342
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
345
|
-
) ->
|
346
|
-
"""
|
343
|
+
) -> BeginMultipartFileUpload200Response:
|
344
|
+
"""Add file to V3 Upload
|
347
345
|
|
348
346
|
|
347
|
+
:param file_content_length: Added file size in bytes (required)
|
348
|
+
:type file_content_length: int
|
349
|
+
:param file_name: Added file name (required)
|
350
|
+
:type file_name: str
|
349
351
|
:param scan_id: (required)
|
350
352
|
:type scan_id: str
|
351
|
-
:param scan_report_v3: Request body for partial update (required)
|
352
|
-
:type scan_report_v3: ScanReportV3
|
353
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
354
|
-
:type has_detections: bool
|
355
353
|
:param _request_timeout: timeout setting for this request. If one
|
356
354
|
number provided, it will be total request
|
357
355
|
timeout. It can also be a pair (tuple) of
|
@@ -374,10 +372,10 @@ class ModelSupplyChainApi:
|
|
374
372
|
:return: Returns the result object.
|
375
373
|
""" # noqa: E501
|
376
374
|
|
377
|
-
_param = self.
|
375
|
+
_param = self._begin_multipart_file_upload_serialize(
|
376
|
+
file_content_length=file_content_length,
|
377
|
+
file_name=file_name,
|
378
378
|
scan_id=scan_id,
|
379
|
-
scan_report_v3=scan_report_v3,
|
380
|
-
has_detections=has_detections,
|
381
379
|
_request_auth=_request_auth,
|
382
380
|
_content_type=_content_type,
|
383
381
|
_headers=_headers,
|
@@ -385,7 +383,7 @@ class ModelSupplyChainApi:
|
|
385
383
|
)
|
386
384
|
|
387
385
|
_response_types_map: Dict[str, Optional[str]] = {
|
388
|
-
'200': "
|
386
|
+
'200': "BeginMultipartFileUpload200Response",
|
389
387
|
'400': None,
|
390
388
|
'422': "ValidationErrorModel",
|
391
389
|
}
|
@@ -401,11 +399,11 @@ class ModelSupplyChainApi:
|
|
401
399
|
|
402
400
|
|
403
401
|
@validate_call
|
404
|
-
def
|
402
|
+
def begin_multipart_file_upload_with_http_info(
|
405
403
|
self,
|
404
|
+
file_content_length: Annotated[StrictInt, Field(description="Added file size in bytes")],
|
405
|
+
file_name: Annotated[StrictStr, Field(description="Added file name")],
|
406
406
|
scan_id: StrictStr,
|
407
|
-
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for partial update")],
|
408
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
409
407
|
_request_timeout: Union[
|
410
408
|
None,
|
411
409
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -418,16 +416,16 @@ class ModelSupplyChainApi:
|
|
418
416
|
_content_type: Optional[StrictStr] = None,
|
419
417
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
420
418
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
421
|
-
) -> ApiResponse[
|
422
|
-
"""
|
419
|
+
) -> ApiResponse[BeginMultipartFileUpload200Response]:
|
420
|
+
"""Add file to V3 Upload
|
423
421
|
|
424
422
|
|
423
|
+
:param file_content_length: Added file size in bytes (required)
|
424
|
+
:type file_content_length: int
|
425
|
+
:param file_name: Added file name (required)
|
426
|
+
:type file_name: str
|
425
427
|
:param scan_id: (required)
|
426
428
|
:type scan_id: str
|
427
|
-
:param scan_report_v3: Request body for partial update (required)
|
428
|
-
:type scan_report_v3: ScanReportV3
|
429
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
430
|
-
:type has_detections: bool
|
431
429
|
:param _request_timeout: timeout setting for this request. If one
|
432
430
|
number provided, it will be total request
|
433
431
|
timeout. It can also be a pair (tuple) of
|
@@ -450,10 +448,10 @@ class ModelSupplyChainApi:
|
|
450
448
|
:return: Returns the result object.
|
451
449
|
""" # noqa: E501
|
452
450
|
|
453
|
-
_param = self.
|
451
|
+
_param = self._begin_multipart_file_upload_serialize(
|
452
|
+
file_content_length=file_content_length,
|
453
|
+
file_name=file_name,
|
454
454
|
scan_id=scan_id,
|
455
|
-
scan_report_v3=scan_report_v3,
|
456
|
-
has_detections=has_detections,
|
457
455
|
_request_auth=_request_auth,
|
458
456
|
_content_type=_content_type,
|
459
457
|
_headers=_headers,
|
@@ -461,7 +459,7 @@ class ModelSupplyChainApi:
|
|
461
459
|
)
|
462
460
|
|
463
461
|
_response_types_map: Dict[str, Optional[str]] = {
|
464
|
-
'200': "
|
462
|
+
'200': "BeginMultipartFileUpload200Response",
|
465
463
|
'400': None,
|
466
464
|
'422': "ValidationErrorModel",
|
467
465
|
}
|
@@ -477,11 +475,11 @@ class ModelSupplyChainApi:
|
|
477
475
|
|
478
476
|
|
479
477
|
@validate_call
|
480
|
-
def
|
478
|
+
def begin_multipart_file_upload_without_preload_content(
|
481
479
|
self,
|
480
|
+
file_content_length: Annotated[StrictInt, Field(description="Added file size in bytes")],
|
481
|
+
file_name: Annotated[StrictStr, Field(description="Added file name")],
|
482
482
|
scan_id: StrictStr,
|
483
|
-
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for partial update")],
|
484
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
485
483
|
_request_timeout: Union[
|
486
484
|
None,
|
487
485
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -495,15 +493,15 @@ class ModelSupplyChainApi:
|
|
495
493
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
496
494
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
497
495
|
) -> RESTResponseType:
|
498
|
-
"""
|
496
|
+
"""Add file to V3 Upload
|
499
497
|
|
500
498
|
|
499
|
+
:param file_content_length: Added file size in bytes (required)
|
500
|
+
:type file_content_length: int
|
501
|
+
:param file_name: Added file name (required)
|
502
|
+
:type file_name: str
|
501
503
|
:param scan_id: (required)
|
502
504
|
:type scan_id: str
|
503
|
-
:param scan_report_v3: Request body for partial update (required)
|
504
|
-
:type scan_report_v3: ScanReportV3
|
505
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
506
|
-
:type has_detections: bool
|
507
505
|
:param _request_timeout: timeout setting for this request. If one
|
508
506
|
number provided, it will be total request
|
509
507
|
timeout. It can also be a pair (tuple) of
|
@@ -526,10 +524,10 @@ class ModelSupplyChainApi:
|
|
526
524
|
:return: Returns the result object.
|
527
525
|
""" # noqa: E501
|
528
526
|
|
529
|
-
_param = self.
|
527
|
+
_param = self._begin_multipart_file_upload_serialize(
|
528
|
+
file_content_length=file_content_length,
|
529
|
+
file_name=file_name,
|
530
530
|
scan_id=scan_id,
|
531
|
-
scan_report_v3=scan_report_v3,
|
532
|
-
has_detections=has_detections,
|
533
531
|
_request_auth=_request_auth,
|
534
532
|
_content_type=_content_type,
|
535
533
|
_headers=_headers,
|
@@ -537,7 +535,7 @@ class ModelSupplyChainApi:
|
|
537
535
|
)
|
538
536
|
|
539
537
|
_response_types_map: Dict[str, Optional[str]] = {
|
540
|
-
'200': "
|
538
|
+
'200': "BeginMultipartFileUpload200Response",
|
541
539
|
'400': None,
|
542
540
|
'422': "ValidationErrorModel",
|
543
541
|
}
|
@@ -548,11 +546,11 @@ class ModelSupplyChainApi:
|
|
548
546
|
return response_data.response
|
549
547
|
|
550
548
|
|
551
|
-
def
|
549
|
+
def _begin_multipart_file_upload_serialize(
|
552
550
|
self,
|
551
|
+
file_content_length,
|
552
|
+
file_name,
|
553
553
|
scan_id,
|
554
|
-
scan_report_v3,
|
555
|
-
has_detections,
|
556
554
|
_request_auth,
|
557
555
|
_content_type,
|
558
556
|
_headers,
|
@@ -575,15 +573,13 @@ class ModelSupplyChainApi:
|
|
575
573
|
if scan_id is not None:
|
576
574
|
_path_params['scan_id'] = scan_id
|
577
575
|
# process the query parameters
|
578
|
-
if has_detections is not None:
|
579
|
-
|
580
|
-
_query_params.append(('has_detections', has_detections))
|
581
|
-
|
582
576
|
# process the header parameters
|
577
|
+
if file_content_length is not None:
|
578
|
+
_header_params['file-content-length'] = file_content_length
|
579
|
+
if file_name is not None:
|
580
|
+
_header_params['file-name'] = file_name
|
583
581
|
# process the form parameters
|
584
582
|
# process the body parameter
|
585
|
-
if scan_report_v3 is not None:
|
586
|
-
_body_params = scan_report_v3
|
587
583
|
|
588
584
|
|
589
585
|
# set the HTTP header `Accept`
|
@@ -593,19 +589,6 @@ class ModelSupplyChainApi:
|
|
593
589
|
]
|
594
590
|
)
|
595
591
|
|
596
|
-
# set the HTTP header `Content-Type`
|
597
|
-
if _content_type:
|
598
|
-
_header_params['Content-Type'] = _content_type
|
599
|
-
else:
|
600
|
-
_default_content_type = (
|
601
|
-
self.api_client.select_header_content_type(
|
602
|
-
[
|
603
|
-
'application/json'
|
604
|
-
]
|
605
|
-
)
|
606
|
-
)
|
607
|
-
if _default_content_type is not None:
|
608
|
-
_header_params['Content-Type'] = _default_content_type
|
609
592
|
|
610
593
|
# authentication setting
|
611
594
|
_auth_settings: List[str] = [
|
@@ -613,8 +596,8 @@ class ModelSupplyChainApi:
|
|
613
596
|
]
|
614
597
|
|
615
598
|
return self.api_client.param_serialize(
|
616
|
-
method='
|
617
|
-
resource_path='/scan/v3/
|
599
|
+
method='POST',
|
600
|
+
resource_path='/scan/v3/upload/{scan_id}/file',
|
618
601
|
path_params=_path_params,
|
619
602
|
query_params=_query_params,
|
620
603
|
header_params=_header_params,
|
@@ -631,11 +614,9 @@ class ModelSupplyChainApi:
|
|
631
614
|
|
632
615
|
|
633
616
|
@validate_call
|
634
|
-
def
|
617
|
+
def complete_multi_file_upload(
|
635
618
|
self,
|
636
619
|
scan_id: StrictStr,
|
637
|
-
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for create")],
|
638
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
639
620
|
_request_timeout: Union[
|
640
621
|
None,
|
641
622
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -648,16 +629,12 @@ class ModelSupplyChainApi:
|
|
648
629
|
_content_type: Optional[StrictStr] = None,
|
649
630
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
650
631
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
651
|
-
) ->
|
652
|
-
"""Indicate
|
632
|
+
) -> BeginMultiFileUpload200Response:
|
633
|
+
"""Indicate All files are uploaded and start the scan
|
653
634
|
|
654
635
|
|
655
636
|
:param scan_id: (required)
|
656
637
|
:type scan_id: str
|
657
|
-
:param scan_report_v3: Request body for create (required)
|
658
|
-
:type scan_report_v3: ScanReportV3
|
659
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
660
|
-
:type has_detections: bool
|
661
638
|
:param _request_timeout: timeout setting for this request. If one
|
662
639
|
number provided, it will be total request
|
663
640
|
timeout. It can also be a pair (tuple) of
|
@@ -680,10 +657,8 @@ class ModelSupplyChainApi:
|
|
680
657
|
:return: Returns the result object.
|
681
658
|
""" # noqa: E501
|
682
659
|
|
683
|
-
_param = self.
|
660
|
+
_param = self._complete_multi_file_upload_serialize(
|
684
661
|
scan_id=scan_id,
|
685
|
-
scan_report_v3=scan_report_v3,
|
686
|
-
has_detections=has_detections,
|
687
662
|
_request_auth=_request_auth,
|
688
663
|
_content_type=_content_type,
|
689
664
|
_headers=_headers,
|
@@ -691,7 +666,7 @@ class ModelSupplyChainApi:
|
|
691
666
|
)
|
692
667
|
|
693
668
|
_response_types_map: Dict[str, Optional[str]] = {
|
694
|
-
'
|
669
|
+
'200': "BeginMultiFileUpload200Response",
|
695
670
|
'400': None,
|
696
671
|
'422': "ValidationErrorModel",
|
697
672
|
}
|
@@ -707,11 +682,9 @@ class ModelSupplyChainApi:
|
|
707
682
|
|
708
683
|
|
709
684
|
@validate_call
|
710
|
-
def
|
685
|
+
def complete_multi_file_upload_with_http_info(
|
711
686
|
self,
|
712
687
|
scan_id: StrictStr,
|
713
|
-
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for create")],
|
714
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
715
688
|
_request_timeout: Union[
|
716
689
|
None,
|
717
690
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -724,16 +697,12 @@ class ModelSupplyChainApi:
|
|
724
697
|
_content_type: Optional[StrictStr] = None,
|
725
698
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
726
699
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
727
|
-
) -> ApiResponse[
|
728
|
-
"""Indicate
|
700
|
+
) -> ApiResponse[BeginMultiFileUpload200Response]:
|
701
|
+
"""Indicate All files are uploaded and start the scan
|
729
702
|
|
730
703
|
|
731
704
|
:param scan_id: (required)
|
732
705
|
:type scan_id: str
|
733
|
-
:param scan_report_v3: Request body for create (required)
|
734
|
-
:type scan_report_v3: ScanReportV3
|
735
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
736
|
-
:type has_detections: bool
|
737
706
|
:param _request_timeout: timeout setting for this request. If one
|
738
707
|
number provided, it will be total request
|
739
708
|
timeout. It can also be a pair (tuple) of
|
@@ -756,10 +725,8 @@ class ModelSupplyChainApi:
|
|
756
725
|
:return: Returns the result object.
|
757
726
|
""" # noqa: E501
|
758
727
|
|
759
|
-
_param = self.
|
728
|
+
_param = self._complete_multi_file_upload_serialize(
|
760
729
|
scan_id=scan_id,
|
761
|
-
scan_report_v3=scan_report_v3,
|
762
|
-
has_detections=has_detections,
|
763
730
|
_request_auth=_request_auth,
|
764
731
|
_content_type=_content_type,
|
765
732
|
_headers=_headers,
|
@@ -767,7 +734,7 @@ class ModelSupplyChainApi:
|
|
767
734
|
)
|
768
735
|
|
769
736
|
_response_types_map: Dict[str, Optional[str]] = {
|
770
|
-
'
|
737
|
+
'200': "BeginMultiFileUpload200Response",
|
771
738
|
'400': None,
|
772
739
|
'422': "ValidationErrorModel",
|
773
740
|
}
|
@@ -783,11 +750,9 @@ class ModelSupplyChainApi:
|
|
783
750
|
|
784
751
|
|
785
752
|
@validate_call
|
786
|
-
def
|
753
|
+
def complete_multi_file_upload_without_preload_content(
|
787
754
|
self,
|
788
755
|
scan_id: StrictStr,
|
789
|
-
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for create")],
|
790
|
-
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
791
756
|
_request_timeout: Union[
|
792
757
|
None,
|
793
758
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -801,15 +766,11 @@ class ModelSupplyChainApi:
|
|
801
766
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
802
767
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
803
768
|
) -> RESTResponseType:
|
804
|
-
"""Indicate
|
769
|
+
"""Indicate All files are uploaded and start the scan
|
805
770
|
|
806
771
|
|
807
772
|
:param scan_id: (required)
|
808
773
|
:type scan_id: str
|
809
|
-
:param scan_report_v3: Request body for create (required)
|
810
|
-
:type scan_report_v3: ScanReportV3
|
811
|
-
:param has_detections: Filter file_results to only those that have detections (and parents)
|
812
|
-
:type has_detections: bool
|
813
774
|
:param _request_timeout: timeout setting for this request. If one
|
814
775
|
number provided, it will be total request
|
815
776
|
timeout. It can also be a pair (tuple) of
|
@@ -832,10 +793,8 @@ class ModelSupplyChainApi:
|
|
832
793
|
:return: Returns the result object.
|
833
794
|
""" # noqa: E501
|
834
795
|
|
835
|
-
_param = self.
|
796
|
+
_param = self._complete_multi_file_upload_serialize(
|
836
797
|
scan_id=scan_id,
|
837
|
-
scan_report_v3=scan_report_v3,
|
838
|
-
has_detections=has_detections,
|
839
798
|
_request_auth=_request_auth,
|
840
799
|
_content_type=_content_type,
|
841
800
|
_headers=_headers,
|
@@ -843,7 +802,7 @@ class ModelSupplyChainApi:
|
|
843
802
|
)
|
844
803
|
|
845
804
|
_response_types_map: Dict[str, Optional[str]] = {
|
846
|
-
'
|
805
|
+
'200': "BeginMultiFileUpload200Response",
|
847
806
|
'400': None,
|
848
807
|
'422': "ValidationErrorModel",
|
849
808
|
}
|
@@ -854,11 +813,9 @@ class ModelSupplyChainApi:
|
|
854
813
|
return response_data.response
|
855
814
|
|
856
815
|
|
857
|
-
def
|
816
|
+
def _complete_multi_file_upload_serialize(
|
858
817
|
self,
|
859
818
|
scan_id,
|
860
|
-
scan_report_v3,
|
861
|
-
has_detections,
|
862
819
|
_request_auth,
|
863
820
|
_content_type,
|
864
821
|
_headers,
|
@@ -881,15 +838,9 @@ class ModelSupplyChainApi:
|
|
881
838
|
if scan_id is not None:
|
882
839
|
_path_params['scan_id'] = scan_id
|
883
840
|
# process the query parameters
|
884
|
-
if has_detections is not None:
|
885
|
-
|
886
|
-
_query_params.append(('has_detections', has_detections))
|
887
|
-
|
888
841
|
# process the header parameters
|
889
842
|
# process the form parameters
|
890
843
|
# process the body parameter
|
891
|
-
if scan_report_v3 is not None:
|
892
|
-
_body_params = scan_report_v3
|
893
844
|
|
894
845
|
|
895
846
|
# set the HTTP header `Accept`
|
@@ -899,19 +850,6 @@ class ModelSupplyChainApi:
|
|
899
850
|
]
|
900
851
|
)
|
901
852
|
|
902
|
-
# set the HTTP header `Content-Type`
|
903
|
-
if _content_type:
|
904
|
-
_header_params['Content-Type'] = _content_type
|
905
|
-
else:
|
906
|
-
_default_content_type = (
|
907
|
-
self.api_client.select_header_content_type(
|
908
|
-
[
|
909
|
-
'application/json'
|
910
|
-
]
|
911
|
-
)
|
912
|
-
)
|
913
|
-
if _default_content_type is not None:
|
914
|
-
_header_params['Content-Type'] = _default_content_type
|
915
853
|
|
916
854
|
# authentication setting
|
917
855
|
_auth_settings: List[str] = [
|
@@ -919,8 +857,8 @@ class ModelSupplyChainApi:
|
|
919
857
|
]
|
920
858
|
|
921
859
|
return self.api_client.param_serialize(
|
922
|
-
method='
|
923
|
-
resource_path='/scan/v3/
|
860
|
+
method='PATCH',
|
861
|
+
resource_path='/scan/v3/upload/{scan_id}',
|
924
862
|
path_params=_path_params,
|
925
863
|
query_params=_query_params,
|
926
864
|
header_params=_header_params,
|
@@ -937,18 +875,10 @@ class ModelSupplyChainApi:
|
|
937
875
|
|
938
876
|
|
939
877
|
@validate_call
|
940
|
-
def
|
878
|
+
def complete_multipart_file_upload(
|
941
879
|
self,
|
942
|
-
|
943
|
-
|
944
|
-
start_time: Annotated[Optional[datetime], Field(description="Start Time")] = None,
|
945
|
-
end_time: Annotated[Optional[datetime], Field(description="End Time")] = None,
|
946
|
-
severity: Annotated[Optional[List[StrictStr]], Field(description="Severities")] = None,
|
947
|
-
status: Annotated[Optional[List[StrictStr]], Field(description="Statuses")] = None,
|
948
|
-
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
|
949
|
-
offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
|
950
|
-
sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by status, severity or created at, ascending (+) or the default descending (-)")] = None,
|
951
|
-
latest_per_model_version_only: Annotated[Optional[StrictBool], Field(description="only return latest result per model version")] = None,
|
880
|
+
scan_id: StrictStr,
|
881
|
+
file_id: StrictStr,
|
952
882
|
_request_timeout: Union[
|
953
883
|
None,
|
954
884
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -961,30 +891,14 @@ class ModelSupplyChainApi:
|
|
961
891
|
_content_type: Optional[StrictStr] = None,
|
962
892
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
963
893
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
964
|
-
) ->
|
965
|
-
"""
|
894
|
+
) -> BeginMultiFileUpload200Response:
|
895
|
+
"""Indicate that upload is completed for {file_id}
|
966
896
|
|
967
897
|
|
968
|
-
:param
|
969
|
-
:type
|
970
|
-
:param
|
971
|
-
:type
|
972
|
-
:param start_time: Start Time
|
973
|
-
:type start_time: datetime
|
974
|
-
:param end_time: End Time
|
975
|
-
:type end_time: datetime
|
976
|
-
:param severity: Severities
|
977
|
-
:type severity: List[str]
|
978
|
-
:param status: Statuses
|
979
|
-
:type status: List[str]
|
980
|
-
:param limit:
|
981
|
-
:type limit: int
|
982
|
-
:param offset:
|
983
|
-
:type offset: int
|
984
|
-
:param sort: allow sorting by status, severity or created at, ascending (+) or the default descending (-)
|
985
|
-
:type sort: str
|
986
|
-
:param latest_per_model_version_only: only return latest result per model version
|
987
|
-
:type latest_per_model_version_only: bool
|
898
|
+
:param scan_id: (required)
|
899
|
+
:type scan_id: str
|
900
|
+
:param file_id: (required)
|
901
|
+
:type file_id: str
|
988
902
|
:param _request_timeout: timeout setting for this request. If one
|
989
903
|
number provided, it will be total request
|
990
904
|
timeout. It can also be a pair (tuple) of
|
@@ -1007,17 +921,9 @@ class ModelSupplyChainApi:
|
|
1007
921
|
:return: Returns the result object.
|
1008
922
|
""" # noqa: E501
|
1009
923
|
|
1010
|
-
_param = self.
|
1011
|
-
|
1012
|
-
|
1013
|
-
start_time=start_time,
|
1014
|
-
end_time=end_time,
|
1015
|
-
severity=severity,
|
1016
|
-
status=status,
|
1017
|
-
limit=limit,
|
1018
|
-
offset=offset,
|
1019
|
-
sort=sort,
|
1020
|
-
latest_per_model_version_only=latest_per_model_version_only,
|
924
|
+
_param = self._complete_multipart_file_upload_serialize(
|
925
|
+
scan_id=scan_id,
|
926
|
+
file_id=file_id,
|
1021
927
|
_request_auth=_request_auth,
|
1022
928
|
_content_type=_content_type,
|
1023
929
|
_headers=_headers,
|
@@ -1025,9 +931,9 @@ class ModelSupplyChainApi:
|
|
1025
931
|
)
|
1026
932
|
|
1027
933
|
_response_types_map: Dict[str, Optional[str]] = {
|
1028
|
-
'200': "
|
934
|
+
'200': "BeginMultiFileUpload200Response",
|
1029
935
|
'400': None,
|
1030
|
-
'
|
936
|
+
'422': "ValidationErrorModel",
|
1031
937
|
}
|
1032
938
|
response_data = self.api_client.call_api(
|
1033
939
|
*_param,
|
@@ -1041,18 +947,10 @@ class ModelSupplyChainApi:
|
|
1041
947
|
|
1042
948
|
|
1043
949
|
@validate_call
|
1044
|
-
def
|
950
|
+
def complete_multipart_file_upload_with_http_info(
|
1045
951
|
self,
|
1046
|
-
|
1047
|
-
|
1048
|
-
start_time: Annotated[Optional[datetime], Field(description="Start Time")] = None,
|
1049
|
-
end_time: Annotated[Optional[datetime], Field(description="End Time")] = None,
|
1050
|
-
severity: Annotated[Optional[List[StrictStr]], Field(description="Severities")] = None,
|
1051
|
-
status: Annotated[Optional[List[StrictStr]], Field(description="Statuses")] = None,
|
1052
|
-
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
|
1053
|
-
offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
|
1054
|
-
sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by status, severity or created at, ascending (+) or the default descending (-)")] = None,
|
1055
|
-
latest_per_model_version_only: Annotated[Optional[StrictBool], Field(description="only return latest result per model version")] = None,
|
952
|
+
scan_id: StrictStr,
|
953
|
+
file_id: StrictStr,
|
1056
954
|
_request_timeout: Union[
|
1057
955
|
None,
|
1058
956
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1065,30 +963,14 @@ class ModelSupplyChainApi:
|
|
1065
963
|
_content_type: Optional[StrictStr] = None,
|
1066
964
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1067
965
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1068
|
-
) -> ApiResponse[
|
1069
|
-
"""
|
966
|
+
) -> ApiResponse[BeginMultiFileUpload200Response]:
|
967
|
+
"""Indicate that upload is completed for {file_id}
|
1070
968
|
|
1071
969
|
|
1072
|
-
:param
|
1073
|
-
:type
|
1074
|
-
:param
|
1075
|
-
:type
|
1076
|
-
:param start_time: Start Time
|
1077
|
-
:type start_time: datetime
|
1078
|
-
:param end_time: End Time
|
1079
|
-
:type end_time: datetime
|
1080
|
-
:param severity: Severities
|
1081
|
-
:type severity: List[str]
|
1082
|
-
:param status: Statuses
|
1083
|
-
:type status: List[str]
|
1084
|
-
:param limit:
|
1085
|
-
:type limit: int
|
1086
|
-
:param offset:
|
1087
|
-
:type offset: int
|
1088
|
-
:param sort: allow sorting by status, severity or created at, ascending (+) or the default descending (-)
|
1089
|
-
:type sort: str
|
1090
|
-
:param latest_per_model_version_only: only return latest result per model version
|
1091
|
-
:type latest_per_model_version_only: bool
|
970
|
+
:param scan_id: (required)
|
971
|
+
:type scan_id: str
|
972
|
+
:param file_id: (required)
|
973
|
+
:type file_id: str
|
1092
974
|
:param _request_timeout: timeout setting for this request. If one
|
1093
975
|
number provided, it will be total request
|
1094
976
|
timeout. It can also be a pair (tuple) of
|
@@ -1111,10 +993,721 @@ class ModelSupplyChainApi:
|
|
1111
993
|
:return: Returns the result object.
|
1112
994
|
""" # noqa: E501
|
1113
995
|
|
1114
|
-
_param = self.
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
996
|
+
_param = self._complete_multipart_file_upload_serialize(
|
997
|
+
scan_id=scan_id,
|
998
|
+
file_id=file_id,
|
999
|
+
_request_auth=_request_auth,
|
1000
|
+
_content_type=_content_type,
|
1001
|
+
_headers=_headers,
|
1002
|
+
_host_index=_host_index
|
1003
|
+
)
|
1004
|
+
|
1005
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1006
|
+
'200': "BeginMultiFileUpload200Response",
|
1007
|
+
'400': None,
|
1008
|
+
'422': "ValidationErrorModel",
|
1009
|
+
}
|
1010
|
+
response_data = self.api_client.call_api(
|
1011
|
+
*_param,
|
1012
|
+
_request_timeout=_request_timeout
|
1013
|
+
)
|
1014
|
+
response_data.read()
|
1015
|
+
return self.api_client.response_deserialize(
|
1016
|
+
response_data=response_data,
|
1017
|
+
response_types_map=_response_types_map,
|
1018
|
+
)
|
1019
|
+
|
1020
|
+
|
1021
|
+
@validate_call
|
1022
|
+
def complete_multipart_file_upload_without_preload_content(
|
1023
|
+
self,
|
1024
|
+
scan_id: StrictStr,
|
1025
|
+
file_id: StrictStr,
|
1026
|
+
_request_timeout: Union[
|
1027
|
+
None,
|
1028
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1029
|
+
Tuple[
|
1030
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1031
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1032
|
+
]
|
1033
|
+
] = None,
|
1034
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1035
|
+
_content_type: Optional[StrictStr] = None,
|
1036
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1037
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1038
|
+
) -> RESTResponseType:
|
1039
|
+
"""Indicate that upload is completed for {file_id}
|
1040
|
+
|
1041
|
+
|
1042
|
+
:param scan_id: (required)
|
1043
|
+
:type scan_id: str
|
1044
|
+
:param file_id: (required)
|
1045
|
+
:type file_id: str
|
1046
|
+
:param _request_timeout: timeout setting for this request. If one
|
1047
|
+
number provided, it will be total request
|
1048
|
+
timeout. It can also be a pair (tuple) of
|
1049
|
+
(connection, read) timeouts.
|
1050
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1051
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1052
|
+
request; this effectively ignores the
|
1053
|
+
authentication in the spec for a single request.
|
1054
|
+
:type _request_auth: dict, optional
|
1055
|
+
:param _content_type: force content-type for the request.
|
1056
|
+
:type _content_type: str, Optional
|
1057
|
+
:param _headers: set to override the headers for a single
|
1058
|
+
request; this effectively ignores the headers
|
1059
|
+
in the spec for a single request.
|
1060
|
+
:type _headers: dict, optional
|
1061
|
+
:param _host_index: set to override the host_index for a single
|
1062
|
+
request; this effectively ignores the host_index
|
1063
|
+
in the spec for a single request.
|
1064
|
+
:type _host_index: int, optional
|
1065
|
+
:return: Returns the result object.
|
1066
|
+
""" # noqa: E501
|
1067
|
+
|
1068
|
+
_param = self._complete_multipart_file_upload_serialize(
|
1069
|
+
scan_id=scan_id,
|
1070
|
+
file_id=file_id,
|
1071
|
+
_request_auth=_request_auth,
|
1072
|
+
_content_type=_content_type,
|
1073
|
+
_headers=_headers,
|
1074
|
+
_host_index=_host_index
|
1075
|
+
)
|
1076
|
+
|
1077
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1078
|
+
'200': "BeginMultiFileUpload200Response",
|
1079
|
+
'400': None,
|
1080
|
+
'422': "ValidationErrorModel",
|
1081
|
+
}
|
1082
|
+
response_data = self.api_client.call_api(
|
1083
|
+
*_param,
|
1084
|
+
_request_timeout=_request_timeout
|
1085
|
+
)
|
1086
|
+
return response_data.response
|
1087
|
+
|
1088
|
+
|
1089
|
+
def _complete_multipart_file_upload_serialize(
|
1090
|
+
self,
|
1091
|
+
scan_id,
|
1092
|
+
file_id,
|
1093
|
+
_request_auth,
|
1094
|
+
_content_type,
|
1095
|
+
_headers,
|
1096
|
+
_host_index,
|
1097
|
+
) -> RequestSerialized:
|
1098
|
+
|
1099
|
+
_host = None
|
1100
|
+
|
1101
|
+
_collection_formats: Dict[str, str] = {
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
_path_params: Dict[str, str] = {}
|
1105
|
+
_query_params: List[Tuple[str, str]] = []
|
1106
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1107
|
+
_form_params: List[Tuple[str, str]] = []
|
1108
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1109
|
+
_body_params: Optional[bytes] = None
|
1110
|
+
|
1111
|
+
# process the path parameters
|
1112
|
+
if scan_id is not None:
|
1113
|
+
_path_params['scan_id'] = scan_id
|
1114
|
+
if file_id is not None:
|
1115
|
+
_path_params['file_id'] = file_id
|
1116
|
+
# process the query parameters
|
1117
|
+
# process the header parameters
|
1118
|
+
# process the form parameters
|
1119
|
+
# process the body parameter
|
1120
|
+
|
1121
|
+
|
1122
|
+
# set the HTTP header `Accept`
|
1123
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1124
|
+
[
|
1125
|
+
'application/json'
|
1126
|
+
]
|
1127
|
+
)
|
1128
|
+
|
1129
|
+
|
1130
|
+
# authentication setting
|
1131
|
+
_auth_settings: List[str] = [
|
1132
|
+
'BearerAuth'
|
1133
|
+
]
|
1134
|
+
|
1135
|
+
return self.api_client.param_serialize(
|
1136
|
+
method='PATCH',
|
1137
|
+
resource_path='/scan/v3/upload/{scan_id}/file/{file_id}',
|
1138
|
+
path_params=_path_params,
|
1139
|
+
query_params=_query_params,
|
1140
|
+
header_params=_header_params,
|
1141
|
+
body=_body_params,
|
1142
|
+
post_params=_form_params,
|
1143
|
+
files=_files,
|
1144
|
+
auth_settings=_auth_settings,
|
1145
|
+
collection_formats=_collection_formats,
|
1146
|
+
_host=_host,
|
1147
|
+
_request_auth=_request_auth
|
1148
|
+
)
|
1149
|
+
|
1150
|
+
|
1151
|
+
|
1152
|
+
|
1153
|
+
@validate_call
|
1154
|
+
def create_scan_job(
|
1155
|
+
self,
|
1156
|
+
scan_job: Annotated[ScanJob, Field(description="Request body for create scan request")],
|
1157
|
+
_request_timeout: Union[
|
1158
|
+
None,
|
1159
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1160
|
+
Tuple[
|
1161
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1162
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1163
|
+
]
|
1164
|
+
] = None,
|
1165
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1166
|
+
_content_type: Optional[StrictStr] = None,
|
1167
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1168
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1169
|
+
) -> None:
|
1170
|
+
"""Request a Model Scan Job
|
1171
|
+
|
1172
|
+
|
1173
|
+
:param scan_job: Request body for create scan request (required)
|
1174
|
+
:type scan_job: ScanJob
|
1175
|
+
:param _request_timeout: timeout setting for this request. If one
|
1176
|
+
number provided, it will be total request
|
1177
|
+
timeout. It can also be a pair (tuple) of
|
1178
|
+
(connection, read) timeouts.
|
1179
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1180
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1181
|
+
request; this effectively ignores the
|
1182
|
+
authentication in the spec for a single request.
|
1183
|
+
:type _request_auth: dict, optional
|
1184
|
+
:param _content_type: force content-type for the request.
|
1185
|
+
:type _content_type: str, Optional
|
1186
|
+
:param _headers: set to override the headers for a single
|
1187
|
+
request; this effectively ignores the headers
|
1188
|
+
in the spec for a single request.
|
1189
|
+
:type _headers: dict, optional
|
1190
|
+
:param _host_index: set to override the host_index for a single
|
1191
|
+
request; this effectively ignores the host_index
|
1192
|
+
in the spec for a single request.
|
1193
|
+
:type _host_index: int, optional
|
1194
|
+
:return: Returns the result object.
|
1195
|
+
""" # noqa: E501
|
1196
|
+
|
1197
|
+
_param = self._create_scan_job_serialize(
|
1198
|
+
scan_job=scan_job,
|
1199
|
+
_request_auth=_request_auth,
|
1200
|
+
_content_type=_content_type,
|
1201
|
+
_headers=_headers,
|
1202
|
+
_host_index=_host_index
|
1203
|
+
)
|
1204
|
+
|
1205
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1206
|
+
'201': None,
|
1207
|
+
'400': None,
|
1208
|
+
'422': "ProblemDetails",
|
1209
|
+
}
|
1210
|
+
response_data = self.api_client.call_api(
|
1211
|
+
*_param,
|
1212
|
+
_request_timeout=_request_timeout
|
1213
|
+
)
|
1214
|
+
response_data.read()
|
1215
|
+
return self.api_client.response_deserialize(
|
1216
|
+
response_data=response_data,
|
1217
|
+
response_types_map=_response_types_map,
|
1218
|
+
).data
|
1219
|
+
|
1220
|
+
|
1221
|
+
@validate_call
|
1222
|
+
def create_scan_job_with_http_info(
|
1223
|
+
self,
|
1224
|
+
scan_job: Annotated[ScanJob, Field(description="Request body for create scan request")],
|
1225
|
+
_request_timeout: Union[
|
1226
|
+
None,
|
1227
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1228
|
+
Tuple[
|
1229
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1230
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1231
|
+
]
|
1232
|
+
] = None,
|
1233
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1234
|
+
_content_type: Optional[StrictStr] = None,
|
1235
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1236
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1237
|
+
) -> ApiResponse[None]:
|
1238
|
+
"""Request a Model Scan Job
|
1239
|
+
|
1240
|
+
|
1241
|
+
:param scan_job: Request body for create scan request (required)
|
1242
|
+
:type scan_job: ScanJob
|
1243
|
+
:param _request_timeout: timeout setting for this request. If one
|
1244
|
+
number provided, it will be total request
|
1245
|
+
timeout. It can also be a pair (tuple) of
|
1246
|
+
(connection, read) timeouts.
|
1247
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1248
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1249
|
+
request; this effectively ignores the
|
1250
|
+
authentication in the spec for a single request.
|
1251
|
+
:type _request_auth: dict, optional
|
1252
|
+
:param _content_type: force content-type for the request.
|
1253
|
+
:type _content_type: str, Optional
|
1254
|
+
:param _headers: set to override the headers for a single
|
1255
|
+
request; this effectively ignores the headers
|
1256
|
+
in the spec for a single request.
|
1257
|
+
:type _headers: dict, optional
|
1258
|
+
:param _host_index: set to override the host_index for a single
|
1259
|
+
request; this effectively ignores the host_index
|
1260
|
+
in the spec for a single request.
|
1261
|
+
:type _host_index: int, optional
|
1262
|
+
:return: Returns the result object.
|
1263
|
+
""" # noqa: E501
|
1264
|
+
|
1265
|
+
_param = self._create_scan_job_serialize(
|
1266
|
+
scan_job=scan_job,
|
1267
|
+
_request_auth=_request_auth,
|
1268
|
+
_content_type=_content_type,
|
1269
|
+
_headers=_headers,
|
1270
|
+
_host_index=_host_index
|
1271
|
+
)
|
1272
|
+
|
1273
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1274
|
+
'201': None,
|
1275
|
+
'400': None,
|
1276
|
+
'422': "ProblemDetails",
|
1277
|
+
}
|
1278
|
+
response_data = self.api_client.call_api(
|
1279
|
+
*_param,
|
1280
|
+
_request_timeout=_request_timeout
|
1281
|
+
)
|
1282
|
+
response_data.read()
|
1283
|
+
return self.api_client.response_deserialize(
|
1284
|
+
response_data=response_data,
|
1285
|
+
response_types_map=_response_types_map,
|
1286
|
+
)
|
1287
|
+
|
1288
|
+
|
1289
|
+
@validate_call
|
1290
|
+
def create_scan_job_without_preload_content(
|
1291
|
+
self,
|
1292
|
+
scan_job: Annotated[ScanJob, Field(description="Request body for create scan request")],
|
1293
|
+
_request_timeout: Union[
|
1294
|
+
None,
|
1295
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1296
|
+
Tuple[
|
1297
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1298
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1299
|
+
]
|
1300
|
+
] = None,
|
1301
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1302
|
+
_content_type: Optional[StrictStr] = None,
|
1303
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1304
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1305
|
+
) -> RESTResponseType:
|
1306
|
+
"""Request a Model Scan Job
|
1307
|
+
|
1308
|
+
|
1309
|
+
:param scan_job: Request body for create scan request (required)
|
1310
|
+
:type scan_job: ScanJob
|
1311
|
+
:param _request_timeout: timeout setting for this request. If one
|
1312
|
+
number provided, it will be total request
|
1313
|
+
timeout. It can also be a pair (tuple) of
|
1314
|
+
(connection, read) timeouts.
|
1315
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1316
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1317
|
+
request; this effectively ignores the
|
1318
|
+
authentication in the spec for a single request.
|
1319
|
+
:type _request_auth: dict, optional
|
1320
|
+
:param _content_type: force content-type for the request.
|
1321
|
+
:type _content_type: str, Optional
|
1322
|
+
:param _headers: set to override the headers for a single
|
1323
|
+
request; this effectively ignores the headers
|
1324
|
+
in the spec for a single request.
|
1325
|
+
:type _headers: dict, optional
|
1326
|
+
:param _host_index: set to override the host_index for a single
|
1327
|
+
request; this effectively ignores the host_index
|
1328
|
+
in the spec for a single request.
|
1329
|
+
:type _host_index: int, optional
|
1330
|
+
:return: Returns the result object.
|
1331
|
+
""" # noqa: E501
|
1332
|
+
|
1333
|
+
_param = self._create_scan_job_serialize(
|
1334
|
+
scan_job=scan_job,
|
1335
|
+
_request_auth=_request_auth,
|
1336
|
+
_content_type=_content_type,
|
1337
|
+
_headers=_headers,
|
1338
|
+
_host_index=_host_index
|
1339
|
+
)
|
1340
|
+
|
1341
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1342
|
+
'201': None,
|
1343
|
+
'400': None,
|
1344
|
+
'422': "ProblemDetails",
|
1345
|
+
}
|
1346
|
+
response_data = self.api_client.call_api(
|
1347
|
+
*_param,
|
1348
|
+
_request_timeout=_request_timeout
|
1349
|
+
)
|
1350
|
+
return response_data.response
|
1351
|
+
|
1352
|
+
|
1353
|
+
def _create_scan_job_serialize(
|
1354
|
+
self,
|
1355
|
+
scan_job,
|
1356
|
+
_request_auth,
|
1357
|
+
_content_type,
|
1358
|
+
_headers,
|
1359
|
+
_host_index,
|
1360
|
+
) -> RequestSerialized:
|
1361
|
+
|
1362
|
+
_host = None
|
1363
|
+
|
1364
|
+
_collection_formats: Dict[str, str] = {
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
_path_params: Dict[str, str] = {}
|
1368
|
+
_query_params: List[Tuple[str, str]] = []
|
1369
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1370
|
+
_form_params: List[Tuple[str, str]] = []
|
1371
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1372
|
+
_body_params: Optional[bytes] = None
|
1373
|
+
|
1374
|
+
# process the path parameters
|
1375
|
+
# process the query parameters
|
1376
|
+
# process the header parameters
|
1377
|
+
# process the form parameters
|
1378
|
+
# process the body parameter
|
1379
|
+
if scan_job is not None:
|
1380
|
+
_body_params = scan_job
|
1381
|
+
|
1382
|
+
|
1383
|
+
# set the HTTP header `Accept`
|
1384
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1385
|
+
[
|
1386
|
+
'application/json'
|
1387
|
+
]
|
1388
|
+
)
|
1389
|
+
|
1390
|
+
# set the HTTP header `Content-Type`
|
1391
|
+
if _content_type:
|
1392
|
+
_header_params['Content-Type'] = _content_type
|
1393
|
+
else:
|
1394
|
+
_default_content_type = (
|
1395
|
+
self.api_client.select_header_content_type(
|
1396
|
+
[
|
1397
|
+
'application/json; charset=utf-8',
|
1398
|
+
'application/octet-stream'
|
1399
|
+
]
|
1400
|
+
)
|
1401
|
+
)
|
1402
|
+
if _default_content_type is not None:
|
1403
|
+
_header_params['Content-Type'] = _default_content_type
|
1404
|
+
|
1405
|
+
# authentication setting
|
1406
|
+
_auth_settings: List[str] = [
|
1407
|
+
'BearerAuth'
|
1408
|
+
]
|
1409
|
+
|
1410
|
+
return self.api_client.param_serialize(
|
1411
|
+
method='POST',
|
1412
|
+
resource_path='/scans/v3/jobs',
|
1413
|
+
path_params=_path_params,
|
1414
|
+
query_params=_query_params,
|
1415
|
+
header_params=_header_params,
|
1416
|
+
body=_body_params,
|
1417
|
+
post_params=_form_params,
|
1418
|
+
files=_files,
|
1419
|
+
auth_settings=_auth_settings,
|
1420
|
+
collection_formats=_collection_formats,
|
1421
|
+
_host=_host,
|
1422
|
+
_request_auth=_request_auth
|
1423
|
+
)
|
1424
|
+
|
1425
|
+
|
1426
|
+
|
1427
|
+
|
1428
|
+
@validate_call
|
1429
|
+
def get_condensed_model_scan_reports(
|
1430
|
+
self,
|
1431
|
+
model_version_ids: Annotated[Optional[List[StrictStr]], Field(description="Model Version ID")] = None,
|
1432
|
+
model_ids: Annotated[Optional[List[StrictStr]], Field(description="Model ID")] = None,
|
1433
|
+
start_time: Annotated[Optional[datetime], Field(description="Start Time")] = None,
|
1434
|
+
end_time: Annotated[Optional[datetime], Field(description="End Time")] = None,
|
1435
|
+
severity: Annotated[Optional[List[StrictStr]], Field(description="Severities")] = None,
|
1436
|
+
status: Annotated[Optional[List[StrictStr]], Field(description="Statuses")] = None,
|
1437
|
+
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
|
1438
|
+
offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
|
1439
|
+
sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by status, severity or created at, ascending (+) or the default descending (-)")] = None,
|
1440
|
+
latest_per_model_version_only: Annotated[Optional[StrictBool], Field(description="only return latest result per model version")] = None,
|
1441
|
+
_request_timeout: Union[
|
1442
|
+
None,
|
1443
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1444
|
+
Tuple[
|
1445
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1446
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1447
|
+
]
|
1448
|
+
] = None,
|
1449
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1450
|
+
_content_type: Optional[StrictStr] = None,
|
1451
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1452
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1453
|
+
) -> GetCondensedModelScanReports200Response:
|
1454
|
+
"""Get condensed reports for a Model Scan
|
1455
|
+
|
1456
|
+
|
1457
|
+
:param model_version_ids: Model Version ID
|
1458
|
+
:type model_version_ids: List[str]
|
1459
|
+
:param model_ids: Model ID
|
1460
|
+
:type model_ids: List[str]
|
1461
|
+
:param start_time: Start Time
|
1462
|
+
:type start_time: datetime
|
1463
|
+
:param end_time: End Time
|
1464
|
+
:type end_time: datetime
|
1465
|
+
:param severity: Severities
|
1466
|
+
:type severity: List[str]
|
1467
|
+
:param status: Statuses
|
1468
|
+
:type status: List[str]
|
1469
|
+
:param limit:
|
1470
|
+
:type limit: int
|
1471
|
+
:param offset:
|
1472
|
+
:type offset: int
|
1473
|
+
:param sort: allow sorting by status, severity or created at, ascending (+) or the default descending (-)
|
1474
|
+
:type sort: str
|
1475
|
+
:param latest_per_model_version_only: only return latest result per model version
|
1476
|
+
:type latest_per_model_version_only: bool
|
1477
|
+
:param _request_timeout: timeout setting for this request. If one
|
1478
|
+
number provided, it will be total request
|
1479
|
+
timeout. It can also be a pair (tuple) of
|
1480
|
+
(connection, read) timeouts.
|
1481
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1482
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1483
|
+
request; this effectively ignores the
|
1484
|
+
authentication in the spec for a single request.
|
1485
|
+
:type _request_auth: dict, optional
|
1486
|
+
:param _content_type: force content-type for the request.
|
1487
|
+
:type _content_type: str, Optional
|
1488
|
+
:param _headers: set to override the headers for a single
|
1489
|
+
request; this effectively ignores the headers
|
1490
|
+
in the spec for a single request.
|
1491
|
+
:type _headers: dict, optional
|
1492
|
+
:param _host_index: set to override the host_index for a single
|
1493
|
+
request; this effectively ignores the host_index
|
1494
|
+
in the spec for a single request.
|
1495
|
+
:type _host_index: int, optional
|
1496
|
+
:return: Returns the result object.
|
1497
|
+
""" # noqa: E501
|
1498
|
+
|
1499
|
+
_param = self._get_condensed_model_scan_reports_serialize(
|
1500
|
+
model_version_ids=model_version_ids,
|
1501
|
+
model_ids=model_ids,
|
1502
|
+
start_time=start_time,
|
1503
|
+
end_time=end_time,
|
1504
|
+
severity=severity,
|
1505
|
+
status=status,
|
1506
|
+
limit=limit,
|
1507
|
+
offset=offset,
|
1508
|
+
sort=sort,
|
1509
|
+
latest_per_model_version_only=latest_per_model_version_only,
|
1510
|
+
_request_auth=_request_auth,
|
1511
|
+
_content_type=_content_type,
|
1512
|
+
_headers=_headers,
|
1513
|
+
_host_index=_host_index
|
1514
|
+
)
|
1515
|
+
|
1516
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1517
|
+
'200': "GetCondensedModelScanReports200Response",
|
1518
|
+
'400': None,
|
1519
|
+
'404': None,
|
1520
|
+
}
|
1521
|
+
response_data = self.api_client.call_api(
|
1522
|
+
*_param,
|
1523
|
+
_request_timeout=_request_timeout
|
1524
|
+
)
|
1525
|
+
response_data.read()
|
1526
|
+
return self.api_client.response_deserialize(
|
1527
|
+
response_data=response_data,
|
1528
|
+
response_types_map=_response_types_map,
|
1529
|
+
).data
|
1530
|
+
|
1531
|
+
|
1532
|
+
@validate_call
|
1533
|
+
def get_condensed_model_scan_reports_with_http_info(
|
1534
|
+
self,
|
1535
|
+
model_version_ids: Annotated[Optional[List[StrictStr]], Field(description="Model Version ID")] = None,
|
1536
|
+
model_ids: Annotated[Optional[List[StrictStr]], Field(description="Model ID")] = None,
|
1537
|
+
start_time: Annotated[Optional[datetime], Field(description="Start Time")] = None,
|
1538
|
+
end_time: Annotated[Optional[datetime], Field(description="End Time")] = None,
|
1539
|
+
severity: Annotated[Optional[List[StrictStr]], Field(description="Severities")] = None,
|
1540
|
+
status: Annotated[Optional[List[StrictStr]], Field(description="Statuses")] = None,
|
1541
|
+
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
|
1542
|
+
offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
|
1543
|
+
sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by status, severity or created at, ascending (+) or the default descending (-)")] = None,
|
1544
|
+
latest_per_model_version_only: Annotated[Optional[StrictBool], Field(description="only return latest result per model version")] = None,
|
1545
|
+
_request_timeout: Union[
|
1546
|
+
None,
|
1547
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1548
|
+
Tuple[
|
1549
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1550
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1551
|
+
]
|
1552
|
+
] = None,
|
1553
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1554
|
+
_content_type: Optional[StrictStr] = None,
|
1555
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1556
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1557
|
+
) -> ApiResponse[GetCondensedModelScanReports200Response]:
|
1558
|
+
"""Get condensed reports for a Model Scan
|
1559
|
+
|
1560
|
+
|
1561
|
+
:param model_version_ids: Model Version ID
|
1562
|
+
:type model_version_ids: List[str]
|
1563
|
+
:param model_ids: Model ID
|
1564
|
+
:type model_ids: List[str]
|
1565
|
+
:param start_time: Start Time
|
1566
|
+
:type start_time: datetime
|
1567
|
+
:param end_time: End Time
|
1568
|
+
:type end_time: datetime
|
1569
|
+
:param severity: Severities
|
1570
|
+
:type severity: List[str]
|
1571
|
+
:param status: Statuses
|
1572
|
+
:type status: List[str]
|
1573
|
+
:param limit:
|
1574
|
+
:type limit: int
|
1575
|
+
:param offset:
|
1576
|
+
:type offset: int
|
1577
|
+
:param sort: allow sorting by status, severity or created at, ascending (+) or the default descending (-)
|
1578
|
+
:type sort: str
|
1579
|
+
:param latest_per_model_version_only: only return latest result per model version
|
1580
|
+
:type latest_per_model_version_only: bool
|
1581
|
+
:param _request_timeout: timeout setting for this request. If one
|
1582
|
+
number provided, it will be total request
|
1583
|
+
timeout. It can also be a pair (tuple) of
|
1584
|
+
(connection, read) timeouts.
|
1585
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1586
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1587
|
+
request; this effectively ignores the
|
1588
|
+
authentication in the spec for a single request.
|
1589
|
+
:type _request_auth: dict, optional
|
1590
|
+
:param _content_type: force content-type for the request.
|
1591
|
+
:type _content_type: str, Optional
|
1592
|
+
:param _headers: set to override the headers for a single
|
1593
|
+
request; this effectively ignores the headers
|
1594
|
+
in the spec for a single request.
|
1595
|
+
:type _headers: dict, optional
|
1596
|
+
:param _host_index: set to override the host_index for a single
|
1597
|
+
request; this effectively ignores the host_index
|
1598
|
+
in the spec for a single request.
|
1599
|
+
:type _host_index: int, optional
|
1600
|
+
:return: Returns the result object.
|
1601
|
+
""" # noqa: E501
|
1602
|
+
|
1603
|
+
_param = self._get_condensed_model_scan_reports_serialize(
|
1604
|
+
model_version_ids=model_version_ids,
|
1605
|
+
model_ids=model_ids,
|
1606
|
+
start_time=start_time,
|
1607
|
+
end_time=end_time,
|
1608
|
+
severity=severity,
|
1609
|
+
status=status,
|
1610
|
+
limit=limit,
|
1611
|
+
offset=offset,
|
1612
|
+
sort=sort,
|
1613
|
+
latest_per_model_version_only=latest_per_model_version_only,
|
1614
|
+
_request_auth=_request_auth,
|
1615
|
+
_content_type=_content_type,
|
1616
|
+
_headers=_headers,
|
1617
|
+
_host_index=_host_index
|
1618
|
+
)
|
1619
|
+
|
1620
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1621
|
+
'200': "GetCondensedModelScanReports200Response",
|
1622
|
+
'400': None,
|
1623
|
+
'404': None,
|
1624
|
+
}
|
1625
|
+
response_data = self.api_client.call_api(
|
1626
|
+
*_param,
|
1627
|
+
_request_timeout=_request_timeout
|
1628
|
+
)
|
1629
|
+
response_data.read()
|
1630
|
+
return self.api_client.response_deserialize(
|
1631
|
+
response_data=response_data,
|
1632
|
+
response_types_map=_response_types_map,
|
1633
|
+
)
|
1634
|
+
|
1635
|
+
|
1636
|
+
@validate_call
|
1637
|
+
def get_condensed_model_scan_reports_without_preload_content(
|
1638
|
+
self,
|
1639
|
+
model_version_ids: Annotated[Optional[List[StrictStr]], Field(description="Model Version ID")] = None,
|
1640
|
+
model_ids: Annotated[Optional[List[StrictStr]], Field(description="Model ID")] = None,
|
1641
|
+
start_time: Annotated[Optional[datetime], Field(description="Start Time")] = None,
|
1642
|
+
end_time: Annotated[Optional[datetime], Field(description="End Time")] = None,
|
1643
|
+
severity: Annotated[Optional[List[StrictStr]], Field(description="Severities")] = None,
|
1644
|
+
status: Annotated[Optional[List[StrictStr]], Field(description="Statuses")] = None,
|
1645
|
+
limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
|
1646
|
+
offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
|
1647
|
+
sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by status, severity or created at, ascending (+) or the default descending (-)")] = None,
|
1648
|
+
latest_per_model_version_only: Annotated[Optional[StrictBool], Field(description="only return latest result per model version")] = None,
|
1649
|
+
_request_timeout: Union[
|
1650
|
+
None,
|
1651
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1652
|
+
Tuple[
|
1653
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1654
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1655
|
+
]
|
1656
|
+
] = None,
|
1657
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1658
|
+
_content_type: Optional[StrictStr] = None,
|
1659
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1660
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1661
|
+
) -> RESTResponseType:
|
1662
|
+
"""Get condensed reports for a Model Scan
|
1663
|
+
|
1664
|
+
|
1665
|
+
:param model_version_ids: Model Version ID
|
1666
|
+
:type model_version_ids: List[str]
|
1667
|
+
:param model_ids: Model ID
|
1668
|
+
:type model_ids: List[str]
|
1669
|
+
:param start_time: Start Time
|
1670
|
+
:type start_time: datetime
|
1671
|
+
:param end_time: End Time
|
1672
|
+
:type end_time: datetime
|
1673
|
+
:param severity: Severities
|
1674
|
+
:type severity: List[str]
|
1675
|
+
:param status: Statuses
|
1676
|
+
:type status: List[str]
|
1677
|
+
:param limit:
|
1678
|
+
:type limit: int
|
1679
|
+
:param offset:
|
1680
|
+
:type offset: int
|
1681
|
+
:param sort: allow sorting by status, severity or created at, ascending (+) or the default descending (-)
|
1682
|
+
:type sort: str
|
1683
|
+
:param latest_per_model_version_only: only return latest result per model version
|
1684
|
+
:type latest_per_model_version_only: bool
|
1685
|
+
:param _request_timeout: timeout setting for this request. If one
|
1686
|
+
number provided, it will be total request
|
1687
|
+
timeout. It can also be a pair (tuple) of
|
1688
|
+
(connection, read) timeouts.
|
1689
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1690
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1691
|
+
request; this effectively ignores the
|
1692
|
+
authentication in the spec for a single request.
|
1693
|
+
:type _request_auth: dict, optional
|
1694
|
+
:param _content_type: force content-type for the request.
|
1695
|
+
:type _content_type: str, Optional
|
1696
|
+
:param _headers: set to override the headers for a single
|
1697
|
+
request; this effectively ignores the headers
|
1698
|
+
in the spec for a single request.
|
1699
|
+
:type _headers: dict, optional
|
1700
|
+
:param _host_index: set to override the host_index for a single
|
1701
|
+
request; this effectively ignores the host_index
|
1702
|
+
in the spec for a single request.
|
1703
|
+
:type _host_index: int, optional
|
1704
|
+
:return: Returns the result object.
|
1705
|
+
""" # noqa: E501
|
1706
|
+
|
1707
|
+
_param = self._get_condensed_model_scan_reports_serialize(
|
1708
|
+
model_version_ids=model_version_ids,
|
1709
|
+
model_ids=model_ids,
|
1710
|
+
start_time=start_time,
|
1118
1711
|
end_time=end_time,
|
1119
1712
|
severity=severity,
|
1120
1713
|
status=status,
|
@@ -1129,7 +1722,451 @@ class ModelSupplyChainApi:
|
|
1129
1722
|
)
|
1130
1723
|
|
1131
1724
|
_response_types_map: Dict[str, Optional[str]] = {
|
1132
|
-
'200': "
|
1725
|
+
'200': "GetCondensedModelScanReports200Response",
|
1726
|
+
'400': None,
|
1727
|
+
'404': None,
|
1728
|
+
}
|
1729
|
+
response_data = self.api_client.call_api(
|
1730
|
+
*_param,
|
1731
|
+
_request_timeout=_request_timeout
|
1732
|
+
)
|
1733
|
+
return response_data.response
|
1734
|
+
|
1735
|
+
|
1736
|
+
def _get_condensed_model_scan_reports_serialize(
|
1737
|
+
self,
|
1738
|
+
model_version_ids,
|
1739
|
+
model_ids,
|
1740
|
+
start_time,
|
1741
|
+
end_time,
|
1742
|
+
severity,
|
1743
|
+
status,
|
1744
|
+
limit,
|
1745
|
+
offset,
|
1746
|
+
sort,
|
1747
|
+
latest_per_model_version_only,
|
1748
|
+
_request_auth,
|
1749
|
+
_content_type,
|
1750
|
+
_headers,
|
1751
|
+
_host_index,
|
1752
|
+
) -> RequestSerialized:
|
1753
|
+
|
1754
|
+
_host = None
|
1755
|
+
|
1756
|
+
_collection_formats: Dict[str, str] = {
|
1757
|
+
'model_version_ids': 'csv',
|
1758
|
+
'model_ids': 'csv',
|
1759
|
+
'severity': 'csv',
|
1760
|
+
'status': 'csv',
|
1761
|
+
}
|
1762
|
+
|
1763
|
+
_path_params: Dict[str, str] = {}
|
1764
|
+
_query_params: List[Tuple[str, str]] = []
|
1765
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1766
|
+
_form_params: List[Tuple[str, str]] = []
|
1767
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1768
|
+
_body_params: Optional[bytes] = None
|
1769
|
+
|
1770
|
+
# process the path parameters
|
1771
|
+
# process the query parameters
|
1772
|
+
if model_version_ids is not None:
|
1773
|
+
|
1774
|
+
_query_params.append(('model_version_ids', model_version_ids))
|
1775
|
+
|
1776
|
+
if model_ids is not None:
|
1777
|
+
|
1778
|
+
_query_params.append(('model_ids', model_ids))
|
1779
|
+
|
1780
|
+
if start_time is not None:
|
1781
|
+
if isinstance(start_time, datetime):
|
1782
|
+
_query_params.append(
|
1783
|
+
(
|
1784
|
+
'start_time',
|
1785
|
+
start_time.strftime(
|
1786
|
+
self.api_client.configuration.datetime_format
|
1787
|
+
)
|
1788
|
+
)
|
1789
|
+
)
|
1790
|
+
else:
|
1791
|
+
_query_params.append(('start_time', start_time))
|
1792
|
+
|
1793
|
+
if end_time is not None:
|
1794
|
+
if isinstance(end_time, datetime):
|
1795
|
+
_query_params.append(
|
1796
|
+
(
|
1797
|
+
'end_time',
|
1798
|
+
end_time.strftime(
|
1799
|
+
self.api_client.configuration.datetime_format
|
1800
|
+
)
|
1801
|
+
)
|
1802
|
+
)
|
1803
|
+
else:
|
1804
|
+
_query_params.append(('end_time', end_time))
|
1805
|
+
|
1806
|
+
if severity is not None:
|
1807
|
+
|
1808
|
+
_query_params.append(('severity', severity))
|
1809
|
+
|
1810
|
+
if status is not None:
|
1811
|
+
|
1812
|
+
_query_params.append(('status', status))
|
1813
|
+
|
1814
|
+
if limit is not None:
|
1815
|
+
|
1816
|
+
_query_params.append(('limit', limit))
|
1817
|
+
|
1818
|
+
if offset is not None:
|
1819
|
+
|
1820
|
+
_query_params.append(('offset', offset))
|
1821
|
+
|
1822
|
+
if sort is not None:
|
1823
|
+
|
1824
|
+
_query_params.append(('sort', sort))
|
1825
|
+
|
1826
|
+
if latest_per_model_version_only is not None:
|
1827
|
+
|
1828
|
+
_query_params.append(('latest_per_model_version_only', latest_per_model_version_only))
|
1829
|
+
|
1830
|
+
# process the header parameters
|
1831
|
+
# process the form parameters
|
1832
|
+
# process the body parameter
|
1833
|
+
|
1834
|
+
|
1835
|
+
# set the HTTP header `Accept`
|
1836
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1837
|
+
[
|
1838
|
+
'application/json; charset=utf-8'
|
1839
|
+
]
|
1840
|
+
)
|
1841
|
+
|
1842
|
+
|
1843
|
+
# authentication setting
|
1844
|
+
_auth_settings: List[str] = [
|
1845
|
+
'BearerAuth'
|
1846
|
+
]
|
1847
|
+
|
1848
|
+
return self.api_client.param_serialize(
|
1849
|
+
method='GET',
|
1850
|
+
resource_path='/scan/v3/results',
|
1851
|
+
path_params=_path_params,
|
1852
|
+
query_params=_query_params,
|
1853
|
+
header_params=_header_params,
|
1854
|
+
body=_body_params,
|
1855
|
+
post_params=_form_params,
|
1856
|
+
files=_files,
|
1857
|
+
auth_settings=_auth_settings,
|
1858
|
+
collection_formats=_collection_formats,
|
1859
|
+
_host=_host,
|
1860
|
+
_request_auth=_request_auth
|
1861
|
+
)
|
1862
|
+
|
1863
|
+
|
1864
|
+
|
1865
|
+
|
1866
|
+
@validate_call
|
1867
|
+
def get_scan_jobs(
|
1868
|
+
self,
|
1869
|
+
_request_timeout: Union[
|
1870
|
+
None,
|
1871
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1872
|
+
Tuple[
|
1873
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1874
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1875
|
+
]
|
1876
|
+
] = None,
|
1877
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1878
|
+
_content_type: Optional[StrictStr] = None,
|
1879
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1880
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1881
|
+
) -> List[ScanJob]:
|
1882
|
+
"""List all Model Scan Jobs
|
1883
|
+
|
1884
|
+
|
1885
|
+
:param _request_timeout: timeout setting for this request. If one
|
1886
|
+
number provided, it will be total request
|
1887
|
+
timeout. It can also be a pair (tuple) of
|
1888
|
+
(connection, read) timeouts.
|
1889
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1890
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1891
|
+
request; this effectively ignores the
|
1892
|
+
authentication in the spec for a single request.
|
1893
|
+
:type _request_auth: dict, optional
|
1894
|
+
:param _content_type: force content-type for the request.
|
1895
|
+
:type _content_type: str, Optional
|
1896
|
+
:param _headers: set to override the headers for a single
|
1897
|
+
request; this effectively ignores the headers
|
1898
|
+
in the spec for a single request.
|
1899
|
+
:type _headers: dict, optional
|
1900
|
+
:param _host_index: set to override the host_index for a single
|
1901
|
+
request; this effectively ignores the host_index
|
1902
|
+
in the spec for a single request.
|
1903
|
+
:type _host_index: int, optional
|
1904
|
+
:return: Returns the result object.
|
1905
|
+
""" # noqa: E501
|
1906
|
+
|
1907
|
+
_param = self._get_scan_jobs_serialize(
|
1908
|
+
_request_auth=_request_auth,
|
1909
|
+
_content_type=_content_type,
|
1910
|
+
_headers=_headers,
|
1911
|
+
_host_index=_host_index
|
1912
|
+
)
|
1913
|
+
|
1914
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1915
|
+
'200': "List[ScanJob]",
|
1916
|
+
'400': None,
|
1917
|
+
'404': None,
|
1918
|
+
}
|
1919
|
+
response_data = self.api_client.call_api(
|
1920
|
+
*_param,
|
1921
|
+
_request_timeout=_request_timeout
|
1922
|
+
)
|
1923
|
+
response_data.read()
|
1924
|
+
return self.api_client.response_deserialize(
|
1925
|
+
response_data=response_data,
|
1926
|
+
response_types_map=_response_types_map,
|
1927
|
+
).data
|
1928
|
+
|
1929
|
+
|
1930
|
+
@validate_call
|
1931
|
+
def get_scan_jobs_with_http_info(
|
1932
|
+
self,
|
1933
|
+
_request_timeout: Union[
|
1934
|
+
None,
|
1935
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1936
|
+
Tuple[
|
1937
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1938
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1939
|
+
]
|
1940
|
+
] = None,
|
1941
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1942
|
+
_content_type: Optional[StrictStr] = None,
|
1943
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1944
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1945
|
+
) -> ApiResponse[List[ScanJob]]:
|
1946
|
+
"""List all Model Scan Jobs
|
1947
|
+
|
1948
|
+
|
1949
|
+
:param _request_timeout: timeout setting for this request. If one
|
1950
|
+
number provided, it will be total request
|
1951
|
+
timeout. It can also be a pair (tuple) of
|
1952
|
+
(connection, read) timeouts.
|
1953
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1954
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1955
|
+
request; this effectively ignores the
|
1956
|
+
authentication in the spec for a single request.
|
1957
|
+
:type _request_auth: dict, optional
|
1958
|
+
:param _content_type: force content-type for the request.
|
1959
|
+
:type _content_type: str, Optional
|
1960
|
+
:param _headers: set to override the headers for a single
|
1961
|
+
request; this effectively ignores the headers
|
1962
|
+
in the spec for a single request.
|
1963
|
+
:type _headers: dict, optional
|
1964
|
+
:param _host_index: set to override the host_index for a single
|
1965
|
+
request; this effectively ignores the host_index
|
1966
|
+
in the spec for a single request.
|
1967
|
+
:type _host_index: int, optional
|
1968
|
+
:return: Returns the result object.
|
1969
|
+
""" # noqa: E501
|
1970
|
+
|
1971
|
+
_param = self._get_scan_jobs_serialize(
|
1972
|
+
_request_auth=_request_auth,
|
1973
|
+
_content_type=_content_type,
|
1974
|
+
_headers=_headers,
|
1975
|
+
_host_index=_host_index
|
1976
|
+
)
|
1977
|
+
|
1978
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1979
|
+
'200': "List[ScanJob]",
|
1980
|
+
'400': None,
|
1981
|
+
'404': None,
|
1982
|
+
}
|
1983
|
+
response_data = self.api_client.call_api(
|
1984
|
+
*_param,
|
1985
|
+
_request_timeout=_request_timeout
|
1986
|
+
)
|
1987
|
+
response_data.read()
|
1988
|
+
return self.api_client.response_deserialize(
|
1989
|
+
response_data=response_data,
|
1990
|
+
response_types_map=_response_types_map,
|
1991
|
+
)
|
1992
|
+
|
1993
|
+
|
1994
|
+
@validate_call
|
1995
|
+
def get_scan_jobs_without_preload_content(
|
1996
|
+
self,
|
1997
|
+
_request_timeout: Union[
|
1998
|
+
None,
|
1999
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2000
|
+
Tuple[
|
2001
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2002
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2003
|
+
]
|
2004
|
+
] = None,
|
2005
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2006
|
+
_content_type: Optional[StrictStr] = None,
|
2007
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2008
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2009
|
+
) -> RESTResponseType:
|
2010
|
+
"""List all Model Scan Jobs
|
2011
|
+
|
2012
|
+
|
2013
|
+
:param _request_timeout: timeout setting for this request. If one
|
2014
|
+
number provided, it will be total request
|
2015
|
+
timeout. It can also be a pair (tuple) of
|
2016
|
+
(connection, read) timeouts.
|
2017
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2018
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2019
|
+
request; this effectively ignores the
|
2020
|
+
authentication in the spec for a single request.
|
2021
|
+
:type _request_auth: dict, optional
|
2022
|
+
:param _content_type: force content-type for the request.
|
2023
|
+
:type _content_type: str, Optional
|
2024
|
+
:param _headers: set to override the headers for a single
|
2025
|
+
request; this effectively ignores the headers
|
2026
|
+
in the spec for a single request.
|
2027
|
+
:type _headers: dict, optional
|
2028
|
+
:param _host_index: set to override the host_index for a single
|
2029
|
+
request; this effectively ignores the host_index
|
2030
|
+
in the spec for a single request.
|
2031
|
+
:type _host_index: int, optional
|
2032
|
+
:return: Returns the result object.
|
2033
|
+
""" # noqa: E501
|
2034
|
+
|
2035
|
+
_param = self._get_scan_jobs_serialize(
|
2036
|
+
_request_auth=_request_auth,
|
2037
|
+
_content_type=_content_type,
|
2038
|
+
_headers=_headers,
|
2039
|
+
_host_index=_host_index
|
2040
|
+
)
|
2041
|
+
|
2042
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2043
|
+
'200': "List[ScanJob]",
|
2044
|
+
'400': None,
|
2045
|
+
'404': None,
|
2046
|
+
}
|
2047
|
+
response_data = self.api_client.call_api(
|
2048
|
+
*_param,
|
2049
|
+
_request_timeout=_request_timeout
|
2050
|
+
)
|
2051
|
+
return response_data.response
|
2052
|
+
|
2053
|
+
|
2054
|
+
def _get_scan_jobs_serialize(
|
2055
|
+
self,
|
2056
|
+
_request_auth,
|
2057
|
+
_content_type,
|
2058
|
+
_headers,
|
2059
|
+
_host_index,
|
2060
|
+
) -> RequestSerialized:
|
2061
|
+
|
2062
|
+
_host = None
|
2063
|
+
|
2064
|
+
_collection_formats: Dict[str, str] = {
|
2065
|
+
}
|
2066
|
+
|
2067
|
+
_path_params: Dict[str, str] = {}
|
2068
|
+
_query_params: List[Tuple[str, str]] = []
|
2069
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
2070
|
+
_form_params: List[Tuple[str, str]] = []
|
2071
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
2072
|
+
_body_params: Optional[bytes] = None
|
2073
|
+
|
2074
|
+
# process the path parameters
|
2075
|
+
# process the query parameters
|
2076
|
+
# process the header parameters
|
2077
|
+
# process the form parameters
|
2078
|
+
# process the body parameter
|
2079
|
+
|
2080
|
+
|
2081
|
+
# set the HTTP header `Accept`
|
2082
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
2083
|
+
[
|
2084
|
+
'application/json; charset=utf-8'
|
2085
|
+
]
|
2086
|
+
)
|
2087
|
+
|
2088
|
+
|
2089
|
+
# authentication setting
|
2090
|
+
_auth_settings: List[str] = [
|
2091
|
+
'BearerAuth'
|
2092
|
+
]
|
2093
|
+
|
2094
|
+
return self.api_client.param_serialize(
|
2095
|
+
method='GET',
|
2096
|
+
resource_path='/scans/v3/jobs',
|
2097
|
+
path_params=_path_params,
|
2098
|
+
query_params=_query_params,
|
2099
|
+
header_params=_header_params,
|
2100
|
+
body=_body_params,
|
2101
|
+
post_params=_form_params,
|
2102
|
+
files=_files,
|
2103
|
+
auth_settings=_auth_settings,
|
2104
|
+
collection_formats=_collection_formats,
|
2105
|
+
_host=_host,
|
2106
|
+
_request_auth=_request_auth
|
2107
|
+
)
|
2108
|
+
|
2109
|
+
|
2110
|
+
|
2111
|
+
|
2112
|
+
@validate_call
|
2113
|
+
def get_scan_results(
|
2114
|
+
self,
|
2115
|
+
scan_id: StrictStr,
|
2116
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2117
|
+
_request_timeout: Union[
|
2118
|
+
None,
|
2119
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2120
|
+
Tuple[
|
2121
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2122
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2123
|
+
]
|
2124
|
+
] = None,
|
2125
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2126
|
+
_content_type: Optional[StrictStr] = None,
|
2127
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2128
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2129
|
+
) -> ScanReportV3:
|
2130
|
+
"""Get Result of a Model Scan
|
2131
|
+
|
2132
|
+
|
2133
|
+
:param scan_id: (required)
|
2134
|
+
:type scan_id: str
|
2135
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
2136
|
+
:type has_detections: bool
|
2137
|
+
:param _request_timeout: timeout setting for this request. If one
|
2138
|
+
number provided, it will be total request
|
2139
|
+
timeout. It can also be a pair (tuple) of
|
2140
|
+
(connection, read) timeouts.
|
2141
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2142
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2143
|
+
request; this effectively ignores the
|
2144
|
+
authentication in the spec for a single request.
|
2145
|
+
:type _request_auth: dict, optional
|
2146
|
+
:param _content_type: force content-type for the request.
|
2147
|
+
:type _content_type: str, Optional
|
2148
|
+
:param _headers: set to override the headers for a single
|
2149
|
+
request; this effectively ignores the headers
|
2150
|
+
in the spec for a single request.
|
2151
|
+
:type _headers: dict, optional
|
2152
|
+
:param _host_index: set to override the host_index for a single
|
2153
|
+
request; this effectively ignores the host_index
|
2154
|
+
in the spec for a single request.
|
2155
|
+
:type _host_index: int, optional
|
2156
|
+
:return: Returns the result object.
|
2157
|
+
""" # noqa: E501
|
2158
|
+
|
2159
|
+
_param = self._get_scan_results_serialize(
|
2160
|
+
scan_id=scan_id,
|
2161
|
+
has_detections=has_detections,
|
2162
|
+
_request_auth=_request_auth,
|
2163
|
+
_content_type=_content_type,
|
2164
|
+
_headers=_headers,
|
2165
|
+
_host_index=_host_index
|
2166
|
+
)
|
2167
|
+
|
2168
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2169
|
+
'200': "ScanReportV3",
|
1133
2170
|
'400': None,
|
1134
2171
|
'404': None,
|
1135
2172
|
}
|
@@ -1141,22 +2178,86 @@ class ModelSupplyChainApi:
|
|
1141
2178
|
return self.api_client.response_deserialize(
|
1142
2179
|
response_data=response_data,
|
1143
2180
|
response_types_map=_response_types_map,
|
1144
|
-
)
|
2181
|
+
).data
|
1145
2182
|
|
1146
2183
|
|
1147
2184
|
@validate_call
|
1148
|
-
def
|
2185
|
+
def get_scan_results_with_http_info(
|
1149
2186
|
self,
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
2187
|
+
scan_id: StrictStr,
|
2188
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2189
|
+
_request_timeout: Union[
|
2190
|
+
None,
|
2191
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2192
|
+
Tuple[
|
2193
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2194
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2195
|
+
]
|
2196
|
+
] = None,
|
2197
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2198
|
+
_content_type: Optional[StrictStr] = None,
|
2199
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2200
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2201
|
+
) -> ApiResponse[ScanReportV3]:
|
2202
|
+
"""Get Result of a Model Scan
|
2203
|
+
|
2204
|
+
|
2205
|
+
:param scan_id: (required)
|
2206
|
+
:type scan_id: str
|
2207
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
2208
|
+
:type has_detections: bool
|
2209
|
+
:param _request_timeout: timeout setting for this request. If one
|
2210
|
+
number provided, it will be total request
|
2211
|
+
timeout. It can also be a pair (tuple) of
|
2212
|
+
(connection, read) timeouts.
|
2213
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2214
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2215
|
+
request; this effectively ignores the
|
2216
|
+
authentication in the spec for a single request.
|
2217
|
+
:type _request_auth: dict, optional
|
2218
|
+
:param _content_type: force content-type for the request.
|
2219
|
+
:type _content_type: str, Optional
|
2220
|
+
:param _headers: set to override the headers for a single
|
2221
|
+
request; this effectively ignores the headers
|
2222
|
+
in the spec for a single request.
|
2223
|
+
:type _headers: dict, optional
|
2224
|
+
:param _host_index: set to override the host_index for a single
|
2225
|
+
request; this effectively ignores the host_index
|
2226
|
+
in the spec for a single request.
|
2227
|
+
:type _host_index: int, optional
|
2228
|
+
:return: Returns the result object.
|
2229
|
+
""" # noqa: E501
|
2230
|
+
|
2231
|
+
_param = self._get_scan_results_serialize(
|
2232
|
+
scan_id=scan_id,
|
2233
|
+
has_detections=has_detections,
|
2234
|
+
_request_auth=_request_auth,
|
2235
|
+
_content_type=_content_type,
|
2236
|
+
_headers=_headers,
|
2237
|
+
_host_index=_host_index
|
2238
|
+
)
|
2239
|
+
|
2240
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2241
|
+
'200': "ScanReportV3",
|
2242
|
+
'400': None,
|
2243
|
+
'404': None,
|
2244
|
+
}
|
2245
|
+
response_data = self.api_client.call_api(
|
2246
|
+
*_param,
|
2247
|
+
_request_timeout=_request_timeout
|
2248
|
+
)
|
2249
|
+
response_data.read()
|
2250
|
+
return self.api_client.response_deserialize(
|
2251
|
+
response_data=response_data,
|
2252
|
+
response_types_map=_response_types_map,
|
2253
|
+
)
|
2254
|
+
|
2255
|
+
|
2256
|
+
@validate_call
|
2257
|
+
def get_scan_results_without_preload_content(
|
2258
|
+
self,
|
2259
|
+
scan_id: StrictStr,
|
2260
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
1160
2261
|
_request_timeout: Union[
|
1161
2262
|
None,
|
1162
2263
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1170,29 +2271,13 @@ class ModelSupplyChainApi:
|
|
1170
2271
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1171
2272
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1172
2273
|
) -> RESTResponseType:
|
1173
|
-
"""Get
|
2274
|
+
"""Get Result of a Model Scan
|
1174
2275
|
|
1175
2276
|
|
1176
|
-
:param
|
1177
|
-
:type
|
1178
|
-
:param
|
1179
|
-
:type
|
1180
|
-
:param start_time: Start Time
|
1181
|
-
:type start_time: datetime
|
1182
|
-
:param end_time: End Time
|
1183
|
-
:type end_time: datetime
|
1184
|
-
:param severity: Severities
|
1185
|
-
:type severity: List[str]
|
1186
|
-
:param status: Statuses
|
1187
|
-
:type status: List[str]
|
1188
|
-
:param limit:
|
1189
|
-
:type limit: int
|
1190
|
-
:param offset:
|
1191
|
-
:type offset: int
|
1192
|
-
:param sort: allow sorting by status, severity or created at, ascending (+) or the default descending (-)
|
1193
|
-
:type sort: str
|
1194
|
-
:param latest_per_model_version_only: only return latest result per model version
|
1195
|
-
:type latest_per_model_version_only: bool
|
2277
|
+
:param scan_id: (required)
|
2278
|
+
:type scan_id: str
|
2279
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
2280
|
+
:type has_detections: bool
|
1196
2281
|
:param _request_timeout: timeout setting for this request. If one
|
1197
2282
|
number provided, it will be total request
|
1198
2283
|
timeout. It can also be a pair (tuple) of
|
@@ -1215,17 +2300,9 @@ class ModelSupplyChainApi:
|
|
1215
2300
|
:return: Returns the result object.
|
1216
2301
|
""" # noqa: E501
|
1217
2302
|
|
1218
|
-
_param = self.
|
1219
|
-
|
1220
|
-
|
1221
|
-
start_time=start_time,
|
1222
|
-
end_time=end_time,
|
1223
|
-
severity=severity,
|
1224
|
-
status=status,
|
1225
|
-
limit=limit,
|
1226
|
-
offset=offset,
|
1227
|
-
sort=sort,
|
1228
|
-
latest_per_model_version_only=latest_per_model_version_only,
|
2303
|
+
_param = self._get_scan_results_serialize(
|
2304
|
+
scan_id=scan_id,
|
2305
|
+
has_detections=has_detections,
|
1229
2306
|
_request_auth=_request_auth,
|
1230
2307
|
_content_type=_content_type,
|
1231
2308
|
_headers=_headers,
|
@@ -1233,7 +2310,7 @@ class ModelSupplyChainApi:
|
|
1233
2310
|
)
|
1234
2311
|
|
1235
2312
|
_response_types_map: Dict[str, Optional[str]] = {
|
1236
|
-
'200': "
|
2313
|
+
'200': "ScanReportV3",
|
1237
2314
|
'400': None,
|
1238
2315
|
'404': None,
|
1239
2316
|
}
|
@@ -1244,18 +2321,10 @@ class ModelSupplyChainApi:
|
|
1244
2321
|
return response_data.response
|
1245
2322
|
|
1246
2323
|
|
1247
|
-
def
|
2324
|
+
def _get_scan_results_serialize(
|
1248
2325
|
self,
|
1249
|
-
|
1250
|
-
|
1251
|
-
start_time,
|
1252
|
-
end_time,
|
1253
|
-
severity,
|
1254
|
-
status,
|
1255
|
-
limit,
|
1256
|
-
offset,
|
1257
|
-
sort,
|
1258
|
-
latest_per_model_version_only,
|
2326
|
+
scan_id,
|
2327
|
+
has_detections,
|
1259
2328
|
_request_auth,
|
1260
2329
|
_content_type,
|
1261
2330
|
_headers,
|
@@ -1265,10 +2334,6 @@ class ModelSupplyChainApi:
|
|
1265
2334
|
_host = None
|
1266
2335
|
|
1267
2336
|
_collection_formats: Dict[str, str] = {
|
1268
|
-
'model_version_ids': 'csv',
|
1269
|
-
'model_ids': 'csv',
|
1270
|
-
'severity': 'csv',
|
1271
|
-
'status': 'csv',
|
1272
2337
|
}
|
1273
2338
|
|
1274
2339
|
_path_params: Dict[str, str] = {}
|
@@ -1279,64 +2344,12 @@ class ModelSupplyChainApi:
|
|
1279
2344
|
_body_params: Optional[bytes] = None
|
1280
2345
|
|
1281
2346
|
# process the path parameters
|
2347
|
+
if scan_id is not None:
|
2348
|
+
_path_params['scan_id'] = scan_id
|
1282
2349
|
# process the query parameters
|
1283
|
-
if
|
1284
|
-
|
1285
|
-
_query_params.append(('model_version_ids', model_version_ids))
|
1286
|
-
|
1287
|
-
if model_ids is not None:
|
1288
|
-
|
1289
|
-
_query_params.append(('model_ids', model_ids))
|
1290
|
-
|
1291
|
-
if start_time is not None:
|
1292
|
-
if isinstance(start_time, datetime):
|
1293
|
-
_query_params.append(
|
1294
|
-
(
|
1295
|
-
'start_time',
|
1296
|
-
start_time.strftime(
|
1297
|
-
self.api_client.configuration.datetime_format
|
1298
|
-
)
|
1299
|
-
)
|
1300
|
-
)
|
1301
|
-
else:
|
1302
|
-
_query_params.append(('start_time', start_time))
|
1303
|
-
|
1304
|
-
if end_time is not None:
|
1305
|
-
if isinstance(end_time, datetime):
|
1306
|
-
_query_params.append(
|
1307
|
-
(
|
1308
|
-
'end_time',
|
1309
|
-
end_time.strftime(
|
1310
|
-
self.api_client.configuration.datetime_format
|
1311
|
-
)
|
1312
|
-
)
|
1313
|
-
)
|
1314
|
-
else:
|
1315
|
-
_query_params.append(('end_time', end_time))
|
1316
|
-
|
1317
|
-
if severity is not None:
|
1318
|
-
|
1319
|
-
_query_params.append(('severity', severity))
|
1320
|
-
|
1321
|
-
if status is not None:
|
1322
|
-
|
1323
|
-
_query_params.append(('status', status))
|
1324
|
-
|
1325
|
-
if limit is not None:
|
1326
|
-
|
1327
|
-
_query_params.append(('limit', limit))
|
1328
|
-
|
1329
|
-
if offset is not None:
|
1330
|
-
|
1331
|
-
_query_params.append(('offset', offset))
|
1332
|
-
|
1333
|
-
if sort is not None:
|
1334
|
-
|
1335
|
-
_query_params.append(('sort', sort))
|
1336
|
-
|
1337
|
-
if latest_per_model_version_only is not None:
|
2350
|
+
if has_detections is not None:
|
1338
2351
|
|
1339
|
-
_query_params.append(('
|
2352
|
+
_query_params.append(('has_detections', has_detections))
|
1340
2353
|
|
1341
2354
|
# process the header parameters
|
1342
2355
|
# process the form parameters
|
@@ -1346,7 +2359,8 @@ class ModelSupplyChainApi:
|
|
1346
2359
|
# set the HTTP header `Accept`
|
1347
2360
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
1348
2361
|
[
|
1349
|
-
'application/json; charset=utf-8'
|
2362
|
+
'application/json; charset=utf-8',
|
2363
|
+
'application/sarif+json'
|
1350
2364
|
]
|
1351
2365
|
)
|
1352
2366
|
|
@@ -1358,7 +2372,7 @@ class ModelSupplyChainApi:
|
|
1358
2372
|
|
1359
2373
|
return self.api_client.param_serialize(
|
1360
2374
|
method='GET',
|
1361
|
-
resource_path='/scan/v3/results',
|
2375
|
+
resource_path='/scan/v3/results/{scan_id}',
|
1362
2376
|
path_params=_path_params,
|
1363
2377
|
query_params=_query_params,
|
1364
2378
|
header_params=_header_params,
|
@@ -1375,9 +2389,11 @@ class ModelSupplyChainApi:
|
|
1375
2389
|
|
1376
2390
|
|
1377
2391
|
@validate_call
|
1378
|
-
def
|
2392
|
+
def get_scan_results1(
|
1379
2393
|
self,
|
1380
2394
|
scan_id: Optional[StrictStr] = None,
|
2395
|
+
cursor: Optional[StrictStr] = None,
|
2396
|
+
page_size: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
|
1381
2397
|
_request_timeout: Union[
|
1382
2398
|
None,
|
1383
2399
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1390,12 +2406,16 @@ class ModelSupplyChainApi:
|
|
1390
2406
|
_content_type: Optional[StrictStr] = None,
|
1391
2407
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1392
2408
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1393
|
-
) -> List[
|
2409
|
+
) -> List[ScanResultsMapV3]:
|
1394
2410
|
"""Retrieve Model Scan Results
|
1395
2411
|
|
1396
2412
|
|
1397
2413
|
:param scan_id:
|
1398
2414
|
:type scan_id: str
|
2415
|
+
:param cursor:
|
2416
|
+
:type cursor: str
|
2417
|
+
:param page_size:
|
2418
|
+
:type page_size: int
|
1399
2419
|
:param _request_timeout: timeout setting for this request. If one
|
1400
2420
|
number provided, it will be total request
|
1401
2421
|
timeout. It can also be a pair (tuple) of
|
@@ -1418,8 +2438,10 @@ class ModelSupplyChainApi:
|
|
1418
2438
|
:return: Returns the result object.
|
1419
2439
|
""" # noqa: E501
|
1420
2440
|
|
1421
|
-
_param = self.
|
2441
|
+
_param = self._get_scan_results1_serialize(
|
1422
2442
|
scan_id=scan_id,
|
2443
|
+
cursor=cursor,
|
2444
|
+
page_size=page_size,
|
1423
2445
|
_request_auth=_request_auth,
|
1424
2446
|
_content_type=_content_type,
|
1425
2447
|
_headers=_headers,
|
@@ -1427,11 +2449,10 @@ class ModelSupplyChainApi:
|
|
1427
2449
|
)
|
1428
2450
|
|
1429
2451
|
_response_types_map: Dict[str, Optional[str]] = {
|
1430
|
-
'200': "List[
|
1431
|
-
'202': "List[ScanResultsV2]",
|
2452
|
+
'200': "List[ScanResultsMapV3]",
|
1432
2453
|
'400': None,
|
1433
2454
|
'404': None,
|
1434
|
-
'
|
2455
|
+
'405': None,
|
1435
2456
|
}
|
1436
2457
|
response_data = self.api_client.call_api(
|
1437
2458
|
*_param,
|
@@ -1445,9 +2466,11 @@ class ModelSupplyChainApi:
|
|
1445
2466
|
|
1446
2467
|
|
1447
2468
|
@validate_call
|
1448
|
-
def
|
2469
|
+
def get_scan_results1_with_http_info(
|
1449
2470
|
self,
|
1450
2471
|
scan_id: Optional[StrictStr] = None,
|
2472
|
+
cursor: Optional[StrictStr] = None,
|
2473
|
+
page_size: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
|
1451
2474
|
_request_timeout: Union[
|
1452
2475
|
None,
|
1453
2476
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1460,12 +2483,16 @@ class ModelSupplyChainApi:
|
|
1460
2483
|
_content_type: Optional[StrictStr] = None,
|
1461
2484
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1462
2485
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1463
|
-
) -> ApiResponse[List[
|
2486
|
+
) -> ApiResponse[List[ScanResultsMapV3]]:
|
1464
2487
|
"""Retrieve Model Scan Results
|
1465
2488
|
|
1466
2489
|
|
1467
2490
|
:param scan_id:
|
1468
2491
|
:type scan_id: str
|
2492
|
+
:param cursor:
|
2493
|
+
:type cursor: str
|
2494
|
+
:param page_size:
|
2495
|
+
:type page_size: int
|
1469
2496
|
:param _request_timeout: timeout setting for this request. If one
|
1470
2497
|
number provided, it will be total request
|
1471
2498
|
timeout. It can also be a pair (tuple) of
|
@@ -1488,8 +2515,10 @@ class ModelSupplyChainApi:
|
|
1488
2515
|
:return: Returns the result object.
|
1489
2516
|
""" # noqa: E501
|
1490
2517
|
|
1491
|
-
_param = self.
|
2518
|
+
_param = self._get_scan_results1_serialize(
|
1492
2519
|
scan_id=scan_id,
|
2520
|
+
cursor=cursor,
|
2521
|
+
page_size=page_size,
|
1493
2522
|
_request_auth=_request_auth,
|
1494
2523
|
_content_type=_content_type,
|
1495
2524
|
_headers=_headers,
|
@@ -1497,11 +2526,10 @@ class ModelSupplyChainApi:
|
|
1497
2526
|
)
|
1498
2527
|
|
1499
2528
|
_response_types_map: Dict[str, Optional[str]] = {
|
1500
|
-
'200': "List[
|
1501
|
-
'202': "List[ScanResultsV2]",
|
2529
|
+
'200': "List[ScanResultsMapV3]",
|
1502
2530
|
'400': None,
|
1503
2531
|
'404': None,
|
1504
|
-
'
|
2532
|
+
'405': None,
|
1505
2533
|
}
|
1506
2534
|
response_data = self.api_client.call_api(
|
1507
2535
|
*_param,
|
@@ -1515,9 +2543,11 @@ class ModelSupplyChainApi:
|
|
1515
2543
|
|
1516
2544
|
|
1517
2545
|
@validate_call
|
1518
|
-
def
|
2546
|
+
def get_scan_results1_without_preload_content(
|
1519
2547
|
self,
|
1520
2548
|
scan_id: Optional[StrictStr] = None,
|
2549
|
+
cursor: Optional[StrictStr] = None,
|
2550
|
+
page_size: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
|
1521
2551
|
_request_timeout: Union[
|
1522
2552
|
None,
|
1523
2553
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1536,6 +2566,10 @@ class ModelSupplyChainApi:
|
|
1536
2566
|
|
1537
2567
|
:param scan_id:
|
1538
2568
|
:type scan_id: str
|
2569
|
+
:param cursor:
|
2570
|
+
:type cursor: str
|
2571
|
+
:param page_size:
|
2572
|
+
:type page_size: int
|
1539
2573
|
:param _request_timeout: timeout setting for this request. If one
|
1540
2574
|
number provided, it will be total request
|
1541
2575
|
timeout. It can also be a pair (tuple) of
|
@@ -1558,8 +2592,10 @@ class ModelSupplyChainApi:
|
|
1558
2592
|
:return: Returns the result object.
|
1559
2593
|
""" # noqa: E501
|
1560
2594
|
|
1561
|
-
_param = self.
|
2595
|
+
_param = self._get_scan_results1_serialize(
|
1562
2596
|
scan_id=scan_id,
|
2597
|
+
cursor=cursor,
|
2598
|
+
page_size=page_size,
|
1563
2599
|
_request_auth=_request_auth,
|
1564
2600
|
_content_type=_content_type,
|
1565
2601
|
_headers=_headers,
|
@@ -1567,11 +2603,10 @@ class ModelSupplyChainApi:
|
|
1567
2603
|
)
|
1568
2604
|
|
1569
2605
|
_response_types_map: Dict[str, Optional[str]] = {
|
1570
|
-
'200': "List[
|
1571
|
-
'202': "List[ScanResultsV2]",
|
2606
|
+
'200': "List[ScanResultsMapV3]",
|
1572
2607
|
'400': None,
|
1573
2608
|
'404': None,
|
1574
|
-
'
|
2609
|
+
'405': None,
|
1575
2610
|
}
|
1576
2611
|
response_data = self.api_client.call_api(
|
1577
2612
|
*_param,
|
@@ -1580,9 +2615,11 @@ class ModelSupplyChainApi:
|
|
1580
2615
|
return response_data.response
|
1581
2616
|
|
1582
2617
|
|
1583
|
-
def
|
2618
|
+
def _get_scan_results1_serialize(
|
1584
2619
|
self,
|
1585
2620
|
scan_id,
|
2621
|
+
cursor,
|
2622
|
+
page_size,
|
1586
2623
|
_request_auth,
|
1587
2624
|
_content_type,
|
1588
2625
|
_headers,
|
@@ -1605,6 +2642,14 @@ class ModelSupplyChainApi:
|
|
1605
2642
|
if scan_id is not None:
|
1606
2643
|
_path_params['scan_id'] = scan_id
|
1607
2644
|
# process the query parameters
|
2645
|
+
if cursor is not None:
|
2646
|
+
|
2647
|
+
_query_params.append(('cursor', cursor))
|
2648
|
+
|
2649
|
+
if page_size is not None:
|
2650
|
+
|
2651
|
+
_query_params.append(('page_size', page_size))
|
2652
|
+
|
1608
2653
|
# process the header parameters
|
1609
2654
|
# process the form parameters
|
1610
2655
|
# process the body parameter
|
@@ -1613,8 +2658,7 @@ class ModelSupplyChainApi:
|
|
1613
2658
|
# set the HTTP header `Accept`
|
1614
2659
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
1615
2660
|
[
|
1616
|
-
'application/json; charset=utf-8'
|
1617
|
-
'application/json'
|
2661
|
+
'application/json; charset=utf-8'
|
1618
2662
|
]
|
1619
2663
|
)
|
1620
2664
|
|
@@ -1643,10 +2687,8 @@ class ModelSupplyChainApi:
|
|
1643
2687
|
|
1644
2688
|
|
1645
2689
|
@validate_call
|
1646
|
-
def
|
2690
|
+
def modelscanner_api_v3_health_check(
|
1647
2691
|
self,
|
1648
|
-
scan_id: StrictStr,
|
1649
|
-
scan_create_request: Annotated[ScanCreateRequest, Field(description="Request body for reporting a scan of one or more file results")],
|
1650
2692
|
_request_timeout: Union[
|
1651
2693
|
None,
|
1652
2694
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1660,13 +2702,9 @@ class ModelSupplyChainApi:
|
|
1660
2702
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1661
2703
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1662
2704
|
) -> None:
|
1663
|
-
"""
|
2705
|
+
"""Health check endpoint for Model Supply Chain Services
|
1664
2706
|
|
1665
2707
|
|
1666
|
-
:param scan_id: (required)
|
1667
|
-
:type scan_id: str
|
1668
|
-
:param scan_create_request: Request body for reporting a scan of one or more file results (required)
|
1669
|
-
:type scan_create_request: ScanCreateRequest
|
1670
2708
|
:param _request_timeout: timeout setting for this request. If one
|
1671
2709
|
number provided, it will be total request
|
1672
2710
|
timeout. It can also be a pair (tuple) of
|
@@ -1689,9 +2727,7 @@ class ModelSupplyChainApi:
|
|
1689
2727
|
:return: Returns the result object.
|
1690
2728
|
""" # noqa: E501
|
1691
2729
|
|
1692
|
-
_param = self.
|
1693
|
-
scan_id=scan_id,
|
1694
|
-
scan_create_request=scan_create_request,
|
2730
|
+
_param = self._modelscanner_api_v3_health_check_serialize(
|
1695
2731
|
_request_auth=_request_auth,
|
1696
2732
|
_content_type=_content_type,
|
1697
2733
|
_headers=_headers,
|
@@ -1699,9 +2735,8 @@ class ModelSupplyChainApi:
|
|
1699
2735
|
)
|
1700
2736
|
|
1701
2737
|
_response_types_map: Dict[str, Optional[str]] = {
|
1702
|
-
'
|
1703
|
-
'
|
1704
|
-
'422': "ValidationErrorModel",
|
2738
|
+
'200': None,
|
2739
|
+
'503': None,
|
1705
2740
|
}
|
1706
2741
|
response_data = self.api_client.call_api(
|
1707
2742
|
*_param,
|
@@ -1715,10 +2750,8 @@ class ModelSupplyChainApi:
|
|
1715
2750
|
|
1716
2751
|
|
1717
2752
|
@validate_call
|
1718
|
-
def
|
2753
|
+
def modelscanner_api_v3_health_check_with_http_info(
|
1719
2754
|
self,
|
1720
|
-
scan_id: StrictStr,
|
1721
|
-
scan_create_request: Annotated[ScanCreateRequest, Field(description="Request body for reporting a scan of one or more file results")],
|
1722
2755
|
_request_timeout: Union[
|
1723
2756
|
None,
|
1724
2757
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1732,13 +2765,9 @@ class ModelSupplyChainApi:
|
|
1732
2765
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1733
2766
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1734
2767
|
) -> ApiResponse[None]:
|
1735
|
-
"""
|
2768
|
+
"""Health check endpoint for Model Supply Chain Services
|
1736
2769
|
|
1737
2770
|
|
1738
|
-
:param scan_id: (required)
|
1739
|
-
:type scan_id: str
|
1740
|
-
:param scan_create_request: Request body for reporting a scan of one or more file results (required)
|
1741
|
-
:type scan_create_request: ScanCreateRequest
|
1742
2771
|
:param _request_timeout: timeout setting for this request. If one
|
1743
2772
|
number provided, it will be total request
|
1744
2773
|
timeout. It can also be a pair (tuple) of
|
@@ -1761,9 +2790,7 @@ class ModelSupplyChainApi:
|
|
1761
2790
|
:return: Returns the result object.
|
1762
2791
|
""" # noqa: E501
|
1763
2792
|
|
1764
|
-
_param = self.
|
1765
|
-
scan_id=scan_id,
|
1766
|
-
scan_create_request=scan_create_request,
|
2793
|
+
_param = self._modelscanner_api_v3_health_check_serialize(
|
1767
2794
|
_request_auth=_request_auth,
|
1768
2795
|
_content_type=_content_type,
|
1769
2796
|
_headers=_headers,
|
@@ -1771,9 +2798,8 @@ class ModelSupplyChainApi:
|
|
1771
2798
|
)
|
1772
2799
|
|
1773
2800
|
_response_types_map: Dict[str, Optional[str]] = {
|
1774
|
-
'
|
1775
|
-
'
|
1776
|
-
'422': "ValidationErrorModel",
|
2801
|
+
'200': None,
|
2802
|
+
'503': None,
|
1777
2803
|
}
|
1778
2804
|
response_data = self.api_client.call_api(
|
1779
2805
|
*_param,
|
@@ -1787,10 +2813,8 @@ class ModelSupplyChainApi:
|
|
1787
2813
|
|
1788
2814
|
|
1789
2815
|
@validate_call
|
1790
|
-
def
|
2816
|
+
def modelscanner_api_v3_health_check_without_preload_content(
|
1791
2817
|
self,
|
1792
|
-
scan_id: StrictStr,
|
1793
|
-
scan_create_request: Annotated[ScanCreateRequest, Field(description="Request body for reporting a scan of one or more file results")],
|
1794
2818
|
_request_timeout: Union[
|
1795
2819
|
None,
|
1796
2820
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -1804,13 +2828,9 @@ class ModelSupplyChainApi:
|
|
1804
2828
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1805
2829
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1806
2830
|
) -> RESTResponseType:
|
1807
|
-
"""
|
2831
|
+
"""Health check endpoint for Model Supply Chain Services
|
1808
2832
|
|
1809
2833
|
|
1810
|
-
:param scan_id: (required)
|
1811
|
-
:type scan_id: str
|
1812
|
-
:param scan_create_request: Request body for reporting a scan of one or more file results (required)
|
1813
|
-
:type scan_create_request: ScanCreateRequest
|
1814
2834
|
:param _request_timeout: timeout setting for this request. If one
|
1815
2835
|
number provided, it will be total request
|
1816
2836
|
timeout. It can also be a pair (tuple) of
|
@@ -1833,9 +2853,7 @@ class ModelSupplyChainApi:
|
|
1833
2853
|
:return: Returns the result object.
|
1834
2854
|
""" # noqa: E501
|
1835
2855
|
|
1836
|
-
_param = self.
|
1837
|
-
scan_id=scan_id,
|
1838
|
-
scan_create_request=scan_create_request,
|
2856
|
+
_param = self._modelscanner_api_v3_health_check_serialize(
|
1839
2857
|
_request_auth=_request_auth,
|
1840
2858
|
_content_type=_content_type,
|
1841
2859
|
_headers=_headers,
|
@@ -1843,9 +2861,8 @@ class ModelSupplyChainApi:
|
|
1843
2861
|
)
|
1844
2862
|
|
1845
2863
|
_response_types_map: Dict[str, Optional[str]] = {
|
1846
|
-
'
|
1847
|
-
'
|
1848
|
-
'422': "ValidationErrorModel",
|
2864
|
+
'200': None,
|
2865
|
+
'503': None,
|
1849
2866
|
}
|
1850
2867
|
response_data = self.api_client.call_api(
|
1851
2868
|
*_param,
|
@@ -1854,10 +2871,8 @@ class ModelSupplyChainApi:
|
|
1854
2871
|
return response_data.response
|
1855
2872
|
|
1856
2873
|
|
1857
|
-
def
|
2874
|
+
def _modelscanner_api_v3_health_check_serialize(
|
1858
2875
|
self,
|
1859
|
-
scan_id,
|
1860
|
-
scan_create_request,
|
1861
2876
|
_request_auth,
|
1862
2877
|
_content_type,
|
1863
2878
|
_headers,
|
@@ -1877,37 +2892,13 @@ class ModelSupplyChainApi:
|
|
1877
2892
|
_body_params: Optional[bytes] = None
|
1878
2893
|
|
1879
2894
|
# process the path parameters
|
1880
|
-
if scan_id is not None:
|
1881
|
-
_path_params['scan_id'] = scan_id
|
1882
2895
|
# process the query parameters
|
1883
2896
|
# process the header parameters
|
1884
2897
|
# process the form parameters
|
1885
2898
|
# process the body parameter
|
1886
|
-
if scan_create_request is not None:
|
1887
|
-
_body_params = scan_create_request
|
1888
2899
|
|
1889
2900
|
|
1890
|
-
# set the HTTP header `Accept`
|
1891
|
-
_header_params['Accept'] = self.api_client.select_header_accept(
|
1892
|
-
[
|
1893
|
-
'application/json'
|
1894
|
-
]
|
1895
|
-
)
|
1896
2901
|
|
1897
|
-
# set the HTTP header `Content-Type`
|
1898
|
-
if _content_type:
|
1899
|
-
_header_params['Content-Type'] = _content_type
|
1900
|
-
else:
|
1901
|
-
_default_content_type = (
|
1902
|
-
self.api_client.select_header_content_type(
|
1903
|
-
[
|
1904
|
-
'application/json',
|
1905
|
-
'application/octet-stream'
|
1906
|
-
]
|
1907
|
-
)
|
1908
|
-
)
|
1909
|
-
if _default_content_type is not None:
|
1910
|
-
_header_params['Content-Type'] = _default_content_type
|
1911
2902
|
|
1912
2903
|
# authentication setting
|
1913
2904
|
_auth_settings: List[str] = [
|
@@ -1915,8 +2906,8 @@ class ModelSupplyChainApi:
|
|
1915
2906
|
]
|
1916
2907
|
|
1917
2908
|
return self.api_client.param_serialize(
|
1918
|
-
method='
|
1919
|
-
resource_path='/scans/v3/
|
2909
|
+
method='GET',
|
2910
|
+
resource_path='/scans/v3/health',
|
1920
2911
|
path_params=_path_params,
|
1921
2912
|
query_params=_query_params,
|
1922
2913
|
header_params=_header_params,
|
@@ -1933,7 +2924,7 @@ class ModelSupplyChainApi:
|
|
1933
2924
|
|
1934
2925
|
|
1935
2926
|
@validate_call
|
1936
|
-
def
|
2927
|
+
def modelscanner_api_v3_readiness_check(
|
1937
2928
|
self,
|
1938
2929
|
_request_timeout: Union[
|
1939
2930
|
None,
|
@@ -1947,8 +2938,8 @@ class ModelSupplyChainApi:
|
|
1947
2938
|
_content_type: Optional[StrictStr] = None,
|
1948
2939
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1949
2940
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1950
|
-
) ->
|
1951
|
-
"""
|
2941
|
+
) -> None:
|
2942
|
+
"""Readiness check endpoint for Model Supply Chain Services
|
1952
2943
|
|
1953
2944
|
|
1954
2945
|
:param _request_timeout: timeout setting for this request. If one
|
@@ -1973,7 +2964,7 @@ class ModelSupplyChainApi:
|
|
1973
2964
|
:return: Returns the result object.
|
1974
2965
|
""" # noqa: E501
|
1975
2966
|
|
1976
|
-
_param = self.
|
2967
|
+
_param = self._modelscanner_api_v3_readiness_check_serialize(
|
1977
2968
|
_request_auth=_request_auth,
|
1978
2969
|
_content_type=_content_type,
|
1979
2970
|
_headers=_headers,
|
@@ -1981,9 +2972,8 @@ class ModelSupplyChainApi:
|
|
1981
2972
|
)
|
1982
2973
|
|
1983
2974
|
_response_types_map: Dict[str, Optional[str]] = {
|
1984
|
-
'200':
|
1985
|
-
'
|
1986
|
-
'404': None,
|
2975
|
+
'200': None,
|
2976
|
+
'503': None,
|
1987
2977
|
}
|
1988
2978
|
response_data = self.api_client.call_api(
|
1989
2979
|
*_param,
|
@@ -1997,7 +2987,7 @@ class ModelSupplyChainApi:
|
|
1997
2987
|
|
1998
2988
|
|
1999
2989
|
@validate_call
|
2000
|
-
def
|
2990
|
+
def modelscanner_api_v3_readiness_check_with_http_info(
|
2001
2991
|
self,
|
2002
2992
|
_request_timeout: Union[
|
2003
2993
|
None,
|
@@ -2011,8 +3001,8 @@ class ModelSupplyChainApi:
|
|
2011
3001
|
_content_type: Optional[StrictStr] = None,
|
2012
3002
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2013
3003
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2014
|
-
) -> ApiResponse[
|
2015
|
-
"""
|
3004
|
+
) -> ApiResponse[None]:
|
3005
|
+
"""Readiness check endpoint for Model Supply Chain Services
|
2016
3006
|
|
2017
3007
|
|
2018
3008
|
:param _request_timeout: timeout setting for this request. If one
|
@@ -2037,7 +3027,7 @@ class ModelSupplyChainApi:
|
|
2037
3027
|
:return: Returns the result object.
|
2038
3028
|
""" # noqa: E501
|
2039
3029
|
|
2040
|
-
_param = self.
|
3030
|
+
_param = self._modelscanner_api_v3_readiness_check_serialize(
|
2041
3031
|
_request_auth=_request_auth,
|
2042
3032
|
_content_type=_content_type,
|
2043
3033
|
_headers=_headers,
|
@@ -2045,9 +3035,8 @@ class ModelSupplyChainApi:
|
|
2045
3035
|
)
|
2046
3036
|
|
2047
3037
|
_response_types_map: Dict[str, Optional[str]] = {
|
2048
|
-
'200':
|
2049
|
-
'
|
2050
|
-
'404': None,
|
3038
|
+
'200': None,
|
3039
|
+
'503': None,
|
2051
3040
|
}
|
2052
3041
|
response_data = self.api_client.call_api(
|
2053
3042
|
*_param,
|
@@ -2061,7 +3050,7 @@ class ModelSupplyChainApi:
|
|
2061
3050
|
|
2062
3051
|
|
2063
3052
|
@validate_call
|
2064
|
-
def
|
3053
|
+
def modelscanner_api_v3_readiness_check_without_preload_content(
|
2065
3054
|
self,
|
2066
3055
|
_request_timeout: Union[
|
2067
3056
|
None,
|
@@ -2076,7 +3065,7 @@ class ModelSupplyChainApi:
|
|
2076
3065
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2077
3066
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2078
3067
|
) -> RESTResponseType:
|
2079
|
-
"""
|
3068
|
+
"""Readiness check endpoint for Model Supply Chain Services
|
2080
3069
|
|
2081
3070
|
|
2082
3071
|
:param _request_timeout: timeout setting for this request. If one
|
@@ -2101,7 +3090,7 @@ class ModelSupplyChainApi:
|
|
2101
3090
|
:return: Returns the result object.
|
2102
3091
|
""" # noqa: E501
|
2103
3092
|
|
2104
|
-
_param = self.
|
3093
|
+
_param = self._modelscanner_api_v3_readiness_check_serialize(
|
2105
3094
|
_request_auth=_request_auth,
|
2106
3095
|
_content_type=_content_type,
|
2107
3096
|
_headers=_headers,
|
@@ -2109,9 +3098,8 @@ class ModelSupplyChainApi:
|
|
2109
3098
|
)
|
2110
3099
|
|
2111
3100
|
_response_types_map: Dict[str, Optional[str]] = {
|
2112
|
-
'200':
|
2113
|
-
'
|
2114
|
-
'404': None,
|
3101
|
+
'200': None,
|
3102
|
+
'503': None,
|
2115
3103
|
}
|
2116
3104
|
response_data = self.api_client.call_api(
|
2117
3105
|
*_param,
|
@@ -2120,7 +3108,7 @@ class ModelSupplyChainApi:
|
|
2120
3108
|
return response_data.response
|
2121
3109
|
|
2122
3110
|
|
2123
|
-
def
|
3111
|
+
def _modelscanner_api_v3_readiness_check_serialize(
|
2124
3112
|
self,
|
2125
3113
|
_request_auth,
|
2126
3114
|
_content_type,
|
@@ -2147,14 +3135,8 @@ class ModelSupplyChainApi:
|
|
2147
3135
|
# process the body parameter
|
2148
3136
|
|
2149
3137
|
|
2150
|
-
|
2151
|
-
|
2152
|
-
[
|
2153
|
-
'application/json; charset=utf-8'
|
2154
|
-
]
|
2155
|
-
)
|
2156
|
-
|
2157
|
-
|
3138
|
+
|
3139
|
+
|
2158
3140
|
# authentication setting
|
2159
3141
|
_auth_settings: List[str] = [
|
2160
3142
|
'BearerAuth'
|
@@ -2162,7 +3144,7 @@ class ModelSupplyChainApi:
|
|
2162
3144
|
|
2163
3145
|
return self.api_client.param_serialize(
|
2164
3146
|
method='GET',
|
2165
|
-
resource_path='/scans/v3/
|
3147
|
+
resource_path='/scans/v3/readiness',
|
2166
3148
|
path_params=_path_params,
|
2167
3149
|
query_params=_query_params,
|
2168
3150
|
header_params=_header_params,
|
@@ -2179,8 +3161,11 @@ class ModelSupplyChainApi:
|
|
2179
3161
|
|
2180
3162
|
|
2181
3163
|
@validate_call
|
2182
|
-
def
|
3164
|
+
def notify_model_scan_completed(
|
2183
3165
|
self,
|
3166
|
+
scan_id: StrictStr,
|
3167
|
+
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for partial update")],
|
3168
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2184
3169
|
_request_timeout: Union[
|
2185
3170
|
None,
|
2186
3171
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2193,10 +3178,16 @@ class ModelSupplyChainApi:
|
|
2193
3178
|
_content_type: Optional[StrictStr] = None,
|
2194
3179
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2195
3180
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2196
|
-
) ->
|
2197
|
-
"""
|
3181
|
+
) -> NotifyModelScanCompleted200Response:
|
3182
|
+
"""Indicate part (file or files) of a model scan has completed
|
2198
3183
|
|
2199
3184
|
|
3185
|
+
:param scan_id: (required)
|
3186
|
+
:type scan_id: str
|
3187
|
+
:param scan_report_v3: Request body for partial update (required)
|
3188
|
+
:type scan_report_v3: ScanReportV3
|
3189
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
3190
|
+
:type has_detections: bool
|
2200
3191
|
:param _request_timeout: timeout setting for this request. If one
|
2201
3192
|
number provided, it will be total request
|
2202
3193
|
timeout. It can also be a pair (tuple) of
|
@@ -2219,7 +3210,10 @@ class ModelSupplyChainApi:
|
|
2219
3210
|
:return: Returns the result object.
|
2220
3211
|
""" # noqa: E501
|
2221
3212
|
|
2222
|
-
_param = self.
|
3213
|
+
_param = self._notify_model_scan_completed_serialize(
|
3214
|
+
scan_id=scan_id,
|
3215
|
+
scan_report_v3=scan_report_v3,
|
3216
|
+
has_detections=has_detections,
|
2223
3217
|
_request_auth=_request_auth,
|
2224
3218
|
_content_type=_content_type,
|
2225
3219
|
_headers=_headers,
|
@@ -2227,8 +3221,9 @@ class ModelSupplyChainApi:
|
|
2227
3221
|
)
|
2228
3222
|
|
2229
3223
|
_response_types_map: Dict[str, Optional[str]] = {
|
2230
|
-
'200':
|
2231
|
-
'
|
3224
|
+
'200': "NotifyModelScanCompleted200Response",
|
3225
|
+
'400': None,
|
3226
|
+
'422': "ValidationErrorModel",
|
2232
3227
|
}
|
2233
3228
|
response_data = self.api_client.call_api(
|
2234
3229
|
*_param,
|
@@ -2242,8 +3237,11 @@ class ModelSupplyChainApi:
|
|
2242
3237
|
|
2243
3238
|
|
2244
3239
|
@validate_call
|
2245
|
-
def
|
3240
|
+
def notify_model_scan_completed_with_http_info(
|
2246
3241
|
self,
|
3242
|
+
scan_id: StrictStr,
|
3243
|
+
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for partial update")],
|
3244
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2247
3245
|
_request_timeout: Union[
|
2248
3246
|
None,
|
2249
3247
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2256,10 +3254,16 @@ class ModelSupplyChainApi:
|
|
2256
3254
|
_content_type: Optional[StrictStr] = None,
|
2257
3255
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2258
3256
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2259
|
-
) -> ApiResponse[
|
2260
|
-
"""
|
3257
|
+
) -> ApiResponse[NotifyModelScanCompleted200Response]:
|
3258
|
+
"""Indicate part (file or files) of a model scan has completed
|
2261
3259
|
|
2262
3260
|
|
3261
|
+
:param scan_id: (required)
|
3262
|
+
:type scan_id: str
|
3263
|
+
:param scan_report_v3: Request body for partial update (required)
|
3264
|
+
:type scan_report_v3: ScanReportV3
|
3265
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
3266
|
+
:type has_detections: bool
|
2263
3267
|
:param _request_timeout: timeout setting for this request. If one
|
2264
3268
|
number provided, it will be total request
|
2265
3269
|
timeout. It can also be a pair (tuple) of
|
@@ -2282,7 +3286,10 @@ class ModelSupplyChainApi:
|
|
2282
3286
|
:return: Returns the result object.
|
2283
3287
|
""" # noqa: E501
|
2284
3288
|
|
2285
|
-
_param = self.
|
3289
|
+
_param = self._notify_model_scan_completed_serialize(
|
3290
|
+
scan_id=scan_id,
|
3291
|
+
scan_report_v3=scan_report_v3,
|
3292
|
+
has_detections=has_detections,
|
2286
3293
|
_request_auth=_request_auth,
|
2287
3294
|
_content_type=_content_type,
|
2288
3295
|
_headers=_headers,
|
@@ -2290,8 +3297,9 @@ class ModelSupplyChainApi:
|
|
2290
3297
|
)
|
2291
3298
|
|
2292
3299
|
_response_types_map: Dict[str, Optional[str]] = {
|
2293
|
-
'200':
|
2294
|
-
'
|
3300
|
+
'200': "NotifyModelScanCompleted200Response",
|
3301
|
+
'400': None,
|
3302
|
+
'422': "ValidationErrorModel",
|
2295
3303
|
}
|
2296
3304
|
response_data = self.api_client.call_api(
|
2297
3305
|
*_param,
|
@@ -2305,8 +3313,11 @@ class ModelSupplyChainApi:
|
|
2305
3313
|
|
2306
3314
|
|
2307
3315
|
@validate_call
|
2308
|
-
def
|
3316
|
+
def notify_model_scan_completed_without_preload_content(
|
2309
3317
|
self,
|
3318
|
+
scan_id: StrictStr,
|
3319
|
+
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for partial update")],
|
3320
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2310
3321
|
_request_timeout: Union[
|
2311
3322
|
None,
|
2312
3323
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2320,9 +3331,15 @@ class ModelSupplyChainApi:
|
|
2320
3331
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2321
3332
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2322
3333
|
) -> RESTResponseType:
|
2323
|
-
"""
|
3334
|
+
"""Indicate part (file or files) of a model scan has completed
|
2324
3335
|
|
2325
3336
|
|
3337
|
+
:param scan_id: (required)
|
3338
|
+
:type scan_id: str
|
3339
|
+
:param scan_report_v3: Request body for partial update (required)
|
3340
|
+
:type scan_report_v3: ScanReportV3
|
3341
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
3342
|
+
:type has_detections: bool
|
2326
3343
|
:param _request_timeout: timeout setting for this request. If one
|
2327
3344
|
number provided, it will be total request
|
2328
3345
|
timeout. It can also be a pair (tuple) of
|
@@ -2345,7 +3362,10 @@ class ModelSupplyChainApi:
|
|
2345
3362
|
:return: Returns the result object.
|
2346
3363
|
""" # noqa: E501
|
2347
3364
|
|
2348
|
-
_param = self.
|
3365
|
+
_param = self._notify_model_scan_completed_serialize(
|
3366
|
+
scan_id=scan_id,
|
3367
|
+
scan_report_v3=scan_report_v3,
|
3368
|
+
has_detections=has_detections,
|
2349
3369
|
_request_auth=_request_auth,
|
2350
3370
|
_content_type=_content_type,
|
2351
3371
|
_headers=_headers,
|
@@ -2353,8 +3373,9 @@ class ModelSupplyChainApi:
|
|
2353
3373
|
)
|
2354
3374
|
|
2355
3375
|
_response_types_map: Dict[str, Optional[str]] = {
|
2356
|
-
'200':
|
2357
|
-
'
|
3376
|
+
'200': "NotifyModelScanCompleted200Response",
|
3377
|
+
'400': None,
|
3378
|
+
'422': "ValidationErrorModel",
|
2358
3379
|
}
|
2359
3380
|
response_data = self.api_client.call_api(
|
2360
3381
|
*_param,
|
@@ -2363,8 +3384,11 @@ class ModelSupplyChainApi:
|
|
2363
3384
|
return response_data.response
|
2364
3385
|
|
2365
3386
|
|
2366
|
-
def
|
3387
|
+
def _notify_model_scan_completed_serialize(
|
2367
3388
|
self,
|
3389
|
+
scan_id,
|
3390
|
+
scan_report_v3,
|
3391
|
+
has_detections,
|
2368
3392
|
_request_auth,
|
2369
3393
|
_content_type,
|
2370
3394
|
_headers,
|
@@ -2384,13 +3408,40 @@ class ModelSupplyChainApi:
|
|
2384
3408
|
_body_params: Optional[bytes] = None
|
2385
3409
|
|
2386
3410
|
# process the path parameters
|
3411
|
+
if scan_id is not None:
|
3412
|
+
_path_params['scan_id'] = scan_id
|
2387
3413
|
# process the query parameters
|
3414
|
+
if has_detections is not None:
|
3415
|
+
|
3416
|
+
_query_params.append(('has_detections', has_detections))
|
3417
|
+
|
2388
3418
|
# process the header parameters
|
2389
3419
|
# process the form parameters
|
2390
3420
|
# process the body parameter
|
3421
|
+
if scan_report_v3 is not None:
|
3422
|
+
_body_params = scan_report_v3
|
2391
3423
|
|
2392
3424
|
|
3425
|
+
# set the HTTP header `Accept`
|
3426
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
3427
|
+
[
|
3428
|
+
'application/json'
|
3429
|
+
]
|
3430
|
+
)
|
2393
3431
|
|
3432
|
+
# set the HTTP header `Content-Type`
|
3433
|
+
if _content_type:
|
3434
|
+
_header_params['Content-Type'] = _content_type
|
3435
|
+
else:
|
3436
|
+
_default_content_type = (
|
3437
|
+
self.api_client.select_header_content_type(
|
3438
|
+
[
|
3439
|
+
'application/json'
|
3440
|
+
]
|
3441
|
+
)
|
3442
|
+
)
|
3443
|
+
if _default_content_type is not None:
|
3444
|
+
_header_params['Content-Type'] = _default_content_type
|
2394
3445
|
|
2395
3446
|
# authentication setting
|
2396
3447
|
_auth_settings: List[str] = [
|
@@ -2398,8 +3449,8 @@ class ModelSupplyChainApi:
|
|
2398
3449
|
]
|
2399
3450
|
|
2400
3451
|
return self.api_client.param_serialize(
|
2401
|
-
method='
|
2402
|
-
resource_path='/
|
3452
|
+
method='PATCH',
|
3453
|
+
resource_path='/scan/v3/results/{scan_id}',
|
2403
3454
|
path_params=_path_params,
|
2404
3455
|
query_params=_query_params,
|
2405
3456
|
header_params=_header_params,
|
@@ -2416,9 +3467,11 @@ class ModelSupplyChainApi:
|
|
2416
3467
|
|
2417
3468
|
|
2418
3469
|
@validate_call
|
2419
|
-
def
|
3470
|
+
def notify_model_scan_started(
|
2420
3471
|
self,
|
2421
|
-
|
3472
|
+
scan_id: StrictStr,
|
3473
|
+
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for create")],
|
3474
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2422
3475
|
_request_timeout: Union[
|
2423
3476
|
None,
|
2424
3477
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2432,11 +3485,15 @@ class ModelSupplyChainApi:
|
|
2432
3485
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2433
3486
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2434
3487
|
) -> None:
|
2435
|
-
"""
|
3488
|
+
"""Indicate model scan has started
|
2436
3489
|
|
2437
3490
|
|
2438
|
-
:param
|
2439
|
-
:type
|
3491
|
+
:param scan_id: (required)
|
3492
|
+
:type scan_id: str
|
3493
|
+
:param scan_report_v3: Request body for create (required)
|
3494
|
+
:type scan_report_v3: ScanReportV3
|
3495
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
3496
|
+
:type has_detections: bool
|
2440
3497
|
:param _request_timeout: timeout setting for this request. If one
|
2441
3498
|
number provided, it will be total request
|
2442
3499
|
timeout. It can also be a pair (tuple) of
|
@@ -2459,8 +3516,10 @@ class ModelSupplyChainApi:
|
|
2459
3516
|
:return: Returns the result object.
|
2460
3517
|
""" # noqa: E501
|
2461
3518
|
|
2462
|
-
_param = self.
|
2463
|
-
|
3519
|
+
_param = self._notify_model_scan_started_serialize(
|
3520
|
+
scan_id=scan_id,
|
3521
|
+
scan_report_v3=scan_report_v3,
|
3522
|
+
has_detections=has_detections,
|
2464
3523
|
_request_auth=_request_auth,
|
2465
3524
|
_content_type=_content_type,
|
2466
3525
|
_headers=_headers,
|
@@ -2484,9 +3543,11 @@ class ModelSupplyChainApi:
|
|
2484
3543
|
|
2485
3544
|
|
2486
3545
|
@validate_call
|
2487
|
-
def
|
3546
|
+
def notify_model_scan_started_with_http_info(
|
2488
3547
|
self,
|
2489
|
-
|
3548
|
+
scan_id: StrictStr,
|
3549
|
+
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for create")],
|
3550
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2490
3551
|
_request_timeout: Union[
|
2491
3552
|
None,
|
2492
3553
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2500,11 +3561,15 @@ class ModelSupplyChainApi:
|
|
2500
3561
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2501
3562
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2502
3563
|
) -> ApiResponse[None]:
|
2503
|
-
"""
|
3564
|
+
"""Indicate model scan has started
|
2504
3565
|
|
2505
3566
|
|
2506
|
-
:param
|
2507
|
-
:type
|
3567
|
+
:param scan_id: (required)
|
3568
|
+
:type scan_id: str
|
3569
|
+
:param scan_report_v3: Request body for create (required)
|
3570
|
+
:type scan_report_v3: ScanReportV3
|
3571
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
3572
|
+
:type has_detections: bool
|
2508
3573
|
:param _request_timeout: timeout setting for this request. If one
|
2509
3574
|
number provided, it will be total request
|
2510
3575
|
timeout. It can also be a pair (tuple) of
|
@@ -2527,8 +3592,10 @@ class ModelSupplyChainApi:
|
|
2527
3592
|
:return: Returns the result object.
|
2528
3593
|
""" # noqa: E501
|
2529
3594
|
|
2530
|
-
_param = self.
|
2531
|
-
|
3595
|
+
_param = self._notify_model_scan_started_serialize(
|
3596
|
+
scan_id=scan_id,
|
3597
|
+
scan_report_v3=scan_report_v3,
|
3598
|
+
has_detections=has_detections,
|
2532
3599
|
_request_auth=_request_auth,
|
2533
3600
|
_content_type=_content_type,
|
2534
3601
|
_headers=_headers,
|
@@ -2552,9 +3619,11 @@ class ModelSupplyChainApi:
|
|
2552
3619
|
|
2553
3620
|
|
2554
3621
|
@validate_call
|
2555
|
-
def
|
3622
|
+
def notify_model_scan_started_without_preload_content(
|
2556
3623
|
self,
|
2557
|
-
|
3624
|
+
scan_id: StrictStr,
|
3625
|
+
scan_report_v3: Annotated[ScanReportV3, Field(description="Request body for create")],
|
3626
|
+
has_detections: Annotated[Optional[StrictBool], Field(description="Filter file_results to only those that have detections (and parents)")] = None,
|
2558
3627
|
_request_timeout: Union[
|
2559
3628
|
None,
|
2560
3629
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2568,11 +3637,15 @@ class ModelSupplyChainApi:
|
|
2568
3637
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2569
3638
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2570
3639
|
) -> RESTResponseType:
|
2571
|
-
"""
|
3640
|
+
"""Indicate model scan has started
|
2572
3641
|
|
2573
3642
|
|
2574
|
-
:param
|
2575
|
-
:type
|
3643
|
+
:param scan_id: (required)
|
3644
|
+
:type scan_id: str
|
3645
|
+
:param scan_report_v3: Request body for create (required)
|
3646
|
+
:type scan_report_v3: ScanReportV3
|
3647
|
+
:param has_detections: Filter file_results to only those that have detections (and parents)
|
3648
|
+
:type has_detections: bool
|
2576
3649
|
:param _request_timeout: timeout setting for this request. If one
|
2577
3650
|
number provided, it will be total request
|
2578
3651
|
timeout. It can also be a pair (tuple) of
|
@@ -2595,8 +3668,10 @@ class ModelSupplyChainApi:
|
|
2595
3668
|
:return: Returns the result object.
|
2596
3669
|
""" # noqa: E501
|
2597
3670
|
|
2598
|
-
_param = self.
|
2599
|
-
|
3671
|
+
_param = self._notify_model_scan_started_serialize(
|
3672
|
+
scan_id=scan_id,
|
3673
|
+
scan_report_v3=scan_report_v3,
|
3674
|
+
has_detections=has_detections,
|
2600
3675
|
_request_auth=_request_auth,
|
2601
3676
|
_content_type=_content_type,
|
2602
3677
|
_headers=_headers,
|
@@ -2615,9 +3690,11 @@ class ModelSupplyChainApi:
|
|
2615
3690
|
return response_data.response
|
2616
3691
|
|
2617
3692
|
|
2618
|
-
def
|
3693
|
+
def _notify_model_scan_started_serialize(
|
2619
3694
|
self,
|
2620
|
-
|
3695
|
+
scan_id,
|
3696
|
+
scan_report_v3,
|
3697
|
+
has_detections,
|
2621
3698
|
_request_auth,
|
2622
3699
|
_content_type,
|
2623
3700
|
_headers,
|
@@ -2637,12 +3714,18 @@ class ModelSupplyChainApi:
|
|
2637
3714
|
_body_params: Optional[bytes] = None
|
2638
3715
|
|
2639
3716
|
# process the path parameters
|
3717
|
+
if scan_id is not None:
|
3718
|
+
_path_params['scan_id'] = scan_id
|
2640
3719
|
# process the query parameters
|
3720
|
+
if has_detections is not None:
|
3721
|
+
|
3722
|
+
_query_params.append(('has_detections', has_detections))
|
3723
|
+
|
2641
3724
|
# process the header parameters
|
2642
3725
|
# process the form parameters
|
2643
3726
|
# process the body parameter
|
2644
|
-
if
|
2645
|
-
_body_params =
|
3727
|
+
if scan_report_v3 is not None:
|
3728
|
+
_body_params = scan_report_v3
|
2646
3729
|
|
2647
3730
|
|
2648
3731
|
# set the HTTP header `Accept`
|
@@ -2659,8 +3742,7 @@ class ModelSupplyChainApi:
|
|
2659
3742
|
_default_content_type = (
|
2660
3743
|
self.api_client.select_header_content_type(
|
2661
3744
|
[
|
2662
|
-
'application/json
|
2663
|
-
'application/octet-stream'
|
3745
|
+
'application/json'
|
2664
3746
|
]
|
2665
3747
|
)
|
2666
3748
|
)
|
@@ -2674,7 +3756,7 @@ class ModelSupplyChainApi:
|
|
2674
3756
|
|
2675
3757
|
return self.api_client.param_serialize(
|
2676
3758
|
method='POST',
|
2677
|
-
resource_path='/
|
3759
|
+
resource_path='/scan/v3/results/{scan_id}',
|
2678
3760
|
path_params=_path_params,
|
2679
3761
|
query_params=_query_params,
|
2680
3762
|
header_params=_header_params,
|
@@ -2691,8 +3773,10 @@ class ModelSupplyChainApi:
|
|
2691
3773
|
|
2692
3774
|
|
2693
3775
|
@validate_call
|
2694
|
-
def
|
3776
|
+
def report_scan_results(
|
2695
3777
|
self,
|
3778
|
+
scan_id: StrictStr,
|
3779
|
+
scan_create_request: Annotated[ScanCreateRequest, Field(description="Request body for reporting a scan of one or more file results")],
|
2696
3780
|
_request_timeout: Union[
|
2697
3781
|
None,
|
2698
3782
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2706,9 +3790,13 @@ class ModelSupplyChainApi:
|
|
2706
3790
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2707
3791
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2708
3792
|
) -> None:
|
2709
|
-
"""
|
3793
|
+
"""Engine Report Endpoint of Model Scan Results
|
2710
3794
|
|
2711
3795
|
|
3796
|
+
:param scan_id: (required)
|
3797
|
+
:type scan_id: str
|
3798
|
+
:param scan_create_request: Request body for reporting a scan of one or more file results (required)
|
3799
|
+
:type scan_create_request: ScanCreateRequest
|
2712
3800
|
:param _request_timeout: timeout setting for this request. If one
|
2713
3801
|
number provided, it will be total request
|
2714
3802
|
timeout. It can also be a pair (tuple) of
|
@@ -2731,7 +3819,9 @@ class ModelSupplyChainApi:
|
|
2731
3819
|
:return: Returns the result object.
|
2732
3820
|
""" # noqa: E501
|
2733
3821
|
|
2734
|
-
_param = self.
|
3822
|
+
_param = self._report_scan_results_serialize(
|
3823
|
+
scan_id=scan_id,
|
3824
|
+
scan_create_request=scan_create_request,
|
2735
3825
|
_request_auth=_request_auth,
|
2736
3826
|
_content_type=_content_type,
|
2737
3827
|
_headers=_headers,
|
@@ -2739,8 +3829,9 @@ class ModelSupplyChainApi:
|
|
2739
3829
|
)
|
2740
3830
|
|
2741
3831
|
_response_types_map: Dict[str, Optional[str]] = {
|
2742
|
-
'
|
2743
|
-
'
|
3832
|
+
'204': None,
|
3833
|
+
'400': None,
|
3834
|
+
'422': "ValidationErrorModel",
|
2744
3835
|
}
|
2745
3836
|
response_data = self.api_client.call_api(
|
2746
3837
|
*_param,
|
@@ -2754,8 +3845,10 @@ class ModelSupplyChainApi:
|
|
2754
3845
|
|
2755
3846
|
|
2756
3847
|
@validate_call
|
2757
|
-
def
|
3848
|
+
def report_scan_results_with_http_info(
|
2758
3849
|
self,
|
3850
|
+
scan_id: StrictStr,
|
3851
|
+
scan_create_request: Annotated[ScanCreateRequest, Field(description="Request body for reporting a scan of one or more file results")],
|
2759
3852
|
_request_timeout: Union[
|
2760
3853
|
None,
|
2761
3854
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2769,9 +3862,13 @@ class ModelSupplyChainApi:
|
|
2769
3862
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2770
3863
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2771
3864
|
) -> ApiResponse[None]:
|
2772
|
-
"""
|
3865
|
+
"""Engine Report Endpoint of Model Scan Results
|
2773
3866
|
|
2774
3867
|
|
3868
|
+
:param scan_id: (required)
|
3869
|
+
:type scan_id: str
|
3870
|
+
:param scan_create_request: Request body for reporting a scan of one or more file results (required)
|
3871
|
+
:type scan_create_request: ScanCreateRequest
|
2775
3872
|
:param _request_timeout: timeout setting for this request. If one
|
2776
3873
|
number provided, it will be total request
|
2777
3874
|
timeout. It can also be a pair (tuple) of
|
@@ -2794,7 +3891,9 @@ class ModelSupplyChainApi:
|
|
2794
3891
|
:return: Returns the result object.
|
2795
3892
|
""" # noqa: E501
|
2796
3893
|
|
2797
|
-
_param = self.
|
3894
|
+
_param = self._report_scan_results_serialize(
|
3895
|
+
scan_id=scan_id,
|
3896
|
+
scan_create_request=scan_create_request,
|
2798
3897
|
_request_auth=_request_auth,
|
2799
3898
|
_content_type=_content_type,
|
2800
3899
|
_headers=_headers,
|
@@ -2802,8 +3901,9 @@ class ModelSupplyChainApi:
|
|
2802
3901
|
)
|
2803
3902
|
|
2804
3903
|
_response_types_map: Dict[str, Optional[str]] = {
|
2805
|
-
'
|
2806
|
-
'
|
3904
|
+
'204': None,
|
3905
|
+
'400': None,
|
3906
|
+
'422': "ValidationErrorModel",
|
2807
3907
|
}
|
2808
3908
|
response_data = self.api_client.call_api(
|
2809
3909
|
*_param,
|
@@ -2817,8 +3917,10 @@ class ModelSupplyChainApi:
|
|
2817
3917
|
|
2818
3918
|
|
2819
3919
|
@validate_call
|
2820
|
-
def
|
3920
|
+
def report_scan_results_without_preload_content(
|
2821
3921
|
self,
|
3922
|
+
scan_id: StrictStr,
|
3923
|
+
scan_create_request: Annotated[ScanCreateRequest, Field(description="Request body for reporting a scan of one or more file results")],
|
2822
3924
|
_request_timeout: Union[
|
2823
3925
|
None,
|
2824
3926
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -2832,9 +3934,13 @@ class ModelSupplyChainApi:
|
|
2832
3934
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2833
3935
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2834
3936
|
) -> RESTResponseType:
|
2835
|
-
"""
|
3937
|
+
"""Engine Report Endpoint of Model Scan Results
|
2836
3938
|
|
2837
3939
|
|
3940
|
+
:param scan_id: (required)
|
3941
|
+
:type scan_id: str
|
3942
|
+
:param scan_create_request: Request body for reporting a scan of one or more file results (required)
|
3943
|
+
:type scan_create_request: ScanCreateRequest
|
2838
3944
|
:param _request_timeout: timeout setting for this request. If one
|
2839
3945
|
number provided, it will be total request
|
2840
3946
|
timeout. It can also be a pair (tuple) of
|
@@ -2857,7 +3963,9 @@ class ModelSupplyChainApi:
|
|
2857
3963
|
:return: Returns the result object.
|
2858
3964
|
""" # noqa: E501
|
2859
3965
|
|
2860
|
-
_param = self.
|
3966
|
+
_param = self._report_scan_results_serialize(
|
3967
|
+
scan_id=scan_id,
|
3968
|
+
scan_create_request=scan_create_request,
|
2861
3969
|
_request_auth=_request_auth,
|
2862
3970
|
_content_type=_content_type,
|
2863
3971
|
_headers=_headers,
|
@@ -2865,8 +3973,9 @@ class ModelSupplyChainApi:
|
|
2865
3973
|
)
|
2866
3974
|
|
2867
3975
|
_response_types_map: Dict[str, Optional[str]] = {
|
2868
|
-
'
|
2869
|
-
'
|
3976
|
+
'204': None,
|
3977
|
+
'400': None,
|
3978
|
+
'422': "ValidationErrorModel",
|
2870
3979
|
}
|
2871
3980
|
response_data = self.api_client.call_api(
|
2872
3981
|
*_param,
|
@@ -2875,8 +3984,10 @@ class ModelSupplyChainApi:
|
|
2875
3984
|
return response_data.response
|
2876
3985
|
|
2877
3986
|
|
2878
|
-
def
|
3987
|
+
def _report_scan_results_serialize(
|
2879
3988
|
self,
|
3989
|
+
scan_id,
|
3990
|
+
scan_create_request,
|
2880
3991
|
_request_auth,
|
2881
3992
|
_content_type,
|
2882
3993
|
_headers,
|
@@ -2896,13 +4007,37 @@ class ModelSupplyChainApi:
|
|
2896
4007
|
_body_params: Optional[bytes] = None
|
2897
4008
|
|
2898
4009
|
# process the path parameters
|
4010
|
+
if scan_id is not None:
|
4011
|
+
_path_params['scan_id'] = scan_id
|
2899
4012
|
# process the query parameters
|
2900
4013
|
# process the header parameters
|
2901
4014
|
# process the form parameters
|
2902
4015
|
# process the body parameter
|
4016
|
+
if scan_create_request is not None:
|
4017
|
+
_body_params = scan_create_request
|
2903
4018
|
|
2904
4019
|
|
4020
|
+
# set the HTTP header `Accept`
|
4021
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
4022
|
+
[
|
4023
|
+
'application/json'
|
4024
|
+
]
|
4025
|
+
)
|
2905
4026
|
|
4027
|
+
# set the HTTP header `Content-Type`
|
4028
|
+
if _content_type:
|
4029
|
+
_header_params['Content-Type'] = _content_type
|
4030
|
+
else:
|
4031
|
+
_default_content_type = (
|
4032
|
+
self.api_client.select_header_content_type(
|
4033
|
+
[
|
4034
|
+
'application/json',
|
4035
|
+
'application/octet-stream'
|
4036
|
+
]
|
4037
|
+
)
|
4038
|
+
)
|
4039
|
+
if _default_content_type is not None:
|
4040
|
+
_header_params['Content-Type'] = _default_content_type
|
2906
4041
|
|
2907
4042
|
# authentication setting
|
2908
4043
|
_auth_settings: List[str] = [
|
@@ -2910,8 +4045,8 @@ class ModelSupplyChainApi:
|
|
2910
4045
|
]
|
2911
4046
|
|
2912
4047
|
return self.api_client.param_serialize(
|
2913
|
-
method='
|
2914
|
-
resource_path='/scans/v3/
|
4048
|
+
method='POST',
|
4049
|
+
resource_path='/scans/v3/reports/{scan_id}',
|
2915
4050
|
path_params=_path_params,
|
2916
4051
|
query_params=_query_params,
|
2917
4052
|
header_params=_header_params,
|