hiddenlayer-sdk 1.2.2__py3-none-any.whl → 2.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. hiddenlayer/__init__.py +0 -10
  2. hiddenlayer/sdk/exceptions.py +1 -1
  3. hiddenlayer/sdk/models.py +2 -3
  4. hiddenlayer/sdk/rest/__init__.py +16 -11
  5. hiddenlayer/sdk/rest/api/__init__.py +0 -1
  6. hiddenlayer/sdk/rest/api/model_supply_chain_api.py +1706 -571
  7. hiddenlayer/sdk/rest/api/sensor_api.py +214 -1320
  8. hiddenlayer/sdk/rest/models/__init__.py +16 -10
  9. hiddenlayer/sdk/rest/models/{scan_model_request.py → begin_multi_file_upload200_response.py} +9 -9
  10. hiddenlayer/sdk/rest/models/{get_multipart_upload_response.py → begin_multipart_file_upload200_response.py} +9 -9
  11. hiddenlayer/sdk/rest/models/{multipart_upload_part.py → begin_multipart_file_upload200_response_parts_inner.py} +11 -10
  12. hiddenlayer/sdk/rest/models/errors_inner.py +91 -0
  13. hiddenlayer/sdk/rest/models/file_details_v3.py +8 -2
  14. hiddenlayer/sdk/rest/models/{scan_results_v2.py → file_result_v3.py} +21 -32
  15. hiddenlayer/sdk/rest/models/{model_scan_api_v3_scan_query200_response.py → get_condensed_model_scan_reports200_response.py} +4 -4
  16. hiddenlayer/sdk/rest/models/inventory_v3.py +97 -0
  17. hiddenlayer/sdk/rest/models/model_inventory_info.py +1 -1
  18. hiddenlayer/sdk/rest/models/{detections.py → multi_file_upload_request_v3.py} +14 -22
  19. hiddenlayer/sdk/rest/models/{model_scan_api_v3_scan_model_version_id_patch200_response.py → notify_model_scan_completed200_response.py} +4 -4
  20. hiddenlayer/sdk/rest/models/pagination_v3.py +95 -0
  21. hiddenlayer/sdk/rest/models/problem_details.py +103 -0
  22. hiddenlayer/sdk/rest/models/scan_detection_v31.py +155 -0
  23. hiddenlayer/sdk/rest/models/scan_model_details_v3.py +1 -1
  24. hiddenlayer/sdk/rest/models/scan_results_map_v3.py +105 -0
  25. hiddenlayer/sdk/rest/models/scan_results_v3.py +120 -0
  26. hiddenlayer/sdk/rest/models/{model.py → sensor.py} +4 -4
  27. hiddenlayer/sdk/rest/models/{model_query_response.py → sensor_query_response.py} +7 -7
  28. hiddenlayer/sdk/services/aidr_predictive.py +57 -3
  29. hiddenlayer/sdk/services/model_scan.py +94 -132
  30. hiddenlayer/sdk/version.py +1 -1
  31. {hiddenlayer_sdk-1.2.2.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/METADATA +12 -2
  32. {hiddenlayer_sdk-1.2.2.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/RECORD +35 -31
  33. hiddenlayer/sdk/rest/api/model_scan_api.py +0 -591
  34. hiddenlayer/sdk/rest/models/scan_results.py +0 -118
  35. hiddenlayer/sdk/services/model.py +0 -149
  36. {hiddenlayer_sdk-1.2.2.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/LICENSE +0 -0
  37. {hiddenlayer_sdk-1.2.2.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/WHEEL +0 -0
  38. {hiddenlayer_sdk-1.2.2.dist-info → hiddenlayer_sdk-2.0.1.dist-info}/top_level.txt +0 -0
@@ -16,13 +16,12 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
16
  from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
- from pydantic import Field, StrictInt, StrictStr, field_validator
20
- from typing import Any, Optional
19
+ from pydantic import Field, StrictStr, field_validator
20
+ from typing import Optional
21
21
  from typing_extensions import Annotated
22
22
  from hiddenlayer.sdk.rest.models.create_sensor_request import CreateSensorRequest
23
- from hiddenlayer.sdk.rest.models.get_multipart_upload_response import GetMultipartUploadResponse
24
- from hiddenlayer.sdk.rest.models.model import Model
25
- from hiddenlayer.sdk.rest.models.model_query_response import ModelQueryResponse
23
+ from hiddenlayer.sdk.rest.models.sensor import Sensor
24
+ from hiddenlayer.sdk.rest.models.sensor_query_response import SensorQueryResponse
26
25
  from hiddenlayer.sdk.rest.models.sensor_sor_model_card_query_response import SensorSORModelCardQueryResponse
27
26
  from hiddenlayer.sdk.rest.models.sensor_sor_query_request import SensorSORQueryRequest
28
27
 
@@ -45,10 +44,9 @@ class SensorApi:
45
44
 
46
45
 
47
46
  @validate_call
48
- def begin_multipart_upload(
47
+ def create_sensor(
49
48
  self,
50
- sensor_id: StrictStr,
51
- x_content_length: Annotated[StrictInt, Field(description="The total size of multipart upload.")],
49
+ create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
52
50
  _request_timeout: Union[
53
51
  None,
54
52
  Annotated[StrictFloat, Field(gt=0)],
@@ -61,14 +59,12 @@ class SensorApi:
61
59
  _content_type: Optional[StrictStr] = None,
62
60
  _headers: Optional[Dict[StrictStr, Any]] = None,
63
61
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
- ) -> GetMultipartUploadResponse:
65
- """Begin Multipart Upload
62
+ ) -> Sensor:
63
+ """Create a Sensor
66
64
 
67
65
 
68
- :param sensor_id: (required)
69
- :type sensor_id: str
70
- :param x_content_length: The total size of multipart upload. (required)
71
- :type x_content_length: int
66
+ :param create_sensor_request: Request body for create (required)
67
+ :type create_sensor_request: CreateSensorRequest
72
68
  :param _request_timeout: timeout setting for this request. If one
73
69
  number provided, it will be total request
74
70
  timeout. It can also be a pair (tuple) of
@@ -91,9 +87,8 @@ class SensorApi:
91
87
  :return: Returns the result object.
92
88
  """ # noqa: E501
93
89
 
94
- _param = self._begin_multipart_upload_serialize(
95
- sensor_id=sensor_id,
96
- x_content_length=x_content_length,
90
+ _param = self._create_sensor_serialize(
91
+ create_sensor_request=create_sensor_request,
97
92
  _request_auth=_request_auth,
98
93
  _content_type=_content_type,
99
94
  _headers=_headers,
@@ -101,8 +96,9 @@ class SensorApi:
101
96
  )
102
97
 
103
98
  _response_types_map: Dict[str, Optional[str]] = {
104
- '200': "GetMultipartUploadResponse",
99
+ '201': "Sensor",
105
100
  '400': None,
101
+ '422': "ValidationErrorModel",
106
102
  }
107
103
  response_data = self.api_client.call_api(
108
104
  *_param,
@@ -116,10 +112,9 @@ class SensorApi:
116
112
 
117
113
 
118
114
  @validate_call
119
- def begin_multipart_upload_with_http_info(
115
+ def create_sensor_with_http_info(
120
116
  self,
121
- sensor_id: StrictStr,
122
- x_content_length: Annotated[StrictInt, Field(description="The total size of multipart upload.")],
117
+ create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
123
118
  _request_timeout: Union[
124
119
  None,
125
120
  Annotated[StrictFloat, Field(gt=0)],
@@ -132,14 +127,12 @@ class SensorApi:
132
127
  _content_type: Optional[StrictStr] = None,
133
128
  _headers: Optional[Dict[StrictStr, Any]] = None,
134
129
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
- ) -> ApiResponse[GetMultipartUploadResponse]:
136
- """Begin Multipart Upload
130
+ ) -> ApiResponse[Sensor]:
131
+ """Create a Sensor
137
132
 
138
133
 
139
- :param sensor_id: (required)
140
- :type sensor_id: str
141
- :param x_content_length: The total size of multipart upload. (required)
142
- :type x_content_length: int
134
+ :param create_sensor_request: Request body for create (required)
135
+ :type create_sensor_request: CreateSensorRequest
143
136
  :param _request_timeout: timeout setting for this request. If one
144
137
  number provided, it will be total request
145
138
  timeout. It can also be a pair (tuple) of
@@ -162,9 +155,8 @@ class SensorApi:
162
155
  :return: Returns the result object.
163
156
  """ # noqa: E501
164
157
 
165
- _param = self._begin_multipart_upload_serialize(
166
- sensor_id=sensor_id,
167
- x_content_length=x_content_length,
158
+ _param = self._create_sensor_serialize(
159
+ create_sensor_request=create_sensor_request,
168
160
  _request_auth=_request_auth,
169
161
  _content_type=_content_type,
170
162
  _headers=_headers,
@@ -172,8 +164,9 @@ class SensorApi:
172
164
  )
173
165
 
174
166
  _response_types_map: Dict[str, Optional[str]] = {
175
- '200': "GetMultipartUploadResponse",
167
+ '201': "Sensor",
176
168
  '400': None,
169
+ '422': "ValidationErrorModel",
177
170
  }
178
171
  response_data = self.api_client.call_api(
179
172
  *_param,
@@ -187,10 +180,9 @@ class SensorApi:
187
180
 
188
181
 
189
182
  @validate_call
190
- def begin_multipart_upload_without_preload_content(
183
+ def create_sensor_without_preload_content(
191
184
  self,
192
- sensor_id: StrictStr,
193
- x_content_length: Annotated[StrictInt, Field(description="The total size of multipart upload.")],
185
+ create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
194
186
  _request_timeout: Union[
195
187
  None,
196
188
  Annotated[StrictFloat, Field(gt=0)],
@@ -204,13 +196,11 @@ class SensorApi:
204
196
  _headers: Optional[Dict[StrictStr, Any]] = None,
205
197
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
206
198
  ) -> RESTResponseType:
207
- """Begin Multipart Upload
199
+ """Create a Sensor
208
200
 
209
201
 
210
- :param sensor_id: (required)
211
- :type sensor_id: str
212
- :param x_content_length: The total size of multipart upload. (required)
213
- :type x_content_length: int
202
+ :param create_sensor_request: Request body for create (required)
203
+ :type create_sensor_request: CreateSensorRequest
214
204
  :param _request_timeout: timeout setting for this request. If one
215
205
  number provided, it will be total request
216
206
  timeout. It can also be a pair (tuple) of
@@ -233,9 +223,8 @@ class SensorApi:
233
223
  :return: Returns the result object.
234
224
  """ # noqa: E501
235
225
 
236
- _param = self._begin_multipart_upload_serialize(
237
- sensor_id=sensor_id,
238
- x_content_length=x_content_length,
226
+ _param = self._create_sensor_serialize(
227
+ create_sensor_request=create_sensor_request,
239
228
  _request_auth=_request_auth,
240
229
  _content_type=_content_type,
241
230
  _headers=_headers,
@@ -243,8 +232,9 @@ class SensorApi:
243
232
  )
244
233
 
245
234
  _response_types_map: Dict[str, Optional[str]] = {
246
- '200': "GetMultipartUploadResponse",
235
+ '201': "Sensor",
247
236
  '400': None,
237
+ '422': "ValidationErrorModel",
248
238
  }
249
239
  response_data = self.api_client.call_api(
250
240
  *_param,
@@ -253,10 +243,9 @@ class SensorApi:
253
243
  return response_data.response
254
244
 
255
245
 
256
- def _begin_multipart_upload_serialize(
246
+ def _create_sensor_serialize(
257
247
  self,
258
- sensor_id,
259
- x_content_length,
248
+ create_sensor_request,
260
249
  _request_auth,
261
250
  _content_type,
262
251
  _headers,
@@ -276,14 +265,12 @@ class SensorApi:
276
265
  _body_params: Optional[bytes] = None
277
266
 
278
267
  # process the path parameters
279
- if sensor_id is not None:
280
- _path_params['sensor_id'] = sensor_id
281
268
  # process the query parameters
282
269
  # process the header parameters
283
- if x_content_length is not None:
284
- _header_params['X-Content-Length'] = x_content_length
285
270
  # process the form parameters
286
271
  # process the body parameter
272
+ if create_sensor_request is not None:
273
+ _body_params = create_sensor_request
287
274
 
288
275
 
289
276
  # set the HTTP header `Accept`
@@ -293,6 +280,19 @@ class SensorApi:
293
280
  ]
294
281
  )
295
282
 
283
+ # set the HTTP header `Content-Type`
284
+ if _content_type:
285
+ _header_params['Content-Type'] = _content_type
286
+ else:
287
+ _default_content_type = (
288
+ self.api_client.select_header_content_type(
289
+ [
290
+ 'application/json'
291
+ ]
292
+ )
293
+ )
294
+ if _default_content_type is not None:
295
+ _header_params['Content-Type'] = _default_content_type
296
296
 
297
297
  # authentication setting
298
298
  _auth_settings: List[str] = [
@@ -301,7 +301,7 @@ class SensorApi:
301
301
 
302
302
  return self.api_client.param_serialize(
303
303
  method='POST',
304
- resource_path='/api/v2/sensors/{sensor_id}/upload/begin',
304
+ resource_path='/api/v2/sensors/create',
305
305
  path_params=_path_params,
306
306
  query_params=_query_params,
307
307
  header_params=_header_params,
@@ -318,10 +318,9 @@ class SensorApi:
318
318
 
319
319
 
320
320
  @validate_call
321
- def complete_multipart_upload(
321
+ def get_sensor(
322
322
  self,
323
323
  sensor_id: StrictStr,
324
- upload_id: StrictStr,
325
324
  _request_timeout: Union[
326
325
  None,
327
326
  Annotated[StrictFloat, Field(gt=0)],
@@ -334,14 +333,12 @@ class SensorApi:
334
333
  _content_type: Optional[StrictStr] = None,
335
334
  _headers: Optional[Dict[StrictStr, Any]] = None,
336
335
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
337
- ) -> None:
338
- """Complete Multipart Upload
336
+ ) -> Sensor:
337
+ """Get Sensor
339
338
 
340
339
 
341
340
  :param sensor_id: (required)
342
341
  :type sensor_id: str
343
- :param upload_id: (required)
344
- :type upload_id: str
345
342
  :param _request_timeout: timeout setting for this request. If one
346
343
  number provided, it will be total request
347
344
  timeout. It can also be a pair (tuple) of
@@ -364,9 +361,8 @@ class SensorApi:
364
361
  :return: Returns the result object.
365
362
  """ # noqa: E501
366
363
 
367
- _param = self._complete_multipart_upload_serialize(
364
+ _param = self._get_sensor_serialize(
368
365
  sensor_id=sensor_id,
369
- upload_id=upload_id,
370
366
  _request_auth=_request_auth,
371
367
  _content_type=_content_type,
372
368
  _headers=_headers,
@@ -374,8 +370,9 @@ class SensorApi:
374
370
  )
375
371
 
376
372
  _response_types_map: Dict[str, Optional[str]] = {
377
- '200': None,
373
+ '200': "Sensor",
378
374
  '400': None,
375
+ '404': None,
379
376
  }
380
377
  response_data = self.api_client.call_api(
381
378
  *_param,
@@ -389,10 +386,9 @@ class SensorApi:
389
386
 
390
387
 
391
388
  @validate_call
392
- def complete_multipart_upload_with_http_info(
389
+ def get_sensor_with_http_info(
393
390
  self,
394
391
  sensor_id: StrictStr,
395
- upload_id: StrictStr,
396
392
  _request_timeout: Union[
397
393
  None,
398
394
  Annotated[StrictFloat, Field(gt=0)],
@@ -405,14 +401,12 @@ class SensorApi:
405
401
  _content_type: Optional[StrictStr] = None,
406
402
  _headers: Optional[Dict[StrictStr, Any]] = None,
407
403
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
408
- ) -> ApiResponse[None]:
409
- """Complete Multipart Upload
404
+ ) -> ApiResponse[Sensor]:
405
+ """Get Sensor
410
406
 
411
407
 
412
408
  :param sensor_id: (required)
413
409
  :type sensor_id: str
414
- :param upload_id: (required)
415
- :type upload_id: str
416
410
  :param _request_timeout: timeout setting for this request. If one
417
411
  number provided, it will be total request
418
412
  timeout. It can also be a pair (tuple) of
@@ -435,9 +429,8 @@ class SensorApi:
435
429
  :return: Returns the result object.
436
430
  """ # noqa: E501
437
431
 
438
- _param = self._complete_multipart_upload_serialize(
432
+ _param = self._get_sensor_serialize(
439
433
  sensor_id=sensor_id,
440
- upload_id=upload_id,
441
434
  _request_auth=_request_auth,
442
435
  _content_type=_content_type,
443
436
  _headers=_headers,
@@ -445,8 +438,9 @@ class SensorApi:
445
438
  )
446
439
 
447
440
  _response_types_map: Dict[str, Optional[str]] = {
448
- '200': None,
441
+ '200': "Sensor",
449
442
  '400': None,
443
+ '404': None,
450
444
  }
451
445
  response_data = self.api_client.call_api(
452
446
  *_param,
@@ -460,10 +454,9 @@ class SensorApi:
460
454
 
461
455
 
462
456
  @validate_call
463
- def complete_multipart_upload_without_preload_content(
457
+ def get_sensor_without_preload_content(
464
458
  self,
465
459
  sensor_id: StrictStr,
466
- upload_id: StrictStr,
467
460
  _request_timeout: Union[
468
461
  None,
469
462
  Annotated[StrictFloat, Field(gt=0)],
@@ -477,13 +470,11 @@ class SensorApi:
477
470
  _headers: Optional[Dict[StrictStr, Any]] = None,
478
471
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
479
472
  ) -> RESTResponseType:
480
- """Complete Multipart Upload
473
+ """Get Sensor
481
474
 
482
475
 
483
476
  :param sensor_id: (required)
484
477
  :type sensor_id: str
485
- :param upload_id: (required)
486
- :type upload_id: str
487
478
  :param _request_timeout: timeout setting for this request. If one
488
479
  number provided, it will be total request
489
480
  timeout. It can also be a pair (tuple) of
@@ -506,9 +497,8 @@ class SensorApi:
506
497
  :return: Returns the result object.
507
498
  """ # noqa: E501
508
499
 
509
- _param = self._complete_multipart_upload_serialize(
500
+ _param = self._get_sensor_serialize(
510
501
  sensor_id=sensor_id,
511
- upload_id=upload_id,
512
502
  _request_auth=_request_auth,
513
503
  _content_type=_content_type,
514
504
  _headers=_headers,
@@ -516,8 +506,9 @@ class SensorApi:
516
506
  )
517
507
 
518
508
  _response_types_map: Dict[str, Optional[str]] = {
519
- '200': None,
509
+ '200': "Sensor",
520
510
  '400': None,
511
+ '404': None,
521
512
  }
522
513
  response_data = self.api_client.call_api(
523
514
  *_param,
@@ -526,10 +517,9 @@ class SensorApi:
526
517
  return response_data.response
527
518
 
528
519
 
529
- def _complete_multipart_upload_serialize(
520
+ def _get_sensor_serialize(
530
521
  self,
531
522
  sensor_id,
532
- upload_id,
533
523
  _request_auth,
534
524
  _content_type,
535
525
  _headers,
@@ -551,14 +541,18 @@ class SensorApi:
551
541
  # process the path parameters
552
542
  if sensor_id is not None:
553
543
  _path_params['sensor_id'] = sensor_id
554
- if upload_id is not None:
555
- _path_params['upload_id'] = upload_id
556
544
  # process the query parameters
557
545
  # process the header parameters
558
546
  # process the form parameters
559
547
  # process the body parameter
560
548
 
561
549
 
550
+ # set the HTTP header `Accept`
551
+ _header_params['Accept'] = self.api_client.select_header_accept(
552
+ [
553
+ 'application/json'
554
+ ]
555
+ )
562
556
 
563
557
 
564
558
  # authentication setting
@@ -567,8 +561,8 @@ class SensorApi:
567
561
  ]
568
562
 
569
563
  return self.api_client.param_serialize(
570
- method='POST',
571
- resource_path='/api/v2/sensors/{sensor_id}/upload/{upload_id}/complete',
564
+ method='GET',
565
+ resource_path='/api/v2/sensors/{sensor_id}',
572
566
  path_params=_path_params,
573
567
  query_params=_query_params,
574
568
  header_params=_header_params,
@@ -585,9 +579,9 @@ class SensorApi:
585
579
 
586
580
 
587
581
  @validate_call
588
- def create_sensor(
582
+ def query_sensor(
589
583
  self,
590
- create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
584
+ sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
591
585
  _request_timeout: Union[
592
586
  None,
593
587
  Annotated[StrictFloat, Field(gt=0)],
@@ -600,12 +594,12 @@ class SensorApi:
600
594
  _content_type: Optional[StrictStr] = None,
601
595
  _headers: Optional[Dict[StrictStr, Any]] = None,
602
596
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
603
- ) -> Model:
604
- """Create a Sensor
597
+ ) -> SensorQueryResponse:
598
+ """Query a Sensor
605
599
 
606
600
 
607
- :param create_sensor_request: Request body for create (required)
608
- :type create_sensor_request: CreateSensorRequest
601
+ :param sensor_sor_query_request: Request body for create
602
+ :type sensor_sor_query_request: SensorSORQueryRequest
609
603
  :param _request_timeout: timeout setting for this request. If one
610
604
  number provided, it will be total request
611
605
  timeout. It can also be a pair (tuple) of
@@ -628,8 +622,8 @@ class SensorApi:
628
622
  :return: Returns the result object.
629
623
  """ # noqa: E501
630
624
 
631
- _param = self._create_sensor_serialize(
632
- create_sensor_request=create_sensor_request,
625
+ _param = self._query_sensor_serialize(
626
+ sensor_sor_query_request=sensor_sor_query_request,
633
627
  _request_auth=_request_auth,
634
628
  _content_type=_content_type,
635
629
  _headers=_headers,
@@ -637,9 +631,8 @@ class SensorApi:
637
631
  )
638
632
 
639
633
  _response_types_map: Dict[str, Optional[str]] = {
640
- '201': "Model",
634
+ '200': "SensorQueryResponse",
641
635
  '400': None,
642
- '422': "ValidationErrorModel",
643
636
  }
644
637
  response_data = self.api_client.call_api(
645
638
  *_param,
@@ -653,9 +646,9 @@ class SensorApi:
653
646
 
654
647
 
655
648
  @validate_call
656
- def create_sensor_with_http_info(
649
+ def query_sensor_with_http_info(
657
650
  self,
658
- create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
651
+ sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
659
652
  _request_timeout: Union[
660
653
  None,
661
654
  Annotated[StrictFloat, Field(gt=0)],
@@ -668,12 +661,12 @@ class SensorApi:
668
661
  _content_type: Optional[StrictStr] = None,
669
662
  _headers: Optional[Dict[StrictStr, Any]] = None,
670
663
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
671
- ) -> ApiResponse[Model]:
672
- """Create a Sensor
664
+ ) -> ApiResponse[SensorQueryResponse]:
665
+ """Query a Sensor
673
666
 
674
667
 
675
- :param create_sensor_request: Request body for create (required)
676
- :type create_sensor_request: CreateSensorRequest
668
+ :param sensor_sor_query_request: Request body for create
669
+ :type sensor_sor_query_request: SensorSORQueryRequest
677
670
  :param _request_timeout: timeout setting for this request. If one
678
671
  number provided, it will be total request
679
672
  timeout. It can also be a pair (tuple) of
@@ -696,8 +689,8 @@ class SensorApi:
696
689
  :return: Returns the result object.
697
690
  """ # noqa: E501
698
691
 
699
- _param = self._create_sensor_serialize(
700
- create_sensor_request=create_sensor_request,
692
+ _param = self._query_sensor_serialize(
693
+ sensor_sor_query_request=sensor_sor_query_request,
701
694
  _request_auth=_request_auth,
702
695
  _content_type=_content_type,
703
696
  _headers=_headers,
@@ -705,9 +698,8 @@ class SensorApi:
705
698
  )
706
699
 
707
700
  _response_types_map: Dict[str, Optional[str]] = {
708
- '201': "Model",
701
+ '200': "SensorQueryResponse",
709
702
  '400': None,
710
- '422': "ValidationErrorModel",
711
703
  }
712
704
  response_data = self.api_client.call_api(
713
705
  *_param,
@@ -721,9 +713,9 @@ class SensorApi:
721
713
 
722
714
 
723
715
  @validate_call
724
- def create_sensor_without_preload_content(
716
+ def query_sensor_without_preload_content(
725
717
  self,
726
- create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
718
+ sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
727
719
  _request_timeout: Union[
728
720
  None,
729
721
  Annotated[StrictFloat, Field(gt=0)],
@@ -737,11 +729,11 @@ class SensorApi:
737
729
  _headers: Optional[Dict[StrictStr, Any]] = None,
738
730
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
739
731
  ) -> RESTResponseType:
740
- """Create a Sensor
732
+ """Query a Sensor
741
733
 
742
734
 
743
- :param create_sensor_request: Request body for create (required)
744
- :type create_sensor_request: CreateSensorRequest
735
+ :param sensor_sor_query_request: Request body for create
736
+ :type sensor_sor_query_request: SensorSORQueryRequest
745
737
  :param _request_timeout: timeout setting for this request. If one
746
738
  number provided, it will be total request
747
739
  timeout. It can also be a pair (tuple) of
@@ -764,8 +756,8 @@ class SensorApi:
764
756
  :return: Returns the result object.
765
757
  """ # noqa: E501
766
758
 
767
- _param = self._create_sensor_serialize(
768
- create_sensor_request=create_sensor_request,
759
+ _param = self._query_sensor_serialize(
760
+ sensor_sor_query_request=sensor_sor_query_request,
769
761
  _request_auth=_request_auth,
770
762
  _content_type=_content_type,
771
763
  _headers=_headers,
@@ -773,9 +765,8 @@ class SensorApi:
773
765
  )
774
766
 
775
767
  _response_types_map: Dict[str, Optional[str]] = {
776
- '201': "Model",
768
+ '200': "SensorQueryResponse",
777
769
  '400': None,
778
- '422': "ValidationErrorModel",
779
770
  }
780
771
  response_data = self.api_client.call_api(
781
772
  *_param,
@@ -784,9 +775,9 @@ class SensorApi:
784
775
  return response_data.response
785
776
 
786
777
 
787
- def _create_sensor_serialize(
778
+ def _query_sensor_serialize(
788
779
  self,
789
- create_sensor_request,
780
+ sensor_sor_query_request,
790
781
  _request_auth,
791
782
  _content_type,
792
783
  _headers,
@@ -810,8 +801,8 @@ class SensorApi:
810
801
  # process the header parameters
811
802
  # process the form parameters
812
803
  # process the body parameter
813
- if create_sensor_request is not None:
814
- _body_params = create_sensor_request
804
+ if sensor_sor_query_request is not None:
805
+ _body_params = sensor_sor_query_request
815
806
 
816
807
 
817
808
  # set the HTTP header `Accept`
@@ -842,7 +833,7 @@ class SensorApi:
842
833
 
843
834
  return self.api_client.param_serialize(
844
835
  method='POST',
845
- resource_path='/api/v2/sensors/create',
836
+ resource_path='/api/v2/sensors/query',
846
837
  path_params=_path_params,
847
838
  query_params=_query_params,
848
839
  header_params=_header_params,
@@ -859,9 +850,13 @@ class SensorApi:
859
850
 
860
851
 
861
852
  @validate_call
862
- def delete_model(
853
+ def sensor_sor_api_v3_model_cards_query_get(
863
854
  self,
864
- sensor_id: StrictStr,
855
+ model_name_eq: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
856
+ model_name_contains: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
857
+ limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
858
+ offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
859
+ sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)")] = None,
865
860
  _request_timeout: Union[
866
861
  None,
867
862
  Annotated[StrictFloat, Field(gt=0)],
@@ -874,12 +869,20 @@ class SensorApi:
874
869
  _content_type: Optional[StrictStr] = None,
875
870
  _headers: Optional[Dict[StrictStr, Any]] = None,
876
871
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
877
- ) -> None:
878
- """Remove an Adhoc Sensor
872
+ ) -> SensorSORModelCardQueryResponse:
873
+ """List Model Cards
879
874
 
880
875
 
881
- :param sensor_id: (required)
882
- :type sensor_id: str
876
+ :param model_name_eq: substring match on model name
877
+ :type model_name_eq: str
878
+ :param model_name_contains: substring match on model name
879
+ :type model_name_contains: str
880
+ :param limit:
881
+ :type limit: int
882
+ :param offset:
883
+ :type offset: int
884
+ :param sort: allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)
885
+ :type sort: str
883
886
  :param _request_timeout: timeout setting for this request. If one
884
887
  number provided, it will be total request
885
888
  timeout. It can also be a pair (tuple) of
@@ -902,8 +905,12 @@ class SensorApi:
902
905
  :return: Returns the result object.
903
906
  """ # noqa: E501
904
907
 
905
- _param = self._delete_model_serialize(
906
- sensor_id=sensor_id,
908
+ _param = self._sensor_sor_api_v3_model_cards_query_get_serialize(
909
+ model_name_eq=model_name_eq,
910
+ model_name_contains=model_name_contains,
911
+ limit=limit,
912
+ offset=offset,
913
+ sort=sort,
907
914
  _request_auth=_request_auth,
908
915
  _content_type=_content_type,
909
916
  _headers=_headers,
@@ -911,9 +918,8 @@ class SensorApi:
911
918
  )
912
919
 
913
920
  _response_types_map: Dict[str, Optional[str]] = {
914
- '204': None,
921
+ '200': "SensorSORModelCardQueryResponse",
915
922
  '400': None,
916
- '404': None,
917
923
  }
918
924
  response_data = self.api_client.call_api(
919
925
  *_param,
@@ -927,9 +933,13 @@ class SensorApi:
927
933
 
928
934
 
929
935
  @validate_call
930
- def delete_model_with_http_info(
936
+ def sensor_sor_api_v3_model_cards_query_get_with_http_info(
931
937
  self,
932
- sensor_id: StrictStr,
938
+ model_name_eq: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
939
+ model_name_contains: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
940
+ limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
941
+ offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
942
+ sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)")] = None,
933
943
  _request_timeout: Union[
934
944
  None,
935
945
  Annotated[StrictFloat, Field(gt=0)],
@@ -942,12 +952,20 @@ class SensorApi:
942
952
  _content_type: Optional[StrictStr] = None,
943
953
  _headers: Optional[Dict[StrictStr, Any]] = None,
944
954
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
945
- ) -> ApiResponse[None]:
946
- """Remove an Adhoc Sensor
955
+ ) -> ApiResponse[SensorSORModelCardQueryResponse]:
956
+ """List Model Cards
947
957
 
948
958
 
949
- :param sensor_id: (required)
950
- :type sensor_id: str
959
+ :param model_name_eq: substring match on model name
960
+ :type model_name_eq: str
961
+ :param model_name_contains: substring match on model name
962
+ :type model_name_contains: str
963
+ :param limit:
964
+ :type limit: int
965
+ :param offset:
966
+ :type offset: int
967
+ :param sort: allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)
968
+ :type sort: str
951
969
  :param _request_timeout: timeout setting for this request. If one
952
970
  number provided, it will be total request
953
971
  timeout. It can also be a pair (tuple) of
@@ -970,8 +988,12 @@ class SensorApi:
970
988
  :return: Returns the result object.
971
989
  """ # noqa: E501
972
990
 
973
- _param = self._delete_model_serialize(
974
- sensor_id=sensor_id,
991
+ _param = self._sensor_sor_api_v3_model_cards_query_get_serialize(
992
+ model_name_eq=model_name_eq,
993
+ model_name_contains=model_name_contains,
994
+ limit=limit,
995
+ offset=offset,
996
+ sort=sort,
975
997
  _request_auth=_request_auth,
976
998
  _content_type=_content_type,
977
999
  _headers=_headers,
@@ -979,9 +1001,8 @@ class SensorApi:
979
1001
  )
980
1002
 
981
1003
  _response_types_map: Dict[str, Optional[str]] = {
982
- '204': None,
1004
+ '200': "SensorSORModelCardQueryResponse",
983
1005
  '400': None,
984
- '404': None,
985
1006
  }
986
1007
  response_data = self.api_client.call_api(
987
1008
  *_param,
@@ -995,9 +1016,13 @@ class SensorApi:
995
1016
 
996
1017
 
997
1018
  @validate_call
998
- def delete_model_without_preload_content(
1019
+ def sensor_sor_api_v3_model_cards_query_get_without_preload_content(
999
1020
  self,
1000
- sensor_id: StrictStr,
1021
+ model_name_eq: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1022
+ model_name_contains: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1023
+ limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
1024
+ offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
1025
+ sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)")] = None,
1001
1026
  _request_timeout: Union[
1002
1027
  None,
1003
1028
  Annotated[StrictFloat, Field(gt=0)],
@@ -1011,11 +1036,19 @@ class SensorApi:
1011
1036
  _headers: Optional[Dict[StrictStr, Any]] = None,
1012
1037
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1013
1038
  ) -> RESTResponseType:
1014
- """Remove an Adhoc Sensor
1039
+ """List Model Cards
1015
1040
 
1016
1041
 
1017
- :param sensor_id: (required)
1018
- :type sensor_id: str
1042
+ :param model_name_eq: substring match on model name
1043
+ :type model_name_eq: str
1044
+ :param model_name_contains: substring match on model name
1045
+ :type model_name_contains: str
1046
+ :param limit:
1047
+ :type limit: int
1048
+ :param offset:
1049
+ :type offset: int
1050
+ :param sort: allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)
1051
+ :type sort: str
1019
1052
  :param _request_timeout: timeout setting for this request. If one
1020
1053
  number provided, it will be total request
1021
1054
  timeout. It can also be a pair (tuple) of
@@ -1038,8 +1071,12 @@ class SensorApi:
1038
1071
  :return: Returns the result object.
1039
1072
  """ # noqa: E501
1040
1073
 
1041
- _param = self._delete_model_serialize(
1042
- sensor_id=sensor_id,
1074
+ _param = self._sensor_sor_api_v3_model_cards_query_get_serialize(
1075
+ model_name_eq=model_name_eq,
1076
+ model_name_contains=model_name_contains,
1077
+ limit=limit,
1078
+ offset=offset,
1079
+ sort=sort,
1043
1080
  _request_auth=_request_auth,
1044
1081
  _content_type=_content_type,
1045
1082
  _headers=_headers,
@@ -1047,9 +1084,8 @@ class SensorApi:
1047
1084
  )
1048
1085
 
1049
1086
  _response_types_map: Dict[str, Optional[str]] = {
1050
- '204': None,
1087
+ '200': "SensorSORModelCardQueryResponse",
1051
1088
  '400': None,
1052
- '404': None,
1053
1089
  }
1054
1090
  response_data = self.api_client.call_api(
1055
1091
  *_param,
@@ -1058,9 +1094,13 @@ class SensorApi:
1058
1094
  return response_data.response
1059
1095
 
1060
1096
 
1061
- def _delete_model_serialize(
1097
+ def _sensor_sor_api_v3_model_cards_query_get_serialize(
1062
1098
  self,
1063
- sensor_id,
1099
+ model_name_eq,
1100
+ model_name_contains,
1101
+ limit,
1102
+ offset,
1103
+ sort,
1064
1104
  _request_auth,
1065
1105
  _content_type,
1066
1106
  _headers,
@@ -1080,874 +1120,38 @@ class SensorApi:
1080
1120
  _body_params: Optional[bytes] = None
1081
1121
 
1082
1122
  # process the path parameters
1083
- if sensor_id is not None:
1084
- _path_params['sensor_id'] = sensor_id
1085
1123
  # process the query parameters
1124
+ if model_name_eq is not None:
1125
+
1126
+ _query_params.append(('model_name[eq]', model_name_eq))
1127
+
1128
+ if model_name_contains is not None:
1129
+
1130
+ _query_params.append(('model_name[contains]', model_name_contains))
1131
+
1132
+ if limit is not None:
1133
+
1134
+ _query_params.append(('limit', limit))
1135
+
1136
+ if offset is not None:
1137
+
1138
+ _query_params.append(('offset', offset))
1139
+
1140
+ if sort is not None:
1141
+
1142
+ _query_params.append(('sort', sort))
1143
+
1086
1144
  # process the header parameters
1087
1145
  # process the form parameters
1088
1146
  # process the body parameter
1089
1147
 
1090
1148
 
1091
-
1092
-
1093
- # authentication setting
1094
- _auth_settings: List[str] = [
1095
- 'BearerAuth'
1096
- ]
1097
-
1098
- return self.api_client.param_serialize(
1099
- method='DELETE',
1100
- resource_path='/api/v2/sensors/{sensor_id}',
1101
- path_params=_path_params,
1102
- query_params=_query_params,
1103
- header_params=_header_params,
1104
- body=_body_params,
1105
- post_params=_form_params,
1106
- files=_files,
1107
- auth_settings=_auth_settings,
1108
- collection_formats=_collection_formats,
1109
- _host=_host,
1110
- _request_auth=_request_auth
1111
- )
1112
-
1113
-
1114
-
1115
-
1116
- @validate_call
1117
- def get_model(
1118
- self,
1119
- sensor_id: StrictStr,
1120
- _request_timeout: Union[
1121
- None,
1122
- Annotated[StrictFloat, Field(gt=0)],
1123
- Tuple[
1124
- Annotated[StrictFloat, Field(gt=0)],
1125
- Annotated[StrictFloat, Field(gt=0)]
1126
- ]
1127
- ] = None,
1128
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1129
- _content_type: Optional[StrictStr] = None,
1130
- _headers: Optional[Dict[StrictStr, Any]] = None,
1131
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1132
- ) -> Model:
1133
- """Get Model
1134
-
1135
-
1136
- :param sensor_id: (required)
1137
- :type sensor_id: str
1138
- :param _request_timeout: timeout setting for this request. If one
1139
- number provided, it will be total request
1140
- timeout. It can also be a pair (tuple) of
1141
- (connection, read) timeouts.
1142
- :type _request_timeout: int, tuple(int, int), optional
1143
- :param _request_auth: set to override the auth_settings for an a single
1144
- request; this effectively ignores the
1145
- authentication in the spec for a single request.
1146
- :type _request_auth: dict, optional
1147
- :param _content_type: force content-type for the request.
1148
- :type _content_type: str, Optional
1149
- :param _headers: set to override the headers for a single
1150
- request; this effectively ignores the headers
1151
- in the spec for a single request.
1152
- :type _headers: dict, optional
1153
- :param _host_index: set to override the host_index for a single
1154
- request; this effectively ignores the host_index
1155
- in the spec for a single request.
1156
- :type _host_index: int, optional
1157
- :return: Returns the result object.
1158
- """ # noqa: E501
1159
-
1160
- _param = self._get_model_serialize(
1161
- sensor_id=sensor_id,
1162
- _request_auth=_request_auth,
1163
- _content_type=_content_type,
1164
- _headers=_headers,
1165
- _host_index=_host_index
1166
- )
1167
-
1168
- _response_types_map: Dict[str, Optional[str]] = {
1169
- '200': "Model",
1170
- '400': None,
1171
- '404': None,
1172
- }
1173
- response_data = self.api_client.call_api(
1174
- *_param,
1175
- _request_timeout=_request_timeout
1176
- )
1177
- response_data.read()
1178
- return self.api_client.response_deserialize(
1179
- response_data=response_data,
1180
- response_types_map=_response_types_map,
1181
- ).data
1182
-
1183
-
1184
- @validate_call
1185
- def get_model_with_http_info(
1186
- self,
1187
- sensor_id: StrictStr,
1188
- _request_timeout: Union[
1189
- None,
1190
- Annotated[StrictFloat, Field(gt=0)],
1191
- Tuple[
1192
- Annotated[StrictFloat, Field(gt=0)],
1193
- Annotated[StrictFloat, Field(gt=0)]
1194
- ]
1195
- ] = None,
1196
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1197
- _content_type: Optional[StrictStr] = None,
1198
- _headers: Optional[Dict[StrictStr, Any]] = None,
1199
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1200
- ) -> ApiResponse[Model]:
1201
- """Get Model
1202
-
1203
-
1204
- :param sensor_id: (required)
1205
- :type sensor_id: str
1206
- :param _request_timeout: timeout setting for this request. If one
1207
- number provided, it will be total request
1208
- timeout. It can also be a pair (tuple) of
1209
- (connection, read) timeouts.
1210
- :type _request_timeout: int, tuple(int, int), optional
1211
- :param _request_auth: set to override the auth_settings for an a single
1212
- request; this effectively ignores the
1213
- authentication in the spec for a single request.
1214
- :type _request_auth: dict, optional
1215
- :param _content_type: force content-type for the request.
1216
- :type _content_type: str, Optional
1217
- :param _headers: set to override the headers for a single
1218
- request; this effectively ignores the headers
1219
- in the spec for a single request.
1220
- :type _headers: dict, optional
1221
- :param _host_index: set to override the host_index for a single
1222
- request; this effectively ignores the host_index
1223
- in the spec for a single request.
1224
- :type _host_index: int, optional
1225
- :return: Returns the result object.
1226
- """ # noqa: E501
1227
-
1228
- _param = self._get_model_serialize(
1229
- sensor_id=sensor_id,
1230
- _request_auth=_request_auth,
1231
- _content_type=_content_type,
1232
- _headers=_headers,
1233
- _host_index=_host_index
1234
- )
1235
-
1236
- _response_types_map: Dict[str, Optional[str]] = {
1237
- '200': "Model",
1238
- '400': None,
1239
- '404': None,
1240
- }
1241
- response_data = self.api_client.call_api(
1242
- *_param,
1243
- _request_timeout=_request_timeout
1244
- )
1245
- response_data.read()
1246
- return self.api_client.response_deserialize(
1247
- response_data=response_data,
1248
- response_types_map=_response_types_map,
1249
- )
1250
-
1251
-
1252
- @validate_call
1253
- def get_model_without_preload_content(
1254
- self,
1255
- sensor_id: StrictStr,
1256
- _request_timeout: Union[
1257
- None,
1258
- Annotated[StrictFloat, Field(gt=0)],
1259
- Tuple[
1260
- Annotated[StrictFloat, Field(gt=0)],
1261
- Annotated[StrictFloat, Field(gt=0)]
1262
- ]
1263
- ] = None,
1264
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1265
- _content_type: Optional[StrictStr] = None,
1266
- _headers: Optional[Dict[StrictStr, Any]] = None,
1267
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1268
- ) -> RESTResponseType:
1269
- """Get Model
1270
-
1271
-
1272
- :param sensor_id: (required)
1273
- :type sensor_id: str
1274
- :param _request_timeout: timeout setting for this request. If one
1275
- number provided, it will be total request
1276
- timeout. It can also be a pair (tuple) of
1277
- (connection, read) timeouts.
1278
- :type _request_timeout: int, tuple(int, int), optional
1279
- :param _request_auth: set to override the auth_settings for an a single
1280
- request; this effectively ignores the
1281
- authentication in the spec for a single request.
1282
- :type _request_auth: dict, optional
1283
- :param _content_type: force content-type for the request.
1284
- :type _content_type: str, Optional
1285
- :param _headers: set to override the headers for a single
1286
- request; this effectively ignores the headers
1287
- in the spec for a single request.
1288
- :type _headers: dict, optional
1289
- :param _host_index: set to override the host_index for a single
1290
- request; this effectively ignores the host_index
1291
- in the spec for a single request.
1292
- :type _host_index: int, optional
1293
- :return: Returns the result object.
1294
- """ # noqa: E501
1295
-
1296
- _param = self._get_model_serialize(
1297
- sensor_id=sensor_id,
1298
- _request_auth=_request_auth,
1299
- _content_type=_content_type,
1300
- _headers=_headers,
1301
- _host_index=_host_index
1302
- )
1303
-
1304
- _response_types_map: Dict[str, Optional[str]] = {
1305
- '200': "Model",
1306
- '400': None,
1307
- '404': None,
1308
- }
1309
- response_data = self.api_client.call_api(
1310
- *_param,
1311
- _request_timeout=_request_timeout
1312
- )
1313
- return response_data.response
1314
-
1315
-
1316
- def _get_model_serialize(
1317
- self,
1318
- sensor_id,
1319
- _request_auth,
1320
- _content_type,
1321
- _headers,
1322
- _host_index,
1323
- ) -> RequestSerialized:
1324
-
1325
- _host = None
1326
-
1327
- _collection_formats: Dict[str, str] = {
1328
- }
1329
-
1330
- _path_params: Dict[str, str] = {}
1331
- _query_params: List[Tuple[str, str]] = []
1332
- _header_params: Dict[str, Optional[str]] = _headers or {}
1333
- _form_params: List[Tuple[str, str]] = []
1334
- _files: Dict[str, Union[str, bytes]] = {}
1335
- _body_params: Optional[bytes] = None
1336
-
1337
- # process the path parameters
1338
- if sensor_id is not None:
1339
- _path_params['sensor_id'] = sensor_id
1340
- # process the query parameters
1341
- # process the header parameters
1342
- # process the form parameters
1343
- # process the body parameter
1344
-
1345
-
1346
- # set the HTTP header `Accept`
1347
- _header_params['Accept'] = self.api_client.select_header_accept(
1348
- [
1349
- 'application/json'
1350
- ]
1351
- )
1352
-
1353
-
1354
- # authentication setting
1355
- _auth_settings: List[str] = [
1356
- 'BearerAuth'
1357
- ]
1358
-
1359
- return self.api_client.param_serialize(
1360
- method='GET',
1361
- resource_path='/api/v2/sensors/{sensor_id}',
1362
- path_params=_path_params,
1363
- query_params=_query_params,
1364
- header_params=_header_params,
1365
- body=_body_params,
1366
- post_params=_form_params,
1367
- files=_files,
1368
- auth_settings=_auth_settings,
1369
- collection_formats=_collection_formats,
1370
- _host=_host,
1371
- _request_auth=_request_auth
1372
- )
1373
-
1374
-
1375
-
1376
-
1377
- @validate_call
1378
- def query_sensor(
1379
- self,
1380
- sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
1381
- _request_timeout: Union[
1382
- None,
1383
- Annotated[StrictFloat, Field(gt=0)],
1384
- Tuple[
1385
- Annotated[StrictFloat, Field(gt=0)],
1386
- Annotated[StrictFloat, Field(gt=0)]
1387
- ]
1388
- ] = None,
1389
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1390
- _content_type: Optional[StrictStr] = None,
1391
- _headers: Optional[Dict[StrictStr, Any]] = None,
1392
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1393
- ) -> ModelQueryResponse:
1394
- """Query a Sensor
1395
-
1396
-
1397
- :param sensor_sor_query_request: Request body for create
1398
- :type sensor_sor_query_request: SensorSORQueryRequest
1399
- :param _request_timeout: timeout setting for this request. If one
1400
- number provided, it will be total request
1401
- timeout. It can also be a pair (tuple) of
1402
- (connection, read) timeouts.
1403
- :type _request_timeout: int, tuple(int, int), optional
1404
- :param _request_auth: set to override the auth_settings for an a single
1405
- request; this effectively ignores the
1406
- authentication in the spec for a single request.
1407
- :type _request_auth: dict, optional
1408
- :param _content_type: force content-type for the request.
1409
- :type _content_type: str, Optional
1410
- :param _headers: set to override the headers for a single
1411
- request; this effectively ignores the headers
1412
- in the spec for a single request.
1413
- :type _headers: dict, optional
1414
- :param _host_index: set to override the host_index for a single
1415
- request; this effectively ignores the host_index
1416
- in the spec for a single request.
1417
- :type _host_index: int, optional
1418
- :return: Returns the result object.
1419
- """ # noqa: E501
1420
-
1421
- _param = self._query_sensor_serialize(
1422
- sensor_sor_query_request=sensor_sor_query_request,
1423
- _request_auth=_request_auth,
1424
- _content_type=_content_type,
1425
- _headers=_headers,
1426
- _host_index=_host_index
1427
- )
1428
-
1429
- _response_types_map: Dict[str, Optional[str]] = {
1430
- '200': "ModelQueryResponse",
1431
- '400': None,
1432
- }
1433
- response_data = self.api_client.call_api(
1434
- *_param,
1435
- _request_timeout=_request_timeout
1436
- )
1437
- response_data.read()
1438
- return self.api_client.response_deserialize(
1439
- response_data=response_data,
1440
- response_types_map=_response_types_map,
1441
- ).data
1442
-
1443
-
1444
- @validate_call
1445
- def query_sensor_with_http_info(
1446
- self,
1447
- sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
1448
- _request_timeout: Union[
1449
- None,
1450
- Annotated[StrictFloat, Field(gt=0)],
1451
- Tuple[
1452
- Annotated[StrictFloat, Field(gt=0)],
1453
- Annotated[StrictFloat, Field(gt=0)]
1454
- ]
1455
- ] = None,
1456
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1457
- _content_type: Optional[StrictStr] = None,
1458
- _headers: Optional[Dict[StrictStr, Any]] = None,
1459
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1460
- ) -> ApiResponse[ModelQueryResponse]:
1461
- """Query a Sensor
1462
-
1463
-
1464
- :param sensor_sor_query_request: Request body for create
1465
- :type sensor_sor_query_request: SensorSORQueryRequest
1466
- :param _request_timeout: timeout setting for this request. If one
1467
- number provided, it will be total request
1468
- timeout. It can also be a pair (tuple) of
1469
- (connection, read) timeouts.
1470
- :type _request_timeout: int, tuple(int, int), optional
1471
- :param _request_auth: set to override the auth_settings for an a single
1472
- request; this effectively ignores the
1473
- authentication in the spec for a single request.
1474
- :type _request_auth: dict, optional
1475
- :param _content_type: force content-type for the request.
1476
- :type _content_type: str, Optional
1477
- :param _headers: set to override the headers for a single
1478
- request; this effectively ignores the headers
1479
- in the spec for a single request.
1480
- :type _headers: dict, optional
1481
- :param _host_index: set to override the host_index for a single
1482
- request; this effectively ignores the host_index
1483
- in the spec for a single request.
1484
- :type _host_index: int, optional
1485
- :return: Returns the result object.
1486
- """ # noqa: E501
1487
-
1488
- _param = self._query_sensor_serialize(
1489
- sensor_sor_query_request=sensor_sor_query_request,
1490
- _request_auth=_request_auth,
1491
- _content_type=_content_type,
1492
- _headers=_headers,
1493
- _host_index=_host_index
1494
- )
1495
-
1496
- _response_types_map: Dict[str, Optional[str]] = {
1497
- '200': "ModelQueryResponse",
1498
- '400': None,
1499
- }
1500
- response_data = self.api_client.call_api(
1501
- *_param,
1502
- _request_timeout=_request_timeout
1503
- )
1504
- response_data.read()
1505
- return self.api_client.response_deserialize(
1506
- response_data=response_data,
1507
- response_types_map=_response_types_map,
1508
- )
1509
-
1510
-
1511
- @validate_call
1512
- def query_sensor_without_preload_content(
1513
- self,
1514
- sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
1515
- _request_timeout: Union[
1516
- None,
1517
- Annotated[StrictFloat, Field(gt=0)],
1518
- Tuple[
1519
- Annotated[StrictFloat, Field(gt=0)],
1520
- Annotated[StrictFloat, Field(gt=0)]
1521
- ]
1522
- ] = None,
1523
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1524
- _content_type: Optional[StrictStr] = None,
1525
- _headers: Optional[Dict[StrictStr, Any]] = None,
1526
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1527
- ) -> RESTResponseType:
1528
- """Query a Sensor
1529
-
1530
-
1531
- :param sensor_sor_query_request: Request body for create
1532
- :type sensor_sor_query_request: SensorSORQueryRequest
1533
- :param _request_timeout: timeout setting for this request. If one
1534
- number provided, it will be total request
1535
- timeout. It can also be a pair (tuple) of
1536
- (connection, read) timeouts.
1537
- :type _request_timeout: int, tuple(int, int), optional
1538
- :param _request_auth: set to override the auth_settings for an a single
1539
- request; this effectively ignores the
1540
- authentication in the spec for a single request.
1541
- :type _request_auth: dict, optional
1542
- :param _content_type: force content-type for the request.
1543
- :type _content_type: str, Optional
1544
- :param _headers: set to override the headers for a single
1545
- request; this effectively ignores the headers
1546
- in the spec for a single request.
1547
- :type _headers: dict, optional
1548
- :param _host_index: set to override the host_index for a single
1549
- request; this effectively ignores the host_index
1550
- in the spec for a single request.
1551
- :type _host_index: int, optional
1552
- :return: Returns the result object.
1553
- """ # noqa: E501
1554
-
1555
- _param = self._query_sensor_serialize(
1556
- sensor_sor_query_request=sensor_sor_query_request,
1557
- _request_auth=_request_auth,
1558
- _content_type=_content_type,
1559
- _headers=_headers,
1560
- _host_index=_host_index
1561
- )
1562
-
1563
- _response_types_map: Dict[str, Optional[str]] = {
1564
- '200': "ModelQueryResponse",
1565
- '400': None,
1566
- }
1567
- response_data = self.api_client.call_api(
1568
- *_param,
1569
- _request_timeout=_request_timeout
1570
- )
1571
- return response_data.response
1572
-
1573
-
1574
- def _query_sensor_serialize(
1575
- self,
1576
- sensor_sor_query_request,
1577
- _request_auth,
1578
- _content_type,
1579
- _headers,
1580
- _host_index,
1581
- ) -> RequestSerialized:
1582
-
1583
- _host = None
1584
-
1585
- _collection_formats: Dict[str, str] = {
1586
- }
1587
-
1588
- _path_params: Dict[str, str] = {}
1589
- _query_params: List[Tuple[str, str]] = []
1590
- _header_params: Dict[str, Optional[str]] = _headers or {}
1591
- _form_params: List[Tuple[str, str]] = []
1592
- _files: Dict[str, Union[str, bytes]] = {}
1593
- _body_params: Optional[bytes] = None
1594
-
1595
- # process the path parameters
1596
- # process the query parameters
1597
- # process the header parameters
1598
- # process the form parameters
1599
- # process the body parameter
1600
- if sensor_sor_query_request is not None:
1601
- _body_params = sensor_sor_query_request
1602
-
1603
-
1604
- # set the HTTP header `Accept`
1605
- _header_params['Accept'] = self.api_client.select_header_accept(
1606
- [
1607
- 'application/json'
1608
- ]
1609
- )
1610
-
1611
- # set the HTTP header `Content-Type`
1612
- if _content_type:
1613
- _header_params['Content-Type'] = _content_type
1614
- else:
1615
- _default_content_type = (
1616
- self.api_client.select_header_content_type(
1617
- [
1618
- 'application/json'
1619
- ]
1620
- )
1621
- )
1622
- if _default_content_type is not None:
1623
- _header_params['Content-Type'] = _default_content_type
1624
-
1625
- # authentication setting
1626
- _auth_settings: List[str] = [
1627
- 'BearerAuth'
1628
- ]
1629
-
1630
- return self.api_client.param_serialize(
1631
- method='POST',
1632
- resource_path='/api/v2/sensors/query',
1633
- path_params=_path_params,
1634
- query_params=_query_params,
1635
- header_params=_header_params,
1636
- body=_body_params,
1637
- post_params=_form_params,
1638
- files=_files,
1639
- auth_settings=_auth_settings,
1640
- collection_formats=_collection_formats,
1641
- _host=_host,
1642
- _request_auth=_request_auth
1643
- )
1644
-
1645
-
1646
-
1647
-
1648
- @validate_call
1649
- def sensor_sor_api_v3_model_cards_query_get(
1650
- self,
1651
- model_name_eq: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1652
- model_name_contains: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1653
- limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
1654
- offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
1655
- sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)")] = None,
1656
- _request_timeout: Union[
1657
- None,
1658
- Annotated[StrictFloat, Field(gt=0)],
1659
- Tuple[
1660
- Annotated[StrictFloat, Field(gt=0)],
1661
- Annotated[StrictFloat, Field(gt=0)]
1662
- ]
1663
- ] = None,
1664
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1665
- _content_type: Optional[StrictStr] = None,
1666
- _headers: Optional[Dict[StrictStr, Any]] = None,
1667
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1668
- ) -> SensorSORModelCardQueryResponse:
1669
- """List Model Cards
1670
-
1671
-
1672
- :param model_name_eq: substring match on model name
1673
- :type model_name_eq: str
1674
- :param model_name_contains: substring match on model name
1675
- :type model_name_contains: str
1676
- :param limit:
1677
- :type limit: int
1678
- :param offset:
1679
- :type offset: int
1680
- :param sort: allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)
1681
- :type sort: str
1682
- :param _request_timeout: timeout setting for this request. If one
1683
- number provided, it will be total request
1684
- timeout. It can also be a pair (tuple) of
1685
- (connection, read) timeouts.
1686
- :type _request_timeout: int, tuple(int, int), optional
1687
- :param _request_auth: set to override the auth_settings for an a single
1688
- request; this effectively ignores the
1689
- authentication in the spec for a single request.
1690
- :type _request_auth: dict, optional
1691
- :param _content_type: force content-type for the request.
1692
- :type _content_type: str, Optional
1693
- :param _headers: set to override the headers for a single
1694
- request; this effectively ignores the headers
1695
- in the spec for a single request.
1696
- :type _headers: dict, optional
1697
- :param _host_index: set to override the host_index for a single
1698
- request; this effectively ignores the host_index
1699
- in the spec for a single request.
1700
- :type _host_index: int, optional
1701
- :return: Returns the result object.
1702
- """ # noqa: E501
1703
-
1704
- _param = self._sensor_sor_api_v3_model_cards_query_get_serialize(
1705
- model_name_eq=model_name_eq,
1706
- model_name_contains=model_name_contains,
1707
- limit=limit,
1708
- offset=offset,
1709
- sort=sort,
1710
- _request_auth=_request_auth,
1711
- _content_type=_content_type,
1712
- _headers=_headers,
1713
- _host_index=_host_index
1714
- )
1715
-
1716
- _response_types_map: Dict[str, Optional[str]] = {
1717
- '200': "SensorSORModelCardQueryResponse",
1718
- '400': None,
1719
- }
1720
- response_data = self.api_client.call_api(
1721
- *_param,
1722
- _request_timeout=_request_timeout
1723
- )
1724
- response_data.read()
1725
- return self.api_client.response_deserialize(
1726
- response_data=response_data,
1727
- response_types_map=_response_types_map,
1728
- ).data
1729
-
1730
-
1731
- @validate_call
1732
- def sensor_sor_api_v3_model_cards_query_get_with_http_info(
1733
- self,
1734
- model_name_eq: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1735
- model_name_contains: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1736
- limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
1737
- offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
1738
- sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)")] = None,
1739
- _request_timeout: Union[
1740
- None,
1741
- Annotated[StrictFloat, Field(gt=0)],
1742
- Tuple[
1743
- Annotated[StrictFloat, Field(gt=0)],
1744
- Annotated[StrictFloat, Field(gt=0)]
1745
- ]
1746
- ] = None,
1747
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1748
- _content_type: Optional[StrictStr] = None,
1749
- _headers: Optional[Dict[StrictStr, Any]] = None,
1750
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1751
- ) -> ApiResponse[SensorSORModelCardQueryResponse]:
1752
- """List Model Cards
1753
-
1754
-
1755
- :param model_name_eq: substring match on model name
1756
- :type model_name_eq: str
1757
- :param model_name_contains: substring match on model name
1758
- :type model_name_contains: str
1759
- :param limit:
1760
- :type limit: int
1761
- :param offset:
1762
- :type offset: int
1763
- :param sort: allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)
1764
- :type sort: str
1765
- :param _request_timeout: timeout setting for this request. If one
1766
- number provided, it will be total request
1767
- timeout. It can also be a pair (tuple) of
1768
- (connection, read) timeouts.
1769
- :type _request_timeout: int, tuple(int, int), optional
1770
- :param _request_auth: set to override the auth_settings for an a single
1771
- request; this effectively ignores the
1772
- authentication in the spec for a single request.
1773
- :type _request_auth: dict, optional
1774
- :param _content_type: force content-type for the request.
1775
- :type _content_type: str, Optional
1776
- :param _headers: set to override the headers for a single
1777
- request; this effectively ignores the headers
1778
- in the spec for a single request.
1779
- :type _headers: dict, optional
1780
- :param _host_index: set to override the host_index for a single
1781
- request; this effectively ignores the host_index
1782
- in the spec for a single request.
1783
- :type _host_index: int, optional
1784
- :return: Returns the result object.
1785
- """ # noqa: E501
1786
-
1787
- _param = self._sensor_sor_api_v3_model_cards_query_get_serialize(
1788
- model_name_eq=model_name_eq,
1789
- model_name_contains=model_name_contains,
1790
- limit=limit,
1791
- offset=offset,
1792
- sort=sort,
1793
- _request_auth=_request_auth,
1794
- _content_type=_content_type,
1795
- _headers=_headers,
1796
- _host_index=_host_index
1797
- )
1798
-
1799
- _response_types_map: Dict[str, Optional[str]] = {
1800
- '200': "SensorSORModelCardQueryResponse",
1801
- '400': None,
1802
- }
1803
- response_data = self.api_client.call_api(
1804
- *_param,
1805
- _request_timeout=_request_timeout
1806
- )
1807
- response_data.read()
1808
- return self.api_client.response_deserialize(
1809
- response_data=response_data,
1810
- response_types_map=_response_types_map,
1811
- )
1812
-
1813
-
1814
- @validate_call
1815
- def sensor_sor_api_v3_model_cards_query_get_without_preload_content(
1816
- self,
1817
- model_name_eq: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1818
- model_name_contains: Annotated[Optional[StrictStr], Field(description="substring match on model name")] = None,
1819
- limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
1820
- offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
1821
- sort: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)")] = None,
1822
- _request_timeout: Union[
1823
- None,
1824
- Annotated[StrictFloat, Field(gt=0)],
1825
- Tuple[
1826
- Annotated[StrictFloat, Field(gt=0)],
1827
- Annotated[StrictFloat, Field(gt=0)]
1828
- ]
1829
- ] = None,
1830
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1831
- _content_type: Optional[StrictStr] = None,
1832
- _headers: Optional[Dict[StrictStr, Any]] = None,
1833
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1834
- ) -> RESTResponseType:
1835
- """List Model Cards
1836
-
1837
-
1838
- :param model_name_eq: substring match on model name
1839
- :type model_name_eq: str
1840
- :param model_name_contains: substring match on model name
1841
- :type model_name_contains: str
1842
- :param limit:
1843
- :type limit: int
1844
- :param offset:
1845
- :type offset: int
1846
- :param sort: allow sorting by model name or created at timestamp, ascending (+) or the default descending (-)
1847
- :type sort: str
1848
- :param _request_timeout: timeout setting for this request. If one
1849
- number provided, it will be total request
1850
- timeout. It can also be a pair (tuple) of
1851
- (connection, read) timeouts.
1852
- :type _request_timeout: int, tuple(int, int), optional
1853
- :param _request_auth: set to override the auth_settings for an a single
1854
- request; this effectively ignores the
1855
- authentication in the spec for a single request.
1856
- :type _request_auth: dict, optional
1857
- :param _content_type: force content-type for the request.
1858
- :type _content_type: str, Optional
1859
- :param _headers: set to override the headers for a single
1860
- request; this effectively ignores the headers
1861
- in the spec for a single request.
1862
- :type _headers: dict, optional
1863
- :param _host_index: set to override the host_index for a single
1864
- request; this effectively ignores the host_index
1865
- in the spec for a single request.
1866
- :type _host_index: int, optional
1867
- :return: Returns the result object.
1868
- """ # noqa: E501
1869
-
1870
- _param = self._sensor_sor_api_v3_model_cards_query_get_serialize(
1871
- model_name_eq=model_name_eq,
1872
- model_name_contains=model_name_contains,
1873
- limit=limit,
1874
- offset=offset,
1875
- sort=sort,
1876
- _request_auth=_request_auth,
1877
- _content_type=_content_type,
1878
- _headers=_headers,
1879
- _host_index=_host_index
1880
- )
1881
-
1882
- _response_types_map: Dict[str, Optional[str]] = {
1883
- '200': "SensorSORModelCardQueryResponse",
1884
- '400': None,
1885
- }
1886
- response_data = self.api_client.call_api(
1887
- *_param,
1888
- _request_timeout=_request_timeout
1889
- )
1890
- return response_data.response
1891
-
1892
-
1893
- def _sensor_sor_api_v3_model_cards_query_get_serialize(
1894
- self,
1895
- model_name_eq,
1896
- model_name_contains,
1897
- limit,
1898
- offset,
1899
- sort,
1900
- _request_auth,
1901
- _content_type,
1902
- _headers,
1903
- _host_index,
1904
- ) -> RequestSerialized:
1905
-
1906
- _host = None
1907
-
1908
- _collection_formats: Dict[str, str] = {
1909
- }
1910
-
1911
- _path_params: Dict[str, str] = {}
1912
- _query_params: List[Tuple[str, str]] = []
1913
- _header_params: Dict[str, Optional[str]] = _headers or {}
1914
- _form_params: List[Tuple[str, str]] = []
1915
- _files: Dict[str, Union[str, bytes]] = {}
1916
- _body_params: Optional[bytes] = None
1917
-
1918
- # process the path parameters
1919
- # process the query parameters
1920
- if model_name_eq is not None:
1921
-
1922
- _query_params.append(('model_name[eq]', model_name_eq))
1923
-
1924
- if model_name_contains is not None:
1925
-
1926
- _query_params.append(('model_name[contains]', model_name_contains))
1927
-
1928
- if limit is not None:
1929
-
1930
- _query_params.append(('limit', limit))
1931
-
1932
- if offset is not None:
1933
-
1934
- _query_params.append(('offset', offset))
1935
-
1936
- if sort is not None:
1937
-
1938
- _query_params.append(('sort', sort))
1939
-
1940
- # process the header parameters
1941
- # process the form parameters
1942
- # process the body parameter
1943
-
1944
-
1945
- # set the HTTP header `Accept`
1946
- _header_params['Accept'] = self.api_client.select_header_accept(
1947
- [
1948
- 'application/json'
1949
- ]
1950
- )
1149
+ # set the HTTP header `Accept`
1150
+ _header_params['Accept'] = self.api_client.select_header_accept(
1151
+ [
1152
+ 'application/json'
1153
+ ]
1154
+ )
1951
1155
 
1952
1156
 
1953
1157
  # authentication setting
@@ -1971,313 +1175,3 @@ class SensorApi:
1971
1175
  )
1972
1176
 
1973
1177
 
1974
-
1975
-
1976
- @validate_call
1977
- def upload_model_part(
1978
- self,
1979
- sensor_id: StrictStr,
1980
- upload_id: StrictStr,
1981
- part: StrictInt,
1982
- body: Optional[Any],
1983
- _request_timeout: Union[
1984
- None,
1985
- Annotated[StrictFloat, Field(gt=0)],
1986
- Tuple[
1987
- Annotated[StrictFloat, Field(gt=0)],
1988
- Annotated[StrictFloat, Field(gt=0)]
1989
- ]
1990
- ] = None,
1991
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1992
- _content_type: Optional[StrictStr] = None,
1993
- _headers: Optional[Dict[StrictStr, Any]] = None,
1994
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1995
- ) -> None:
1996
- """Upload part
1997
-
1998
-
1999
- :param sensor_id: (required)
2000
- :type sensor_id: str
2001
- :param upload_id: (required)
2002
- :type upload_id: str
2003
- :param part: (required)
2004
- :type part: int
2005
- :param body: (required)
2006
- :type body: object
2007
- :param _request_timeout: timeout setting for this request. If one
2008
- number provided, it will be total request
2009
- timeout. It can also be a pair (tuple) of
2010
- (connection, read) timeouts.
2011
- :type _request_timeout: int, tuple(int, int), optional
2012
- :param _request_auth: set to override the auth_settings for an a single
2013
- request; this effectively ignores the
2014
- authentication in the spec for a single request.
2015
- :type _request_auth: dict, optional
2016
- :param _content_type: force content-type for the request.
2017
- :type _content_type: str, Optional
2018
- :param _headers: set to override the headers for a single
2019
- request; this effectively ignores the headers
2020
- in the spec for a single request.
2021
- :type _headers: dict, optional
2022
- :param _host_index: set to override the host_index for a single
2023
- request; this effectively ignores the host_index
2024
- in the spec for a single request.
2025
- :type _host_index: int, optional
2026
- :return: Returns the result object.
2027
- """ # noqa: E501
2028
-
2029
- _param = self._upload_model_part_serialize(
2030
- sensor_id=sensor_id,
2031
- upload_id=upload_id,
2032
- part=part,
2033
- body=body,
2034
- _request_auth=_request_auth,
2035
- _content_type=_content_type,
2036
- _headers=_headers,
2037
- _host_index=_host_index
2038
- )
2039
-
2040
- _response_types_map: Dict[str, Optional[str]] = {
2041
- '200': None,
2042
- '400': None,
2043
- }
2044
- response_data = self.api_client.call_api(
2045
- *_param,
2046
- _request_timeout=_request_timeout
2047
- )
2048
- response_data.read()
2049
- return self.api_client.response_deserialize(
2050
- response_data=response_data,
2051
- response_types_map=_response_types_map,
2052
- ).data
2053
-
2054
-
2055
- @validate_call
2056
- def upload_model_part_with_http_info(
2057
- self,
2058
- sensor_id: StrictStr,
2059
- upload_id: StrictStr,
2060
- part: StrictInt,
2061
- body: Optional[Any],
2062
- _request_timeout: Union[
2063
- None,
2064
- Annotated[StrictFloat, Field(gt=0)],
2065
- Tuple[
2066
- Annotated[StrictFloat, Field(gt=0)],
2067
- Annotated[StrictFloat, Field(gt=0)]
2068
- ]
2069
- ] = None,
2070
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2071
- _content_type: Optional[StrictStr] = None,
2072
- _headers: Optional[Dict[StrictStr, Any]] = None,
2073
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2074
- ) -> ApiResponse[None]:
2075
- """Upload part
2076
-
2077
-
2078
- :param sensor_id: (required)
2079
- :type sensor_id: str
2080
- :param upload_id: (required)
2081
- :type upload_id: str
2082
- :param part: (required)
2083
- :type part: int
2084
- :param body: (required)
2085
- :type body: object
2086
- :param _request_timeout: timeout setting for this request. If one
2087
- number provided, it will be total request
2088
- timeout. It can also be a pair (tuple) of
2089
- (connection, read) timeouts.
2090
- :type _request_timeout: int, tuple(int, int), optional
2091
- :param _request_auth: set to override the auth_settings for an a single
2092
- request; this effectively ignores the
2093
- authentication in the spec for a single request.
2094
- :type _request_auth: dict, optional
2095
- :param _content_type: force content-type for the request.
2096
- :type _content_type: str, Optional
2097
- :param _headers: set to override the headers for a single
2098
- request; this effectively ignores the headers
2099
- in the spec for a single request.
2100
- :type _headers: dict, optional
2101
- :param _host_index: set to override the host_index for a single
2102
- request; this effectively ignores the host_index
2103
- in the spec for a single request.
2104
- :type _host_index: int, optional
2105
- :return: Returns the result object.
2106
- """ # noqa: E501
2107
-
2108
- _param = self._upload_model_part_serialize(
2109
- sensor_id=sensor_id,
2110
- upload_id=upload_id,
2111
- part=part,
2112
- body=body,
2113
- _request_auth=_request_auth,
2114
- _content_type=_content_type,
2115
- _headers=_headers,
2116
- _host_index=_host_index
2117
- )
2118
-
2119
- _response_types_map: Dict[str, Optional[str]] = {
2120
- '200': None,
2121
- '400': None,
2122
- }
2123
- response_data = self.api_client.call_api(
2124
- *_param,
2125
- _request_timeout=_request_timeout
2126
- )
2127
- response_data.read()
2128
- return self.api_client.response_deserialize(
2129
- response_data=response_data,
2130
- response_types_map=_response_types_map,
2131
- )
2132
-
2133
-
2134
- @validate_call
2135
- def upload_model_part_without_preload_content(
2136
- self,
2137
- sensor_id: StrictStr,
2138
- upload_id: StrictStr,
2139
- part: StrictInt,
2140
- body: Optional[Any],
2141
- _request_timeout: Union[
2142
- None,
2143
- Annotated[StrictFloat, Field(gt=0)],
2144
- Tuple[
2145
- Annotated[StrictFloat, Field(gt=0)],
2146
- Annotated[StrictFloat, Field(gt=0)]
2147
- ]
2148
- ] = None,
2149
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2150
- _content_type: Optional[StrictStr] = None,
2151
- _headers: Optional[Dict[StrictStr, Any]] = None,
2152
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2153
- ) -> RESTResponseType:
2154
- """Upload part
2155
-
2156
-
2157
- :param sensor_id: (required)
2158
- :type sensor_id: str
2159
- :param upload_id: (required)
2160
- :type upload_id: str
2161
- :param part: (required)
2162
- :type part: int
2163
- :param body: (required)
2164
- :type body: object
2165
- :param _request_timeout: timeout setting for this request. If one
2166
- number provided, it will be total request
2167
- timeout. It can also be a pair (tuple) of
2168
- (connection, read) timeouts.
2169
- :type _request_timeout: int, tuple(int, int), optional
2170
- :param _request_auth: set to override the auth_settings for an a single
2171
- request; this effectively ignores the
2172
- authentication in the spec for a single request.
2173
- :type _request_auth: dict, optional
2174
- :param _content_type: force content-type for the request.
2175
- :type _content_type: str, Optional
2176
- :param _headers: set to override the headers for a single
2177
- request; this effectively ignores the headers
2178
- in the spec for a single request.
2179
- :type _headers: dict, optional
2180
- :param _host_index: set to override the host_index for a single
2181
- request; this effectively ignores the host_index
2182
- in the spec for a single request.
2183
- :type _host_index: int, optional
2184
- :return: Returns the result object.
2185
- """ # noqa: E501
2186
-
2187
- _param = self._upload_model_part_serialize(
2188
- sensor_id=sensor_id,
2189
- upload_id=upload_id,
2190
- part=part,
2191
- body=body,
2192
- _request_auth=_request_auth,
2193
- _content_type=_content_type,
2194
- _headers=_headers,
2195
- _host_index=_host_index
2196
- )
2197
-
2198
- _response_types_map: Dict[str, Optional[str]] = {
2199
- '200': None,
2200
- '400': None,
2201
- }
2202
- response_data = self.api_client.call_api(
2203
- *_param,
2204
- _request_timeout=_request_timeout
2205
- )
2206
- return response_data.response
2207
-
2208
-
2209
- def _upload_model_part_serialize(
2210
- self,
2211
- sensor_id,
2212
- upload_id,
2213
- part,
2214
- body,
2215
- _request_auth,
2216
- _content_type,
2217
- _headers,
2218
- _host_index,
2219
- ) -> RequestSerialized:
2220
-
2221
- _host = None
2222
-
2223
- _collection_formats: Dict[str, str] = {
2224
- }
2225
-
2226
- _path_params: Dict[str, str] = {}
2227
- _query_params: List[Tuple[str, str]] = []
2228
- _header_params: Dict[str, Optional[str]] = _headers or {}
2229
- _form_params: List[Tuple[str, str]] = []
2230
- _files: Dict[str, Union[str, bytes]] = {}
2231
- _body_params: Optional[bytes] = None
2232
-
2233
- # process the path parameters
2234
- if sensor_id is not None:
2235
- _path_params['sensor_id'] = sensor_id
2236
- if upload_id is not None:
2237
- _path_params['upload_id'] = upload_id
2238
- if part is not None:
2239
- _path_params['part'] = part
2240
- # process the query parameters
2241
- # process the header parameters
2242
- # process the form parameters
2243
- # process the body parameter
2244
- if body is not None:
2245
- _body_params = body
2246
-
2247
-
2248
-
2249
- # set the HTTP header `Content-Type`
2250
- if _content_type:
2251
- _header_params['Content-Type'] = _content_type
2252
- else:
2253
- _default_content_type = (
2254
- self.api_client.select_header_content_type(
2255
- [
2256
- 'application/octet-stream'
2257
- ]
2258
- )
2259
- )
2260
- if _default_content_type is not None:
2261
- _header_params['Content-Type'] = _default_content_type
2262
-
2263
- # authentication setting
2264
- _auth_settings: List[str] = [
2265
- 'BearerAuth'
2266
- ]
2267
-
2268
- return self.api_client.param_serialize(
2269
- method='PUT',
2270
- resource_path='/api/v2/sensors/{sensor_id}/upload/{upload_id}/part/{part}',
2271
- path_params=_path_params,
2272
- query_params=_query_params,
2273
- header_params=_header_params,
2274
- body=_body_params,
2275
- post_params=_form_params,
2276
- files=_files,
2277
- auth_settings=_auth_settings,
2278
- collection_formats=_collection_formats,
2279
- _host=_host,
2280
- _request_auth=_request_auth
2281
- )
2282
-
2283
-