hiddenlayer-sdk 0.1.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. hiddenlayer/__init__.py +109 -0
  2. hiddenlayer/sdk/__init__.py +0 -0
  3. hiddenlayer/sdk/constants.py +14 -0
  4. hiddenlayer/sdk/enterprise/__init__.py +0 -0
  5. hiddenlayer/sdk/enterprise/enterprise_model_scan_api.py +55 -0
  6. hiddenlayer/sdk/exceptions.py +12 -0
  7. hiddenlayer/sdk/models.py +22 -0
  8. hiddenlayer/sdk/rest/__init__.py +49 -0
  9. hiddenlayer/sdk/rest/api/__init__.py +7 -0
  10. hiddenlayer/sdk/rest/api/aidr_predictive_api.py +308 -0
  11. hiddenlayer/sdk/rest/api/model_scan_api.py +591 -0
  12. hiddenlayer/sdk/rest/api/sensor_api.py +1966 -0
  13. hiddenlayer/sdk/rest/api_client.py +770 -0
  14. hiddenlayer/sdk/rest/api_response.py +21 -0
  15. hiddenlayer/sdk/rest/configuration.py +445 -0
  16. hiddenlayer/sdk/rest/exceptions.py +199 -0
  17. hiddenlayer/sdk/rest/models/__init__.py +30 -0
  18. hiddenlayer/sdk/rest/models/create_sensor_request.py +95 -0
  19. hiddenlayer/sdk/rest/models/file_info.py +110 -0
  20. hiddenlayer/sdk/rest/models/get_multipart_upload_response.py +97 -0
  21. hiddenlayer/sdk/rest/models/model.py +100 -0
  22. hiddenlayer/sdk/rest/models/model_query_response.py +101 -0
  23. hiddenlayer/sdk/rest/models/multipart_upload_part.py +93 -0
  24. hiddenlayer/sdk/rest/models/scan_model_request.py +87 -0
  25. hiddenlayer/sdk/rest/models/scan_results_v2.py +108 -0
  26. hiddenlayer/sdk/rest/models/sensor_sor_query_filter.py +108 -0
  27. hiddenlayer/sdk/rest/models/sensor_sor_query_request.py +109 -0
  28. hiddenlayer/sdk/rest/models/submission_response.py +95 -0
  29. hiddenlayer/sdk/rest/models/submission_v2.py +109 -0
  30. hiddenlayer/sdk/rest/models/validation_error_model.py +99 -0
  31. hiddenlayer/sdk/rest/models/validation_error_model_loc_inner.py +138 -0
  32. hiddenlayer/sdk/rest/rest.py +257 -0
  33. hiddenlayer/sdk/services/__init__.py +0 -0
  34. hiddenlayer/sdk/services/aidr_predictive.py +76 -0
  35. hiddenlayer/sdk/services/model.py +101 -0
  36. hiddenlayer/sdk/services/model_scan.py +414 -0
  37. hiddenlayer/sdk/utils.py +92 -0
  38. hiddenlayer/sdk/version.py +1 -0
  39. hiddenlayer_sdk-0.1.0.dist-info/LICENSE +201 -0
  40. hiddenlayer_sdk-0.1.0.dist-info/METADATA +320 -0
  41. hiddenlayer_sdk-0.1.0.dist-info/RECORD +43 -0
  42. hiddenlayer_sdk-0.1.0.dist-info/WHEEL +5 -0
  43. hiddenlayer_sdk-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1966 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ HiddenLayer ModelScan
5
+
6
+ HiddenLayer ModelScan API for scanning of models
7
+
8
+ The version of the OpenAPI document: 1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr
20
+ from typing import Any, Optional, Union
21
+ from typing_extensions import Annotated
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
26
+ from hiddenlayer.sdk.rest.models.sensor_sor_query_request import SensorSORQueryRequest
27
+
28
+ from hiddenlayer.sdk.rest.api_client import ApiClient, RequestSerialized
29
+ from hiddenlayer.sdk.rest.api_response import ApiResponse
30
+ from hiddenlayer.sdk.rest.rest import RESTResponseType
31
+
32
+
33
+ class SensorApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ def begin_multipart_upload(
48
+ self,
49
+ x_content_length: Annotated[Union[StrictFloat, StrictInt], Field(description="The total size of multipart upload.")],
50
+ sensor_id: StrictStr,
51
+ _request_timeout: Union[
52
+ None,
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Tuple[
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Annotated[StrictFloat, Field(gt=0)]
57
+ ]
58
+ ] = None,
59
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
60
+ _content_type: Optional[StrictStr] = None,
61
+ _headers: Optional[Dict[StrictStr, Any]] = None,
62
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
63
+ ) -> GetMultipartUploadResponse:
64
+ """Begin Multipart Upload
65
+
66
+
67
+ :param x_content_length: The total size of multipart upload. (required)
68
+ :type x_content_length: float
69
+ :param sensor_id: (required)
70
+ :type sensor_id: str
71
+ :param _request_timeout: timeout setting for this request. If one
72
+ number provided, it will be total request
73
+ timeout. It can also be a pair (tuple) of
74
+ (connection, read) timeouts.
75
+ :type _request_timeout: int, tuple(int, int), optional
76
+ :param _request_auth: set to override the auth_settings for an a single
77
+ request; this effectively ignores the
78
+ authentication in the spec for a single request.
79
+ :type _request_auth: dict, optional
80
+ :param _content_type: force content-type for the request.
81
+ :type _content_type: str, Optional
82
+ :param _headers: set to override the headers for a single
83
+ request; this effectively ignores the headers
84
+ in the spec for a single request.
85
+ :type _headers: dict, optional
86
+ :param _host_index: set to override the host_index for a single
87
+ request; this effectively ignores the host_index
88
+ in the spec for a single request.
89
+ :type _host_index: int, optional
90
+ :return: Returns the result object.
91
+ """ # noqa: E501
92
+
93
+ _param = self._begin_multipart_upload_serialize(
94
+ x_content_length=x_content_length,
95
+ sensor_id=sensor_id,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index
100
+ )
101
+
102
+ _response_types_map: Dict[str, Optional[str]] = {
103
+ '200': "GetMultipartUploadResponse",
104
+ '400': None,
105
+ }
106
+ response_data = self.api_client.call_api(
107
+ *_param,
108
+ _request_timeout=_request_timeout
109
+ )
110
+ response_data.read()
111
+ return self.api_client.response_deserialize(
112
+ response_data=response_data,
113
+ response_types_map=_response_types_map,
114
+ ).data
115
+
116
+
117
+ @validate_call
118
+ def begin_multipart_upload_with_http_info(
119
+ self,
120
+ x_content_length: Annotated[Union[StrictFloat, StrictInt], Field(description="The total size of multipart upload.")],
121
+ sensor_id: StrictStr,
122
+ _request_timeout: Union[
123
+ None,
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Tuple[
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Annotated[StrictFloat, Field(gt=0)]
128
+ ]
129
+ ] = None,
130
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
+ _content_type: Optional[StrictStr] = None,
132
+ _headers: Optional[Dict[StrictStr, Any]] = None,
133
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
+ ) -> ApiResponse[GetMultipartUploadResponse]:
135
+ """Begin Multipart Upload
136
+
137
+
138
+ :param x_content_length: The total size of multipart upload. (required)
139
+ :type x_content_length: float
140
+ :param sensor_id: (required)
141
+ :type sensor_id: str
142
+ :param _request_timeout: timeout setting for this request. If one
143
+ number provided, it will be total request
144
+ timeout. It can also be a pair (tuple) of
145
+ (connection, read) timeouts.
146
+ :type _request_timeout: int, tuple(int, int), optional
147
+ :param _request_auth: set to override the auth_settings for an a single
148
+ request; this effectively ignores the
149
+ authentication in the spec for a single request.
150
+ :type _request_auth: dict, optional
151
+ :param _content_type: force content-type for the request.
152
+ :type _content_type: str, Optional
153
+ :param _headers: set to override the headers for a single
154
+ request; this effectively ignores the headers
155
+ in the spec for a single request.
156
+ :type _headers: dict, optional
157
+ :param _host_index: set to override the host_index for a single
158
+ request; this effectively ignores the host_index
159
+ in the spec for a single request.
160
+ :type _host_index: int, optional
161
+ :return: Returns the result object.
162
+ """ # noqa: E501
163
+
164
+ _param = self._begin_multipart_upload_serialize(
165
+ x_content_length=x_content_length,
166
+ sensor_id=sensor_id,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index
171
+ )
172
+
173
+ _response_types_map: Dict[str, Optional[str]] = {
174
+ '200': "GetMultipartUploadResponse",
175
+ '400': None,
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param,
179
+ _request_timeout=_request_timeout
180
+ )
181
+ response_data.read()
182
+ return self.api_client.response_deserialize(
183
+ response_data=response_data,
184
+ response_types_map=_response_types_map,
185
+ )
186
+
187
+
188
+ @validate_call
189
+ def begin_multipart_upload_without_preload_content(
190
+ self,
191
+ x_content_length: Annotated[Union[StrictFloat, StrictInt], Field(description="The total size of multipart upload.")],
192
+ sensor_id: StrictStr,
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Begin Multipart Upload
207
+
208
+
209
+ :param x_content_length: The total size of multipart upload. (required)
210
+ :type x_content_length: float
211
+ :param sensor_id: (required)
212
+ :type sensor_id: str
213
+ :param _request_timeout: timeout setting for this request. If one
214
+ number provided, it will be total request
215
+ timeout. It can also be a pair (tuple) of
216
+ (connection, read) timeouts.
217
+ :type _request_timeout: int, tuple(int, int), optional
218
+ :param _request_auth: set to override the auth_settings for an a single
219
+ request; this effectively ignores the
220
+ authentication in the spec for a single request.
221
+ :type _request_auth: dict, optional
222
+ :param _content_type: force content-type for the request.
223
+ :type _content_type: str, Optional
224
+ :param _headers: set to override the headers for a single
225
+ request; this effectively ignores the headers
226
+ in the spec for a single request.
227
+ :type _headers: dict, optional
228
+ :param _host_index: set to override the host_index for a single
229
+ request; this effectively ignores the host_index
230
+ in the spec for a single request.
231
+ :type _host_index: int, optional
232
+ :return: Returns the result object.
233
+ """ # noqa: E501
234
+
235
+ _param = self._begin_multipart_upload_serialize(
236
+ x_content_length=x_content_length,
237
+ sensor_id=sensor_id,
238
+ _request_auth=_request_auth,
239
+ _content_type=_content_type,
240
+ _headers=_headers,
241
+ _host_index=_host_index
242
+ )
243
+
244
+ _response_types_map: Dict[str, Optional[str]] = {
245
+ '200': "GetMultipartUploadResponse",
246
+ '400': None,
247
+ }
248
+ response_data = self.api_client.call_api(
249
+ *_param,
250
+ _request_timeout=_request_timeout
251
+ )
252
+ return response_data.response
253
+
254
+
255
+ def _begin_multipart_upload_serialize(
256
+ self,
257
+ x_content_length,
258
+ sensor_id,
259
+ _request_auth,
260
+ _content_type,
261
+ _headers,
262
+ _host_index,
263
+ ) -> RequestSerialized:
264
+
265
+ _host = None
266
+
267
+ _collection_formats: Dict[str, str] = {
268
+ }
269
+
270
+ _path_params: Dict[str, str] = {}
271
+ _query_params: List[Tuple[str, str]] = []
272
+ _header_params: Dict[str, Optional[str]] = _headers or {}
273
+ _form_params: List[Tuple[str, str]] = []
274
+ _files: Dict[str, Union[str, bytes]] = {}
275
+ _body_params: Optional[bytes] = None
276
+
277
+ # process the path parameters
278
+ if sensor_id is not None:
279
+ _path_params['sensor_id'] = sensor_id
280
+ # process the query parameters
281
+ # process the header parameters
282
+ if x_content_length is not None:
283
+ _header_params['X-Content-Length'] = x_content_length
284
+ # process the form parameters
285
+ # process the body parameter
286
+
287
+
288
+ # set the HTTP header `Accept`
289
+ _header_params['Accept'] = self.api_client.select_header_accept(
290
+ [
291
+ 'application/json'
292
+ ]
293
+ )
294
+
295
+
296
+ # authentication setting
297
+ _auth_settings: List[str] = [
298
+ 'BearerAuth'
299
+ ]
300
+
301
+ return self.api_client.param_serialize(
302
+ method='POST',
303
+ resource_path='/api/v2/sensors/{sensor_id}/upload/begin',
304
+ path_params=_path_params,
305
+ query_params=_query_params,
306
+ header_params=_header_params,
307
+ body=_body_params,
308
+ post_params=_form_params,
309
+ files=_files,
310
+ auth_settings=_auth_settings,
311
+ collection_formats=_collection_formats,
312
+ _host=_host,
313
+ _request_auth=_request_auth
314
+ )
315
+
316
+
317
+
318
+
319
+ @validate_call
320
+ def complete_multipart_upload(
321
+ self,
322
+ sensor_id: StrictStr,
323
+ upload_id: StrictStr,
324
+ _request_timeout: Union[
325
+ None,
326
+ Annotated[StrictFloat, Field(gt=0)],
327
+ Tuple[
328
+ Annotated[StrictFloat, Field(gt=0)],
329
+ Annotated[StrictFloat, Field(gt=0)]
330
+ ]
331
+ ] = None,
332
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
333
+ _content_type: Optional[StrictStr] = None,
334
+ _headers: Optional[Dict[StrictStr, Any]] = None,
335
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
336
+ ) -> object:
337
+ """Complete Multipart Upload
338
+
339
+
340
+ :param sensor_id: (required)
341
+ :type sensor_id: str
342
+ :param upload_id: (required)
343
+ :type upload_id: str
344
+ :param _request_timeout: timeout setting for this request. If one
345
+ number provided, it will be total request
346
+ timeout. It can also be a pair (tuple) of
347
+ (connection, read) timeouts.
348
+ :type _request_timeout: int, tuple(int, int), optional
349
+ :param _request_auth: set to override the auth_settings for an a single
350
+ request; this effectively ignores the
351
+ authentication in the spec for a single request.
352
+ :type _request_auth: dict, optional
353
+ :param _content_type: force content-type for the request.
354
+ :type _content_type: str, Optional
355
+ :param _headers: set to override the headers for a single
356
+ request; this effectively ignores the headers
357
+ in the spec for a single request.
358
+ :type _headers: dict, optional
359
+ :param _host_index: set to override the host_index for a single
360
+ request; this effectively ignores the host_index
361
+ in the spec for a single request.
362
+ :type _host_index: int, optional
363
+ :return: Returns the result object.
364
+ """ # noqa: E501
365
+
366
+ _param = self._complete_multipart_upload_serialize(
367
+ sensor_id=sensor_id,
368
+ upload_id=upload_id,
369
+ _request_auth=_request_auth,
370
+ _content_type=_content_type,
371
+ _headers=_headers,
372
+ _host_index=_host_index
373
+ )
374
+
375
+ _response_types_map: Dict[str, Optional[str]] = {
376
+ '200': "object",
377
+ '400': None,
378
+ }
379
+ response_data = self.api_client.call_api(
380
+ *_param,
381
+ _request_timeout=_request_timeout
382
+ )
383
+ response_data.read()
384
+ return self.api_client.response_deserialize(
385
+ response_data=response_data,
386
+ response_types_map=_response_types_map,
387
+ ).data
388
+
389
+
390
+ @validate_call
391
+ def complete_multipart_upload_with_http_info(
392
+ self,
393
+ sensor_id: StrictStr,
394
+ upload_id: StrictStr,
395
+ _request_timeout: Union[
396
+ None,
397
+ Annotated[StrictFloat, Field(gt=0)],
398
+ Tuple[
399
+ Annotated[StrictFloat, Field(gt=0)],
400
+ Annotated[StrictFloat, Field(gt=0)]
401
+ ]
402
+ ] = None,
403
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
404
+ _content_type: Optional[StrictStr] = None,
405
+ _headers: Optional[Dict[StrictStr, Any]] = None,
406
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
407
+ ) -> ApiResponse[object]:
408
+ """Complete Multipart Upload
409
+
410
+
411
+ :param sensor_id: (required)
412
+ :type sensor_id: str
413
+ :param upload_id: (required)
414
+ :type upload_id: str
415
+ :param _request_timeout: timeout setting for this request. If one
416
+ number provided, it will be total request
417
+ timeout. It can also be a pair (tuple) of
418
+ (connection, read) timeouts.
419
+ :type _request_timeout: int, tuple(int, int), optional
420
+ :param _request_auth: set to override the auth_settings for an a single
421
+ request; this effectively ignores the
422
+ authentication in the spec for a single request.
423
+ :type _request_auth: dict, optional
424
+ :param _content_type: force content-type for the request.
425
+ :type _content_type: str, Optional
426
+ :param _headers: set to override the headers for a single
427
+ request; this effectively ignores the headers
428
+ in the spec for a single request.
429
+ :type _headers: dict, optional
430
+ :param _host_index: set to override the host_index for a single
431
+ request; this effectively ignores the host_index
432
+ in the spec for a single request.
433
+ :type _host_index: int, optional
434
+ :return: Returns the result object.
435
+ """ # noqa: E501
436
+
437
+ _param = self._complete_multipart_upload_serialize(
438
+ sensor_id=sensor_id,
439
+ upload_id=upload_id,
440
+ _request_auth=_request_auth,
441
+ _content_type=_content_type,
442
+ _headers=_headers,
443
+ _host_index=_host_index
444
+ )
445
+
446
+ _response_types_map: Dict[str, Optional[str]] = {
447
+ '200': "object",
448
+ '400': None,
449
+ }
450
+ response_data = self.api_client.call_api(
451
+ *_param,
452
+ _request_timeout=_request_timeout
453
+ )
454
+ response_data.read()
455
+ return self.api_client.response_deserialize(
456
+ response_data=response_data,
457
+ response_types_map=_response_types_map,
458
+ )
459
+
460
+
461
+ @validate_call
462
+ def complete_multipart_upload_without_preload_content(
463
+ self,
464
+ sensor_id: StrictStr,
465
+ upload_id: StrictStr,
466
+ _request_timeout: Union[
467
+ None,
468
+ Annotated[StrictFloat, Field(gt=0)],
469
+ Tuple[
470
+ Annotated[StrictFloat, Field(gt=0)],
471
+ Annotated[StrictFloat, Field(gt=0)]
472
+ ]
473
+ ] = None,
474
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
475
+ _content_type: Optional[StrictStr] = None,
476
+ _headers: Optional[Dict[StrictStr, Any]] = None,
477
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
478
+ ) -> RESTResponseType:
479
+ """Complete Multipart Upload
480
+
481
+
482
+ :param sensor_id: (required)
483
+ :type sensor_id: str
484
+ :param upload_id: (required)
485
+ :type upload_id: str
486
+ :param _request_timeout: timeout setting for this request. If one
487
+ number provided, it will be total request
488
+ timeout. It can also be a pair (tuple) of
489
+ (connection, read) timeouts.
490
+ :type _request_timeout: int, tuple(int, int), optional
491
+ :param _request_auth: set to override the auth_settings for an a single
492
+ request; this effectively ignores the
493
+ authentication in the spec for a single request.
494
+ :type _request_auth: dict, optional
495
+ :param _content_type: force content-type for the request.
496
+ :type _content_type: str, Optional
497
+ :param _headers: set to override the headers for a single
498
+ request; this effectively ignores the headers
499
+ in the spec for a single request.
500
+ :type _headers: dict, optional
501
+ :param _host_index: set to override the host_index for a single
502
+ request; this effectively ignores the host_index
503
+ in the spec for a single request.
504
+ :type _host_index: int, optional
505
+ :return: Returns the result object.
506
+ """ # noqa: E501
507
+
508
+ _param = self._complete_multipart_upload_serialize(
509
+ sensor_id=sensor_id,
510
+ upload_id=upload_id,
511
+ _request_auth=_request_auth,
512
+ _content_type=_content_type,
513
+ _headers=_headers,
514
+ _host_index=_host_index
515
+ )
516
+
517
+ _response_types_map: Dict[str, Optional[str]] = {
518
+ '200': "object",
519
+ '400': None,
520
+ }
521
+ response_data = self.api_client.call_api(
522
+ *_param,
523
+ _request_timeout=_request_timeout
524
+ )
525
+ return response_data.response
526
+
527
+
528
+ def _complete_multipart_upload_serialize(
529
+ self,
530
+ sensor_id,
531
+ upload_id,
532
+ _request_auth,
533
+ _content_type,
534
+ _headers,
535
+ _host_index,
536
+ ) -> RequestSerialized:
537
+
538
+ _host = None
539
+
540
+ _collection_formats: Dict[str, str] = {
541
+ }
542
+
543
+ _path_params: Dict[str, str] = {}
544
+ _query_params: List[Tuple[str, str]] = []
545
+ _header_params: Dict[str, Optional[str]] = _headers or {}
546
+ _form_params: List[Tuple[str, str]] = []
547
+ _files: Dict[str, Union[str, bytes]] = {}
548
+ _body_params: Optional[bytes] = None
549
+
550
+ # process the path parameters
551
+ if sensor_id is not None:
552
+ _path_params['sensor_id'] = sensor_id
553
+ if upload_id is not None:
554
+ _path_params['upload_id'] = upload_id
555
+ # process the query parameters
556
+ # process the header parameters
557
+ # process the form parameters
558
+ # process the body parameter
559
+
560
+
561
+ # set the HTTP header `Accept`
562
+ _header_params['Accept'] = self.api_client.select_header_accept(
563
+ [
564
+ 'application/json'
565
+ ]
566
+ )
567
+
568
+
569
+ # authentication setting
570
+ _auth_settings: List[str] = [
571
+ 'BearerAuth'
572
+ ]
573
+
574
+ return self.api_client.param_serialize(
575
+ method='POST',
576
+ resource_path='/api/v2/sensors/{sensor_id}/upload/{upload_id}/complete',
577
+ path_params=_path_params,
578
+ query_params=_query_params,
579
+ header_params=_header_params,
580
+ body=_body_params,
581
+ post_params=_form_params,
582
+ files=_files,
583
+ auth_settings=_auth_settings,
584
+ collection_formats=_collection_formats,
585
+ _host=_host,
586
+ _request_auth=_request_auth
587
+ )
588
+
589
+
590
+
591
+
592
+ @validate_call
593
+ def create_sensor(
594
+ self,
595
+ create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
596
+ _request_timeout: Union[
597
+ None,
598
+ Annotated[StrictFloat, Field(gt=0)],
599
+ Tuple[
600
+ Annotated[StrictFloat, Field(gt=0)],
601
+ Annotated[StrictFloat, Field(gt=0)]
602
+ ]
603
+ ] = None,
604
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
605
+ _content_type: Optional[StrictStr] = None,
606
+ _headers: Optional[Dict[StrictStr, Any]] = None,
607
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
608
+ ) -> Model:
609
+ """Create a Sensor
610
+
611
+
612
+ :param create_sensor_request: Request body for create (required)
613
+ :type create_sensor_request: CreateSensorRequest
614
+ :param _request_timeout: timeout setting for this request. If one
615
+ number provided, it will be total request
616
+ timeout. It can also be a pair (tuple) of
617
+ (connection, read) timeouts.
618
+ :type _request_timeout: int, tuple(int, int), optional
619
+ :param _request_auth: set to override the auth_settings for an a single
620
+ request; this effectively ignores the
621
+ authentication in the spec for a single request.
622
+ :type _request_auth: dict, optional
623
+ :param _content_type: force content-type for the request.
624
+ :type _content_type: str, Optional
625
+ :param _headers: set to override the headers for a single
626
+ request; this effectively ignores the headers
627
+ in the spec for a single request.
628
+ :type _headers: dict, optional
629
+ :param _host_index: set to override the host_index for a single
630
+ request; this effectively ignores the host_index
631
+ in the spec for a single request.
632
+ :type _host_index: int, optional
633
+ :return: Returns the result object.
634
+ """ # noqa: E501
635
+
636
+ _param = self._create_sensor_serialize(
637
+ create_sensor_request=create_sensor_request,
638
+ _request_auth=_request_auth,
639
+ _content_type=_content_type,
640
+ _headers=_headers,
641
+ _host_index=_host_index
642
+ )
643
+
644
+ _response_types_map: Dict[str, Optional[str]] = {
645
+ '201': "Model",
646
+ '400': None,
647
+ '422': "ValidationErrorModel",
648
+ }
649
+ response_data = self.api_client.call_api(
650
+ *_param,
651
+ _request_timeout=_request_timeout
652
+ )
653
+ response_data.read()
654
+ return self.api_client.response_deserialize(
655
+ response_data=response_data,
656
+ response_types_map=_response_types_map,
657
+ ).data
658
+
659
+
660
+ @validate_call
661
+ def create_sensor_with_http_info(
662
+ self,
663
+ create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
664
+ _request_timeout: Union[
665
+ None,
666
+ Annotated[StrictFloat, Field(gt=0)],
667
+ Tuple[
668
+ Annotated[StrictFloat, Field(gt=0)],
669
+ Annotated[StrictFloat, Field(gt=0)]
670
+ ]
671
+ ] = None,
672
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
673
+ _content_type: Optional[StrictStr] = None,
674
+ _headers: Optional[Dict[StrictStr, Any]] = None,
675
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
676
+ ) -> ApiResponse[Model]:
677
+ """Create a Sensor
678
+
679
+
680
+ :param create_sensor_request: Request body for create (required)
681
+ :type create_sensor_request: CreateSensorRequest
682
+ :param _request_timeout: timeout setting for this request. If one
683
+ number provided, it will be total request
684
+ timeout. It can also be a pair (tuple) of
685
+ (connection, read) timeouts.
686
+ :type _request_timeout: int, tuple(int, int), optional
687
+ :param _request_auth: set to override the auth_settings for an a single
688
+ request; this effectively ignores the
689
+ authentication in the spec for a single request.
690
+ :type _request_auth: dict, optional
691
+ :param _content_type: force content-type for the request.
692
+ :type _content_type: str, Optional
693
+ :param _headers: set to override the headers for a single
694
+ request; this effectively ignores the headers
695
+ in the spec for a single request.
696
+ :type _headers: dict, optional
697
+ :param _host_index: set to override the host_index for a single
698
+ request; this effectively ignores the host_index
699
+ in the spec for a single request.
700
+ :type _host_index: int, optional
701
+ :return: Returns the result object.
702
+ """ # noqa: E501
703
+
704
+ _param = self._create_sensor_serialize(
705
+ create_sensor_request=create_sensor_request,
706
+ _request_auth=_request_auth,
707
+ _content_type=_content_type,
708
+ _headers=_headers,
709
+ _host_index=_host_index
710
+ )
711
+
712
+ _response_types_map: Dict[str, Optional[str]] = {
713
+ '201': "Model",
714
+ '400': None,
715
+ '422': "ValidationErrorModel",
716
+ }
717
+ response_data = self.api_client.call_api(
718
+ *_param,
719
+ _request_timeout=_request_timeout
720
+ )
721
+ response_data.read()
722
+ return self.api_client.response_deserialize(
723
+ response_data=response_data,
724
+ response_types_map=_response_types_map,
725
+ )
726
+
727
+
728
+ @validate_call
729
+ def create_sensor_without_preload_content(
730
+ self,
731
+ create_sensor_request: Annotated[CreateSensorRequest, Field(description="Request body for create")],
732
+ _request_timeout: Union[
733
+ None,
734
+ Annotated[StrictFloat, Field(gt=0)],
735
+ Tuple[
736
+ Annotated[StrictFloat, Field(gt=0)],
737
+ Annotated[StrictFloat, Field(gt=0)]
738
+ ]
739
+ ] = None,
740
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
741
+ _content_type: Optional[StrictStr] = None,
742
+ _headers: Optional[Dict[StrictStr, Any]] = None,
743
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
744
+ ) -> RESTResponseType:
745
+ """Create a Sensor
746
+
747
+
748
+ :param create_sensor_request: Request body for create (required)
749
+ :type create_sensor_request: CreateSensorRequest
750
+ :param _request_timeout: timeout setting for this request. If one
751
+ number provided, it will be total request
752
+ timeout. It can also be a pair (tuple) of
753
+ (connection, read) timeouts.
754
+ :type _request_timeout: int, tuple(int, int), optional
755
+ :param _request_auth: set to override the auth_settings for an a single
756
+ request; this effectively ignores the
757
+ authentication in the spec for a single request.
758
+ :type _request_auth: dict, optional
759
+ :param _content_type: force content-type for the request.
760
+ :type _content_type: str, Optional
761
+ :param _headers: set to override the headers for a single
762
+ request; this effectively ignores the headers
763
+ in the spec for a single request.
764
+ :type _headers: dict, optional
765
+ :param _host_index: set to override the host_index for a single
766
+ request; this effectively ignores the host_index
767
+ in the spec for a single request.
768
+ :type _host_index: int, optional
769
+ :return: Returns the result object.
770
+ """ # noqa: E501
771
+
772
+ _param = self._create_sensor_serialize(
773
+ create_sensor_request=create_sensor_request,
774
+ _request_auth=_request_auth,
775
+ _content_type=_content_type,
776
+ _headers=_headers,
777
+ _host_index=_host_index
778
+ )
779
+
780
+ _response_types_map: Dict[str, Optional[str]] = {
781
+ '201': "Model",
782
+ '400': None,
783
+ '422': "ValidationErrorModel",
784
+ }
785
+ response_data = self.api_client.call_api(
786
+ *_param,
787
+ _request_timeout=_request_timeout
788
+ )
789
+ return response_data.response
790
+
791
+
792
+ def _create_sensor_serialize(
793
+ self,
794
+ create_sensor_request,
795
+ _request_auth,
796
+ _content_type,
797
+ _headers,
798
+ _host_index,
799
+ ) -> RequestSerialized:
800
+
801
+ _host = None
802
+
803
+ _collection_formats: Dict[str, str] = {
804
+ }
805
+
806
+ _path_params: Dict[str, str] = {}
807
+ _query_params: List[Tuple[str, str]] = []
808
+ _header_params: Dict[str, Optional[str]] = _headers or {}
809
+ _form_params: List[Tuple[str, str]] = []
810
+ _files: Dict[str, Union[str, bytes]] = {}
811
+ _body_params: Optional[bytes] = None
812
+
813
+ # process the path parameters
814
+ # process the query parameters
815
+ # process the header parameters
816
+ # process the form parameters
817
+ # process the body parameter
818
+ if create_sensor_request is not None:
819
+ _body_params = create_sensor_request
820
+
821
+
822
+ # set the HTTP header `Accept`
823
+ _header_params['Accept'] = self.api_client.select_header_accept(
824
+ [
825
+ 'application/json'
826
+ ]
827
+ )
828
+
829
+ # set the HTTP header `Content-Type`
830
+ if _content_type:
831
+ _header_params['Content-Type'] = _content_type
832
+ else:
833
+ _default_content_type = (
834
+ self.api_client.select_header_content_type(
835
+ [
836
+ 'application/json'
837
+ ]
838
+ )
839
+ )
840
+ if _default_content_type is not None:
841
+ _header_params['Content-Type'] = _default_content_type
842
+
843
+ # authentication setting
844
+ _auth_settings: List[str] = [
845
+ 'BearerAuth'
846
+ ]
847
+
848
+ return self.api_client.param_serialize(
849
+ method='POST',
850
+ resource_path='/api/v2/sensors/create',
851
+ path_params=_path_params,
852
+ query_params=_query_params,
853
+ header_params=_header_params,
854
+ body=_body_params,
855
+ post_params=_form_params,
856
+ files=_files,
857
+ auth_settings=_auth_settings,
858
+ collection_formats=_collection_formats,
859
+ _host=_host,
860
+ _request_auth=_request_auth
861
+ )
862
+
863
+
864
+
865
+
866
+ @validate_call
867
+ def delete_model(
868
+ self,
869
+ sensor_id: StrictStr,
870
+ _request_timeout: Union[
871
+ None,
872
+ Annotated[StrictFloat, Field(gt=0)],
873
+ Tuple[
874
+ Annotated[StrictFloat, Field(gt=0)],
875
+ Annotated[StrictFloat, Field(gt=0)]
876
+ ]
877
+ ] = None,
878
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
879
+ _content_type: Optional[StrictStr] = None,
880
+ _headers: Optional[Dict[StrictStr, Any]] = None,
881
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
882
+ ) -> None:
883
+ """Remove an Adhoc Sensor
884
+
885
+
886
+ :param sensor_id: (required)
887
+ :type sensor_id: str
888
+ :param _request_timeout: timeout setting for this request. If one
889
+ number provided, it will be total request
890
+ timeout. It can also be a pair (tuple) of
891
+ (connection, read) timeouts.
892
+ :type _request_timeout: int, tuple(int, int), optional
893
+ :param _request_auth: set to override the auth_settings for an a single
894
+ request; this effectively ignores the
895
+ authentication in the spec for a single request.
896
+ :type _request_auth: dict, optional
897
+ :param _content_type: force content-type for the request.
898
+ :type _content_type: str, Optional
899
+ :param _headers: set to override the headers for a single
900
+ request; this effectively ignores the headers
901
+ in the spec for a single request.
902
+ :type _headers: dict, optional
903
+ :param _host_index: set to override the host_index for a single
904
+ request; this effectively ignores the host_index
905
+ in the spec for a single request.
906
+ :type _host_index: int, optional
907
+ :return: Returns the result object.
908
+ """ # noqa: E501
909
+
910
+ _param = self._delete_model_serialize(
911
+ sensor_id=sensor_id,
912
+ _request_auth=_request_auth,
913
+ _content_type=_content_type,
914
+ _headers=_headers,
915
+ _host_index=_host_index
916
+ )
917
+
918
+ _response_types_map: Dict[str, Optional[str]] = {
919
+ '204': None,
920
+ '400': None,
921
+ '404': None,
922
+ }
923
+ response_data = self.api_client.call_api(
924
+ *_param,
925
+ _request_timeout=_request_timeout
926
+ )
927
+ response_data.read()
928
+ return self.api_client.response_deserialize(
929
+ response_data=response_data,
930
+ response_types_map=_response_types_map,
931
+ ).data
932
+
933
+
934
+ @validate_call
935
+ def delete_model_with_http_info(
936
+ self,
937
+ sensor_id: StrictStr,
938
+ _request_timeout: Union[
939
+ None,
940
+ Annotated[StrictFloat, Field(gt=0)],
941
+ Tuple[
942
+ Annotated[StrictFloat, Field(gt=0)],
943
+ Annotated[StrictFloat, Field(gt=0)]
944
+ ]
945
+ ] = None,
946
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
947
+ _content_type: Optional[StrictStr] = None,
948
+ _headers: Optional[Dict[StrictStr, Any]] = None,
949
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
950
+ ) -> ApiResponse[None]:
951
+ """Remove an Adhoc Sensor
952
+
953
+
954
+ :param sensor_id: (required)
955
+ :type sensor_id: str
956
+ :param _request_timeout: timeout setting for this request. If one
957
+ number provided, it will be total request
958
+ timeout. It can also be a pair (tuple) of
959
+ (connection, read) timeouts.
960
+ :type _request_timeout: int, tuple(int, int), optional
961
+ :param _request_auth: set to override the auth_settings for an a single
962
+ request; this effectively ignores the
963
+ authentication in the spec for a single request.
964
+ :type _request_auth: dict, optional
965
+ :param _content_type: force content-type for the request.
966
+ :type _content_type: str, Optional
967
+ :param _headers: set to override the headers for a single
968
+ request; this effectively ignores the headers
969
+ in the spec for a single request.
970
+ :type _headers: dict, optional
971
+ :param _host_index: set to override the host_index for a single
972
+ request; this effectively ignores the host_index
973
+ in the spec for a single request.
974
+ :type _host_index: int, optional
975
+ :return: Returns the result object.
976
+ """ # noqa: E501
977
+
978
+ _param = self._delete_model_serialize(
979
+ sensor_id=sensor_id,
980
+ _request_auth=_request_auth,
981
+ _content_type=_content_type,
982
+ _headers=_headers,
983
+ _host_index=_host_index
984
+ )
985
+
986
+ _response_types_map: Dict[str, Optional[str]] = {
987
+ '204': None,
988
+ '400': None,
989
+ '404': None,
990
+ }
991
+ response_data = self.api_client.call_api(
992
+ *_param,
993
+ _request_timeout=_request_timeout
994
+ )
995
+ response_data.read()
996
+ return self.api_client.response_deserialize(
997
+ response_data=response_data,
998
+ response_types_map=_response_types_map,
999
+ )
1000
+
1001
+
1002
+ @validate_call
1003
+ def delete_model_without_preload_content(
1004
+ self,
1005
+ sensor_id: StrictStr,
1006
+ _request_timeout: Union[
1007
+ None,
1008
+ Annotated[StrictFloat, Field(gt=0)],
1009
+ Tuple[
1010
+ Annotated[StrictFloat, Field(gt=0)],
1011
+ Annotated[StrictFloat, Field(gt=0)]
1012
+ ]
1013
+ ] = None,
1014
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1015
+ _content_type: Optional[StrictStr] = None,
1016
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1017
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1018
+ ) -> RESTResponseType:
1019
+ """Remove an Adhoc Sensor
1020
+
1021
+
1022
+ :param sensor_id: (required)
1023
+ :type sensor_id: str
1024
+ :param _request_timeout: timeout setting for this request. If one
1025
+ number provided, it will be total request
1026
+ timeout. It can also be a pair (tuple) of
1027
+ (connection, read) timeouts.
1028
+ :type _request_timeout: int, tuple(int, int), optional
1029
+ :param _request_auth: set to override the auth_settings for an a single
1030
+ request; this effectively ignores the
1031
+ authentication in the spec for a single request.
1032
+ :type _request_auth: dict, optional
1033
+ :param _content_type: force content-type for the request.
1034
+ :type _content_type: str, Optional
1035
+ :param _headers: set to override the headers for a single
1036
+ request; this effectively ignores the headers
1037
+ in the spec for a single request.
1038
+ :type _headers: dict, optional
1039
+ :param _host_index: set to override the host_index for a single
1040
+ request; this effectively ignores the host_index
1041
+ in the spec for a single request.
1042
+ :type _host_index: int, optional
1043
+ :return: Returns the result object.
1044
+ """ # noqa: E501
1045
+
1046
+ _param = self._delete_model_serialize(
1047
+ sensor_id=sensor_id,
1048
+ _request_auth=_request_auth,
1049
+ _content_type=_content_type,
1050
+ _headers=_headers,
1051
+ _host_index=_host_index
1052
+ )
1053
+
1054
+ _response_types_map: Dict[str, Optional[str]] = {
1055
+ '204': None,
1056
+ '400': None,
1057
+ '404': None,
1058
+ }
1059
+ response_data = self.api_client.call_api(
1060
+ *_param,
1061
+ _request_timeout=_request_timeout
1062
+ )
1063
+ return response_data.response
1064
+
1065
+
1066
+ def _delete_model_serialize(
1067
+ self,
1068
+ sensor_id,
1069
+ _request_auth,
1070
+ _content_type,
1071
+ _headers,
1072
+ _host_index,
1073
+ ) -> RequestSerialized:
1074
+
1075
+ _host = None
1076
+
1077
+ _collection_formats: Dict[str, str] = {
1078
+ }
1079
+
1080
+ _path_params: Dict[str, str] = {}
1081
+ _query_params: List[Tuple[str, str]] = []
1082
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1083
+ _form_params: List[Tuple[str, str]] = []
1084
+ _files: Dict[str, Union[str, bytes]] = {}
1085
+ _body_params: Optional[bytes] = None
1086
+
1087
+ # process the path parameters
1088
+ if sensor_id is not None:
1089
+ _path_params['sensor_id'] = sensor_id
1090
+ # process the query parameters
1091
+ # process the header parameters
1092
+ # process the form parameters
1093
+ # process the body parameter
1094
+
1095
+
1096
+
1097
+
1098
+ # authentication setting
1099
+ _auth_settings: List[str] = [
1100
+ 'BearerAuth'
1101
+ ]
1102
+
1103
+ return self.api_client.param_serialize(
1104
+ method='DELETE',
1105
+ resource_path='/api/v2/sensors/{sensor_id}',
1106
+ path_params=_path_params,
1107
+ query_params=_query_params,
1108
+ header_params=_header_params,
1109
+ body=_body_params,
1110
+ post_params=_form_params,
1111
+ files=_files,
1112
+ auth_settings=_auth_settings,
1113
+ collection_formats=_collection_formats,
1114
+ _host=_host,
1115
+ _request_auth=_request_auth
1116
+ )
1117
+
1118
+
1119
+
1120
+
1121
+ @validate_call
1122
+ def get_model(
1123
+ self,
1124
+ sensor_id: StrictStr,
1125
+ _request_timeout: Union[
1126
+ None,
1127
+ Annotated[StrictFloat, Field(gt=0)],
1128
+ Tuple[
1129
+ Annotated[StrictFloat, Field(gt=0)],
1130
+ Annotated[StrictFloat, Field(gt=0)]
1131
+ ]
1132
+ ] = None,
1133
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1134
+ _content_type: Optional[StrictStr] = None,
1135
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1137
+ ) -> Model:
1138
+ """Get Model
1139
+
1140
+
1141
+ :param sensor_id: (required)
1142
+ :type sensor_id: str
1143
+ :param _request_timeout: timeout setting for this request. If one
1144
+ number provided, it will be total request
1145
+ timeout. It can also be a pair (tuple) of
1146
+ (connection, read) timeouts.
1147
+ :type _request_timeout: int, tuple(int, int), optional
1148
+ :param _request_auth: set to override the auth_settings for an a single
1149
+ request; this effectively ignores the
1150
+ authentication in the spec for a single request.
1151
+ :type _request_auth: dict, optional
1152
+ :param _content_type: force content-type for the request.
1153
+ :type _content_type: str, Optional
1154
+ :param _headers: set to override the headers for a single
1155
+ request; this effectively ignores the headers
1156
+ in the spec for a single request.
1157
+ :type _headers: dict, optional
1158
+ :param _host_index: set to override the host_index for a single
1159
+ request; this effectively ignores the host_index
1160
+ in the spec for a single request.
1161
+ :type _host_index: int, optional
1162
+ :return: Returns the result object.
1163
+ """ # noqa: E501
1164
+
1165
+ _param = self._get_model_serialize(
1166
+ sensor_id=sensor_id,
1167
+ _request_auth=_request_auth,
1168
+ _content_type=_content_type,
1169
+ _headers=_headers,
1170
+ _host_index=_host_index
1171
+ )
1172
+
1173
+ _response_types_map: Dict[str, Optional[str]] = {
1174
+ '200': "Model",
1175
+ '400': None,
1176
+ '404': None,
1177
+ }
1178
+ response_data = self.api_client.call_api(
1179
+ *_param,
1180
+ _request_timeout=_request_timeout
1181
+ )
1182
+ response_data.read()
1183
+ return self.api_client.response_deserialize(
1184
+ response_data=response_data,
1185
+ response_types_map=_response_types_map,
1186
+ ).data
1187
+
1188
+
1189
+ @validate_call
1190
+ def get_model_with_http_info(
1191
+ self,
1192
+ sensor_id: StrictStr,
1193
+ _request_timeout: Union[
1194
+ None,
1195
+ Annotated[StrictFloat, Field(gt=0)],
1196
+ Tuple[
1197
+ Annotated[StrictFloat, Field(gt=0)],
1198
+ Annotated[StrictFloat, Field(gt=0)]
1199
+ ]
1200
+ ] = None,
1201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1202
+ _content_type: Optional[StrictStr] = None,
1203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1205
+ ) -> ApiResponse[Model]:
1206
+ """Get Model
1207
+
1208
+
1209
+ :param sensor_id: (required)
1210
+ :type sensor_id: str
1211
+ :param _request_timeout: timeout setting for this request. If one
1212
+ number provided, it will be total request
1213
+ timeout. It can also be a pair (tuple) of
1214
+ (connection, read) timeouts.
1215
+ :type _request_timeout: int, tuple(int, int), optional
1216
+ :param _request_auth: set to override the auth_settings for an a single
1217
+ request; this effectively ignores the
1218
+ authentication in the spec for a single request.
1219
+ :type _request_auth: dict, optional
1220
+ :param _content_type: force content-type for the request.
1221
+ :type _content_type: str, Optional
1222
+ :param _headers: set to override the headers for a single
1223
+ request; this effectively ignores the headers
1224
+ in the spec for a single request.
1225
+ :type _headers: dict, optional
1226
+ :param _host_index: set to override the host_index for a single
1227
+ request; this effectively ignores the host_index
1228
+ in the spec for a single request.
1229
+ :type _host_index: int, optional
1230
+ :return: Returns the result object.
1231
+ """ # noqa: E501
1232
+
1233
+ _param = self._get_model_serialize(
1234
+ sensor_id=sensor_id,
1235
+ _request_auth=_request_auth,
1236
+ _content_type=_content_type,
1237
+ _headers=_headers,
1238
+ _host_index=_host_index
1239
+ )
1240
+
1241
+ _response_types_map: Dict[str, Optional[str]] = {
1242
+ '200': "Model",
1243
+ '400': None,
1244
+ '404': None,
1245
+ }
1246
+ response_data = self.api_client.call_api(
1247
+ *_param,
1248
+ _request_timeout=_request_timeout
1249
+ )
1250
+ response_data.read()
1251
+ return self.api_client.response_deserialize(
1252
+ response_data=response_data,
1253
+ response_types_map=_response_types_map,
1254
+ )
1255
+
1256
+
1257
+ @validate_call
1258
+ def get_model_without_preload_content(
1259
+ self,
1260
+ sensor_id: StrictStr,
1261
+ _request_timeout: Union[
1262
+ None,
1263
+ Annotated[StrictFloat, Field(gt=0)],
1264
+ Tuple[
1265
+ Annotated[StrictFloat, Field(gt=0)],
1266
+ Annotated[StrictFloat, Field(gt=0)]
1267
+ ]
1268
+ ] = None,
1269
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1270
+ _content_type: Optional[StrictStr] = None,
1271
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1272
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1273
+ ) -> RESTResponseType:
1274
+ """Get Model
1275
+
1276
+
1277
+ :param sensor_id: (required)
1278
+ :type sensor_id: str
1279
+ :param _request_timeout: timeout setting for this request. If one
1280
+ number provided, it will be total request
1281
+ timeout. It can also be a pair (tuple) of
1282
+ (connection, read) timeouts.
1283
+ :type _request_timeout: int, tuple(int, int), optional
1284
+ :param _request_auth: set to override the auth_settings for an a single
1285
+ request; this effectively ignores the
1286
+ authentication in the spec for a single request.
1287
+ :type _request_auth: dict, optional
1288
+ :param _content_type: force content-type for the request.
1289
+ :type _content_type: str, Optional
1290
+ :param _headers: set to override the headers for a single
1291
+ request; this effectively ignores the headers
1292
+ in the spec for a single request.
1293
+ :type _headers: dict, optional
1294
+ :param _host_index: set to override the host_index for a single
1295
+ request; this effectively ignores the host_index
1296
+ in the spec for a single request.
1297
+ :type _host_index: int, optional
1298
+ :return: Returns the result object.
1299
+ """ # noqa: E501
1300
+
1301
+ _param = self._get_model_serialize(
1302
+ sensor_id=sensor_id,
1303
+ _request_auth=_request_auth,
1304
+ _content_type=_content_type,
1305
+ _headers=_headers,
1306
+ _host_index=_host_index
1307
+ )
1308
+
1309
+ _response_types_map: Dict[str, Optional[str]] = {
1310
+ '200': "Model",
1311
+ '400': None,
1312
+ '404': None,
1313
+ }
1314
+ response_data = self.api_client.call_api(
1315
+ *_param,
1316
+ _request_timeout=_request_timeout
1317
+ )
1318
+ return response_data.response
1319
+
1320
+
1321
+ def _get_model_serialize(
1322
+ self,
1323
+ sensor_id,
1324
+ _request_auth,
1325
+ _content_type,
1326
+ _headers,
1327
+ _host_index,
1328
+ ) -> RequestSerialized:
1329
+
1330
+ _host = None
1331
+
1332
+ _collection_formats: Dict[str, str] = {
1333
+ }
1334
+
1335
+ _path_params: Dict[str, str] = {}
1336
+ _query_params: List[Tuple[str, str]] = []
1337
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1338
+ _form_params: List[Tuple[str, str]] = []
1339
+ _files: Dict[str, Union[str, bytes]] = {}
1340
+ _body_params: Optional[bytes] = None
1341
+
1342
+ # process the path parameters
1343
+ if sensor_id is not None:
1344
+ _path_params['sensor_id'] = sensor_id
1345
+ # process the query parameters
1346
+ # process the header parameters
1347
+ # process the form parameters
1348
+ # process the body parameter
1349
+
1350
+
1351
+ # set the HTTP header `Accept`
1352
+ _header_params['Accept'] = self.api_client.select_header_accept(
1353
+ [
1354
+ 'application/json'
1355
+ ]
1356
+ )
1357
+
1358
+
1359
+ # authentication setting
1360
+ _auth_settings: List[str] = [
1361
+ 'BearerAuth'
1362
+ ]
1363
+
1364
+ return self.api_client.param_serialize(
1365
+ method='GET',
1366
+ resource_path='/api/v2/sensors/{sensor_id}',
1367
+ path_params=_path_params,
1368
+ query_params=_query_params,
1369
+ header_params=_header_params,
1370
+ body=_body_params,
1371
+ post_params=_form_params,
1372
+ files=_files,
1373
+ auth_settings=_auth_settings,
1374
+ collection_formats=_collection_formats,
1375
+ _host=_host,
1376
+ _request_auth=_request_auth
1377
+ )
1378
+
1379
+
1380
+
1381
+
1382
+ @validate_call
1383
+ def query_sensor(
1384
+ self,
1385
+ sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
1386
+ _request_timeout: Union[
1387
+ None,
1388
+ Annotated[StrictFloat, Field(gt=0)],
1389
+ Tuple[
1390
+ Annotated[StrictFloat, Field(gt=0)],
1391
+ Annotated[StrictFloat, Field(gt=0)]
1392
+ ]
1393
+ ] = None,
1394
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1395
+ _content_type: Optional[StrictStr] = None,
1396
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1397
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1398
+ ) -> ModelQueryResponse:
1399
+ """Query a Sensor
1400
+
1401
+
1402
+ :param sensor_sor_query_request: Request body for create
1403
+ :type sensor_sor_query_request: SensorSORQueryRequest
1404
+ :param _request_timeout: timeout setting for this request. If one
1405
+ number provided, it will be total request
1406
+ timeout. It can also be a pair (tuple) of
1407
+ (connection, read) timeouts.
1408
+ :type _request_timeout: int, tuple(int, int), optional
1409
+ :param _request_auth: set to override the auth_settings for an a single
1410
+ request; this effectively ignores the
1411
+ authentication in the spec for a single request.
1412
+ :type _request_auth: dict, optional
1413
+ :param _content_type: force content-type for the request.
1414
+ :type _content_type: str, Optional
1415
+ :param _headers: set to override the headers for a single
1416
+ request; this effectively ignores the headers
1417
+ in the spec for a single request.
1418
+ :type _headers: dict, optional
1419
+ :param _host_index: set to override the host_index for a single
1420
+ request; this effectively ignores the host_index
1421
+ in the spec for a single request.
1422
+ :type _host_index: int, optional
1423
+ :return: Returns the result object.
1424
+ """ # noqa: E501
1425
+
1426
+ _param = self._query_sensor_serialize(
1427
+ sensor_sor_query_request=sensor_sor_query_request,
1428
+ _request_auth=_request_auth,
1429
+ _content_type=_content_type,
1430
+ _headers=_headers,
1431
+ _host_index=_host_index
1432
+ )
1433
+
1434
+ _response_types_map: Dict[str, Optional[str]] = {
1435
+ '200': "ModelQueryResponse",
1436
+ '400': None,
1437
+ }
1438
+ response_data = self.api_client.call_api(
1439
+ *_param,
1440
+ _request_timeout=_request_timeout
1441
+ )
1442
+ response_data.read()
1443
+ return self.api_client.response_deserialize(
1444
+ response_data=response_data,
1445
+ response_types_map=_response_types_map,
1446
+ ).data
1447
+
1448
+
1449
+ @validate_call
1450
+ def query_sensor_with_http_info(
1451
+ self,
1452
+ sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
1453
+ _request_timeout: Union[
1454
+ None,
1455
+ Annotated[StrictFloat, Field(gt=0)],
1456
+ Tuple[
1457
+ Annotated[StrictFloat, Field(gt=0)],
1458
+ Annotated[StrictFloat, Field(gt=0)]
1459
+ ]
1460
+ ] = None,
1461
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1462
+ _content_type: Optional[StrictStr] = None,
1463
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1464
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1465
+ ) -> ApiResponse[ModelQueryResponse]:
1466
+ """Query a Sensor
1467
+
1468
+
1469
+ :param sensor_sor_query_request: Request body for create
1470
+ :type sensor_sor_query_request: SensorSORQueryRequest
1471
+ :param _request_timeout: timeout setting for this request. If one
1472
+ number provided, it will be total request
1473
+ timeout. It can also be a pair (tuple) of
1474
+ (connection, read) timeouts.
1475
+ :type _request_timeout: int, tuple(int, int), optional
1476
+ :param _request_auth: set to override the auth_settings for an a single
1477
+ request; this effectively ignores the
1478
+ authentication in the spec for a single request.
1479
+ :type _request_auth: dict, optional
1480
+ :param _content_type: force content-type for the request.
1481
+ :type _content_type: str, Optional
1482
+ :param _headers: set to override the headers for a single
1483
+ request; this effectively ignores the headers
1484
+ in the spec for a single request.
1485
+ :type _headers: dict, optional
1486
+ :param _host_index: set to override the host_index for a single
1487
+ request; this effectively ignores the host_index
1488
+ in the spec for a single request.
1489
+ :type _host_index: int, optional
1490
+ :return: Returns the result object.
1491
+ """ # noqa: E501
1492
+
1493
+ _param = self._query_sensor_serialize(
1494
+ sensor_sor_query_request=sensor_sor_query_request,
1495
+ _request_auth=_request_auth,
1496
+ _content_type=_content_type,
1497
+ _headers=_headers,
1498
+ _host_index=_host_index
1499
+ )
1500
+
1501
+ _response_types_map: Dict[str, Optional[str]] = {
1502
+ '200': "ModelQueryResponse",
1503
+ '400': None,
1504
+ }
1505
+ response_data = self.api_client.call_api(
1506
+ *_param,
1507
+ _request_timeout=_request_timeout
1508
+ )
1509
+ response_data.read()
1510
+ return self.api_client.response_deserialize(
1511
+ response_data=response_data,
1512
+ response_types_map=_response_types_map,
1513
+ )
1514
+
1515
+
1516
+ @validate_call
1517
+ def query_sensor_without_preload_content(
1518
+ self,
1519
+ sensor_sor_query_request: Annotated[Optional[SensorSORQueryRequest], Field(description="Request body for create")] = None,
1520
+ _request_timeout: Union[
1521
+ None,
1522
+ Annotated[StrictFloat, Field(gt=0)],
1523
+ Tuple[
1524
+ Annotated[StrictFloat, Field(gt=0)],
1525
+ Annotated[StrictFloat, Field(gt=0)]
1526
+ ]
1527
+ ] = None,
1528
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1529
+ _content_type: Optional[StrictStr] = None,
1530
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1531
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1532
+ ) -> RESTResponseType:
1533
+ """Query a Sensor
1534
+
1535
+
1536
+ :param sensor_sor_query_request: Request body for create
1537
+ :type sensor_sor_query_request: SensorSORQueryRequest
1538
+ :param _request_timeout: timeout setting for this request. If one
1539
+ number provided, it will be total request
1540
+ timeout. It can also be a pair (tuple) of
1541
+ (connection, read) timeouts.
1542
+ :type _request_timeout: int, tuple(int, int), optional
1543
+ :param _request_auth: set to override the auth_settings for an a single
1544
+ request; this effectively ignores the
1545
+ authentication in the spec for a single request.
1546
+ :type _request_auth: dict, optional
1547
+ :param _content_type: force content-type for the request.
1548
+ :type _content_type: str, Optional
1549
+ :param _headers: set to override the headers for a single
1550
+ request; this effectively ignores the headers
1551
+ in the spec for a single request.
1552
+ :type _headers: dict, optional
1553
+ :param _host_index: set to override the host_index for a single
1554
+ request; this effectively ignores the host_index
1555
+ in the spec for a single request.
1556
+ :type _host_index: int, optional
1557
+ :return: Returns the result object.
1558
+ """ # noqa: E501
1559
+
1560
+ _param = self._query_sensor_serialize(
1561
+ sensor_sor_query_request=sensor_sor_query_request,
1562
+ _request_auth=_request_auth,
1563
+ _content_type=_content_type,
1564
+ _headers=_headers,
1565
+ _host_index=_host_index
1566
+ )
1567
+
1568
+ _response_types_map: Dict[str, Optional[str]] = {
1569
+ '200': "ModelQueryResponse",
1570
+ '400': None,
1571
+ }
1572
+ response_data = self.api_client.call_api(
1573
+ *_param,
1574
+ _request_timeout=_request_timeout
1575
+ )
1576
+ return response_data.response
1577
+
1578
+
1579
+ def _query_sensor_serialize(
1580
+ self,
1581
+ sensor_sor_query_request,
1582
+ _request_auth,
1583
+ _content_type,
1584
+ _headers,
1585
+ _host_index,
1586
+ ) -> RequestSerialized:
1587
+
1588
+ _host = None
1589
+
1590
+ _collection_formats: Dict[str, str] = {
1591
+ }
1592
+
1593
+ _path_params: Dict[str, str] = {}
1594
+ _query_params: List[Tuple[str, str]] = []
1595
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1596
+ _form_params: List[Tuple[str, str]] = []
1597
+ _files: Dict[str, Union[str, bytes]] = {}
1598
+ _body_params: Optional[bytes] = None
1599
+
1600
+ # process the path parameters
1601
+ # process the query parameters
1602
+ # process the header parameters
1603
+ # process the form parameters
1604
+ # process the body parameter
1605
+ if sensor_sor_query_request is not None:
1606
+ _body_params = sensor_sor_query_request
1607
+
1608
+
1609
+ # set the HTTP header `Accept`
1610
+ _header_params['Accept'] = self.api_client.select_header_accept(
1611
+ [
1612
+ 'application/json'
1613
+ ]
1614
+ )
1615
+
1616
+ # set the HTTP header `Content-Type`
1617
+ if _content_type:
1618
+ _header_params['Content-Type'] = _content_type
1619
+ else:
1620
+ _default_content_type = (
1621
+ self.api_client.select_header_content_type(
1622
+ [
1623
+ 'application/json'
1624
+ ]
1625
+ )
1626
+ )
1627
+ if _default_content_type is not None:
1628
+ _header_params['Content-Type'] = _default_content_type
1629
+
1630
+ # authentication setting
1631
+ _auth_settings: List[str] = [
1632
+ 'BearerAuth'
1633
+ ]
1634
+
1635
+ return self.api_client.param_serialize(
1636
+ method='POST',
1637
+ resource_path='/api/v2/sensors/query',
1638
+ path_params=_path_params,
1639
+ query_params=_query_params,
1640
+ header_params=_header_params,
1641
+ body=_body_params,
1642
+ post_params=_form_params,
1643
+ files=_files,
1644
+ auth_settings=_auth_settings,
1645
+ collection_formats=_collection_formats,
1646
+ _host=_host,
1647
+ _request_auth=_request_auth
1648
+ )
1649
+
1650
+
1651
+
1652
+
1653
+ @validate_call
1654
+ def upload_model_part(
1655
+ self,
1656
+ sensor_id: StrictStr,
1657
+ upload_id: StrictStr,
1658
+ part: Union[StrictFloat, StrictInt],
1659
+ body: Optional[Any],
1660
+ _request_timeout: Union[
1661
+ None,
1662
+ Annotated[StrictFloat, Field(gt=0)],
1663
+ Tuple[
1664
+ Annotated[StrictFloat, Field(gt=0)],
1665
+ Annotated[StrictFloat, Field(gt=0)]
1666
+ ]
1667
+ ] = None,
1668
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1669
+ _content_type: Optional[StrictStr] = None,
1670
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1671
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1672
+ ) -> object:
1673
+ """Upload part
1674
+
1675
+
1676
+ :param sensor_id: (required)
1677
+ :type sensor_id: str
1678
+ :param upload_id: (required)
1679
+ :type upload_id: str
1680
+ :param part: (required)
1681
+ :type part: float
1682
+ :param body: (required)
1683
+ :type body: object
1684
+ :param _request_timeout: timeout setting for this request. If one
1685
+ number provided, it will be total request
1686
+ timeout. It can also be a pair (tuple) of
1687
+ (connection, read) timeouts.
1688
+ :type _request_timeout: int, tuple(int, int), optional
1689
+ :param _request_auth: set to override the auth_settings for an a single
1690
+ request; this effectively ignores the
1691
+ authentication in the spec for a single request.
1692
+ :type _request_auth: dict, optional
1693
+ :param _content_type: force content-type for the request.
1694
+ :type _content_type: str, Optional
1695
+ :param _headers: set to override the headers for a single
1696
+ request; this effectively ignores the headers
1697
+ in the spec for a single request.
1698
+ :type _headers: dict, optional
1699
+ :param _host_index: set to override the host_index for a single
1700
+ request; this effectively ignores the host_index
1701
+ in the spec for a single request.
1702
+ :type _host_index: int, optional
1703
+ :return: Returns the result object.
1704
+ """ # noqa: E501
1705
+
1706
+ _param = self._upload_model_part_serialize(
1707
+ sensor_id=sensor_id,
1708
+ upload_id=upload_id,
1709
+ part=part,
1710
+ body=body,
1711
+ _request_auth=_request_auth,
1712
+ _content_type=_content_type,
1713
+ _headers=_headers,
1714
+ _host_index=_host_index
1715
+ )
1716
+
1717
+ _response_types_map: Dict[str, Optional[str]] = {
1718
+ '200': "object",
1719
+ '400': None,
1720
+ }
1721
+ response_data = self.api_client.call_api(
1722
+ *_param,
1723
+ _request_timeout=_request_timeout
1724
+ )
1725
+ response_data.read()
1726
+ return self.api_client.response_deserialize(
1727
+ response_data=response_data,
1728
+ response_types_map=_response_types_map,
1729
+ ).data
1730
+
1731
+
1732
+ @validate_call
1733
+ def upload_model_part_with_http_info(
1734
+ self,
1735
+ sensor_id: StrictStr,
1736
+ upload_id: StrictStr,
1737
+ part: Union[StrictFloat, StrictInt],
1738
+ body: Optional[Any],
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[object]:
1752
+ """Upload part
1753
+
1754
+
1755
+ :param sensor_id: (required)
1756
+ :type sensor_id: str
1757
+ :param upload_id: (required)
1758
+ :type upload_id: str
1759
+ :param part: (required)
1760
+ :type part: float
1761
+ :param body: (required)
1762
+ :type body: object
1763
+ :param _request_timeout: timeout setting for this request. If one
1764
+ number provided, it will be total request
1765
+ timeout. It can also be a pair (tuple) of
1766
+ (connection, read) timeouts.
1767
+ :type _request_timeout: int, tuple(int, int), optional
1768
+ :param _request_auth: set to override the auth_settings for an a single
1769
+ request; this effectively ignores the
1770
+ authentication in the spec for a single request.
1771
+ :type _request_auth: dict, optional
1772
+ :param _content_type: force content-type for the request.
1773
+ :type _content_type: str, Optional
1774
+ :param _headers: set to override the headers for a single
1775
+ request; this effectively ignores the headers
1776
+ in the spec for a single request.
1777
+ :type _headers: dict, optional
1778
+ :param _host_index: set to override the host_index for a single
1779
+ request; this effectively ignores the host_index
1780
+ in the spec for a single request.
1781
+ :type _host_index: int, optional
1782
+ :return: Returns the result object.
1783
+ """ # noqa: E501
1784
+
1785
+ _param = self._upload_model_part_serialize(
1786
+ sensor_id=sensor_id,
1787
+ upload_id=upload_id,
1788
+ part=part,
1789
+ body=body,
1790
+ _request_auth=_request_auth,
1791
+ _content_type=_content_type,
1792
+ _headers=_headers,
1793
+ _host_index=_host_index
1794
+ )
1795
+
1796
+ _response_types_map: Dict[str, Optional[str]] = {
1797
+ '200': "object",
1798
+ '400': None,
1799
+ }
1800
+ response_data = self.api_client.call_api(
1801
+ *_param,
1802
+ _request_timeout=_request_timeout
1803
+ )
1804
+ response_data.read()
1805
+ return self.api_client.response_deserialize(
1806
+ response_data=response_data,
1807
+ response_types_map=_response_types_map,
1808
+ )
1809
+
1810
+
1811
+ @validate_call
1812
+ def upload_model_part_without_preload_content(
1813
+ self,
1814
+ sensor_id: StrictStr,
1815
+ upload_id: StrictStr,
1816
+ part: Union[StrictFloat, StrictInt],
1817
+ body: Optional[Any],
1818
+ _request_timeout: Union[
1819
+ None,
1820
+ Annotated[StrictFloat, Field(gt=0)],
1821
+ Tuple[
1822
+ Annotated[StrictFloat, Field(gt=0)],
1823
+ Annotated[StrictFloat, Field(gt=0)]
1824
+ ]
1825
+ ] = None,
1826
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1827
+ _content_type: Optional[StrictStr] = None,
1828
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1829
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1830
+ ) -> RESTResponseType:
1831
+ """Upload part
1832
+
1833
+
1834
+ :param sensor_id: (required)
1835
+ :type sensor_id: str
1836
+ :param upload_id: (required)
1837
+ :type upload_id: str
1838
+ :param part: (required)
1839
+ :type part: float
1840
+ :param body: (required)
1841
+ :type body: object
1842
+ :param _request_timeout: timeout setting for this request. If one
1843
+ number provided, it will be total request
1844
+ timeout. It can also be a pair (tuple) of
1845
+ (connection, read) timeouts.
1846
+ :type _request_timeout: int, tuple(int, int), optional
1847
+ :param _request_auth: set to override the auth_settings for an a single
1848
+ request; this effectively ignores the
1849
+ authentication in the spec for a single request.
1850
+ :type _request_auth: dict, optional
1851
+ :param _content_type: force content-type for the request.
1852
+ :type _content_type: str, Optional
1853
+ :param _headers: set to override the headers for a single
1854
+ request; this effectively ignores the headers
1855
+ in the spec for a single request.
1856
+ :type _headers: dict, optional
1857
+ :param _host_index: set to override the host_index for a single
1858
+ request; this effectively ignores the host_index
1859
+ in the spec for a single request.
1860
+ :type _host_index: int, optional
1861
+ :return: Returns the result object.
1862
+ """ # noqa: E501
1863
+
1864
+ _param = self._upload_model_part_serialize(
1865
+ sensor_id=sensor_id,
1866
+ upload_id=upload_id,
1867
+ part=part,
1868
+ body=body,
1869
+ _request_auth=_request_auth,
1870
+ _content_type=_content_type,
1871
+ _headers=_headers,
1872
+ _host_index=_host_index
1873
+ )
1874
+
1875
+ _response_types_map: Dict[str, Optional[str]] = {
1876
+ '200': "object",
1877
+ '400': None,
1878
+ }
1879
+ response_data = self.api_client.call_api(
1880
+ *_param,
1881
+ _request_timeout=_request_timeout
1882
+ )
1883
+ return response_data.response
1884
+
1885
+
1886
+ def _upload_model_part_serialize(
1887
+ self,
1888
+ sensor_id,
1889
+ upload_id,
1890
+ part,
1891
+ body,
1892
+ _request_auth,
1893
+ _content_type,
1894
+ _headers,
1895
+ _host_index,
1896
+ ) -> RequestSerialized:
1897
+
1898
+ _host = None
1899
+
1900
+ _collection_formats: Dict[str, str] = {
1901
+ }
1902
+
1903
+ _path_params: Dict[str, str] = {}
1904
+ _query_params: List[Tuple[str, str]] = []
1905
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1906
+ _form_params: List[Tuple[str, str]] = []
1907
+ _files: Dict[str, Union[str, bytes]] = {}
1908
+ _body_params: Optional[bytes] = None
1909
+
1910
+ # process the path parameters
1911
+ if sensor_id is not None:
1912
+ _path_params['sensor_id'] = sensor_id
1913
+ if upload_id is not None:
1914
+ _path_params['upload_id'] = upload_id
1915
+ if part is not None:
1916
+ _path_params['part'] = part
1917
+ # process the query parameters
1918
+ # process the header parameters
1919
+ # process the form parameters
1920
+ # process the body parameter
1921
+ if body is not None:
1922
+ _body_params = body
1923
+
1924
+
1925
+ # set the HTTP header `Accept`
1926
+ _header_params['Accept'] = self.api_client.select_header_accept(
1927
+ [
1928
+ 'application/json'
1929
+ ]
1930
+ )
1931
+
1932
+ # set the HTTP header `Content-Type`
1933
+ if _content_type:
1934
+ _header_params['Content-Type'] = _content_type
1935
+ else:
1936
+ _default_content_type = (
1937
+ self.api_client.select_header_content_type(
1938
+ [
1939
+ 'application/octet-stream'
1940
+ ]
1941
+ )
1942
+ )
1943
+ if _default_content_type is not None:
1944
+ _header_params['Content-Type'] = _default_content_type
1945
+
1946
+ # authentication setting
1947
+ _auth_settings: List[str] = [
1948
+ 'BearerAuth'
1949
+ ]
1950
+
1951
+ return self.api_client.param_serialize(
1952
+ method='PUT',
1953
+ resource_path='/api/v2/sensors/{sensor_id}/upload/{upload_id}/part/{part}',
1954
+ path_params=_path_params,
1955
+ query_params=_query_params,
1956
+ header_params=_header_params,
1957
+ body=_body_params,
1958
+ post_params=_form_params,
1959
+ files=_files,
1960
+ auth_settings=_auth_settings,
1961
+ collection_formats=_collection_formats,
1962
+ _host=_host,
1963
+ _request_auth=_request_auth
1964
+ )
1965
+
1966
+