kelvin-python-api-client 0.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 (43) hide show
  1. kelvin/api/client/__init__.py +15 -0
  2. kelvin/api/client/api/app_manager.py +646 -0
  3. kelvin/api/client/api/app_registry.py +342 -0
  4. kelvin/api/client/api/asset.py +1012 -0
  5. kelvin/api/client/api/asset_insights.py +67 -0
  6. kelvin/api/client/api/bridge.py +306 -0
  7. kelvin/api/client/api/control_change.py +398 -0
  8. kelvin/api/client/api/data_tag.py +499 -0
  9. kelvin/api/client/api/datastreams.py +1021 -0
  10. kelvin/api/client/api/filestorage.py +234 -0
  11. kelvin/api/client/api/instance.py +559 -0
  12. kelvin/api/client/api/orchestration.py +717 -0
  13. kelvin/api/client/api/parameters.py +417 -0
  14. kelvin/api/client/api/recommendation.py +804 -0
  15. kelvin/api/client/api/secret.py +173 -0
  16. kelvin/api/client/api/thread.py +435 -0
  17. kelvin/api/client/api/timeseries.py +273 -0
  18. kelvin/api/client/api/user.py +382 -0
  19. kelvin/api/client/api/workload.py +437 -0
  20. kelvin/api/client/base_client.py +924 -0
  21. kelvin/api/client/base_model.py +187 -0
  22. kelvin/api/client/client.py +181 -0
  23. kelvin/api/client/config.py +709 -0
  24. kelvin/api/client/data_model.py +523 -0
  25. kelvin/api/client/dataframe_conversion.py +172 -0
  26. kelvin/api/client/deeplist.py +285 -0
  27. kelvin/api/client/error.py +77 -0
  28. kelvin/api/client/model/__init__.py +3 -0
  29. kelvin/api/client/model/enum.py +82 -0
  30. kelvin/api/client/model/pagination.py +61 -0
  31. kelvin/api/client/model/requests.py +3352 -0
  32. kelvin/api/client/model/response.py +68 -0
  33. kelvin/api/client/model/responses.py +4799 -0
  34. kelvin/api/client/model/type.py +2025 -0
  35. kelvin/api/client/py.typed +0 -0
  36. kelvin/api/client/retry.py +88 -0
  37. kelvin/api/client/serialize.py +222 -0
  38. kelvin/api/client/utils.py +316 -0
  39. kelvin/api/client/version.py +16 -0
  40. kelvin_python_api_client-0.0.1.dist-info/METADATA +75 -0
  41. kelvin_python_api_client-0.0.1.dist-info/RECORD +43 -0
  42. kelvin_python_api_client-0.0.1.dist-info/WHEEL +5 -0
  43. kelvin_python_api_client-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1012 @@
1
+ """
2
+ Kelvin API Client.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Any, List, Mapping, Optional, Sequence, Union
8
+
9
+ from typing_extensions import Literal
10
+
11
+ from kelvin.api.client.data_model import DataModelBase
12
+
13
+ from ..model import requests, responses, type
14
+
15
+
16
+ class Asset(DataModelBase):
17
+ @classmethod
18
+ def create_asset_bulk(
19
+ cls,
20
+ dry_run: Optional[bool] = None,
21
+ data: Optional[Union[requests.AssetBulkCreate, Mapping[str, Any]]] = None,
22
+ _dry_run: bool = False,
23
+ _client: Any = None,
24
+ **kwargs: Any,
25
+ ) -> None:
26
+ """
27
+ Create new Assets.
28
+
29
+ **Permission Required:** `kelvin.permission.asset.create`.
30
+
31
+ ``createAssetBulk``: ``POST`` ``/api/v4/assets/bulk/create``
32
+
33
+ Parameters
34
+ ----------
35
+ dry_run : :obj:`bool`
36
+ Executes a simulated run when set to true, providing feedback without
37
+ altering server data.
38
+ data: requests.AssetBulkCreate, optional
39
+ **kwargs:
40
+ Extra parameters for requests.AssetBulkCreate
41
+ - create_asset_bulk: dict
42
+
43
+ """
44
+
45
+ result = cls._make_request(
46
+ _client,
47
+ "post",
48
+ "/api/v4/assets/bulk/create",
49
+ {},
50
+ {"dry_run": dry_run},
51
+ {},
52
+ {},
53
+ data,
54
+ "requests.AssetBulkCreate",
55
+ False,
56
+ {"200": None, "400": None, "401": None, "412": None},
57
+ False,
58
+ _dry_run,
59
+ kwargs,
60
+ )
61
+ return result
62
+
63
+ @classmethod
64
+ def create_asset(
65
+ cls,
66
+ data: Optional[Union[requests.AssetCreate, Mapping[str, Any]]] = None,
67
+ _dry_run: bool = False,
68
+ _client: Any = None,
69
+ **kwargs: Any,
70
+ ) -> responses.AssetCreate:
71
+ """
72
+ Create a new Asset.
73
+
74
+ **Permission Required:** `kelvin.permission.asset.create`.
75
+
76
+ ``createAsset``: ``POST`` ``/api/v4/assets/create``
77
+
78
+ Parameters
79
+ ----------
80
+ data: requests.AssetCreate, optional
81
+ **kwargs:
82
+ Extra parameters for requests.AssetCreate
83
+ - create_asset: dict
84
+
85
+ """
86
+
87
+ from ..model import responses
88
+
89
+ result = cls._make_request(
90
+ _client,
91
+ "post",
92
+ "/api/v4/assets/create",
93
+ {},
94
+ {},
95
+ {},
96
+ {},
97
+ data,
98
+ "requests.AssetCreate",
99
+ False,
100
+ {"201": responses.AssetCreate, "400": None, "401": None, "412": None},
101
+ False,
102
+ _dry_run,
103
+ kwargs,
104
+ )
105
+ return result
106
+
107
+ @classmethod
108
+ def delete_asset_bulk(
109
+ cls,
110
+ data: Optional[Union[requests.AssetBulkDelete, Mapping[str, Any]]] = None,
111
+ _dry_run: bool = False,
112
+ _client: Any = None,
113
+ **kwargs: Any,
114
+ ) -> None:
115
+ """
116
+ Delete a list of existing Assets.
117
+
118
+ Permanently delete a list of existing Kelvin Assets. This cannot be undone once the API request has been submitted.
119
+
120
+ **Permission Required:** `kelvin.permission.asset.delete`.
121
+
122
+ ``deleteAssetBulk``: ``POST`` ``/api/v4/assets/delete``
123
+
124
+ Parameters
125
+ ----------
126
+ data: requests.AssetBulkDelete, optional
127
+ **kwargs:
128
+ Extra parameters for requests.AssetBulkDelete
129
+ - delete_asset_bulk: dict
130
+
131
+ """
132
+
133
+ result = cls._make_request(
134
+ _client,
135
+ "post",
136
+ "/api/v4/assets/delete",
137
+ {},
138
+ {},
139
+ {},
140
+ {},
141
+ data,
142
+ "requests.AssetBulkDelete",
143
+ False,
144
+ {"200": None, "400": None, "401": None, "404": None},
145
+ False,
146
+ _dry_run,
147
+ kwargs,
148
+ )
149
+ return result
150
+
151
+ @classmethod
152
+ def list_assets(
153
+ cls,
154
+ search: Optional[Sequence[str]] = None,
155
+ names: Optional[Sequence[str]] = None,
156
+ asset_type_name: Optional[Sequence[str]] = None,
157
+ status_state: Optional[Sequence[str]] = None,
158
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
159
+ page_size: Optional[int] = 10000,
160
+ page: Optional[int] = None,
161
+ next: Optional[str] = None,
162
+ previous: Optional[str] = None,
163
+ direction: Optional[Literal["asc", "desc"]] = None,
164
+ sort_by: Optional[Sequence[str]] = None,
165
+ fetch: bool = True,
166
+ _dry_run: bool = False,
167
+ _client: Any = None,
168
+ ) -> Union[List[type.Asset], responses.AssetsListPaginatedResponseCursor]:
169
+ """
170
+ Returns a list of Assets and its parameters. The Assets can be optionally filtered and sorted on the server before being returned.
171
+
172
+ **Permission Required:** `kelvin.permission.asset.read`.
173
+
174
+ ``listAssets``: ``GET`` ``/api/v4/assets/list``
175
+
176
+ Parameters
177
+ ----------
178
+ search : :obj:`Sequence[str]`
179
+ Search and filter on the list based on the keys `title` (Display Name)
180
+ or `name`. All values in array will be filtered as `OR`. The search is
181
+ case insensitive and will find partial matches as well.
182
+ names : :obj:`Sequence[str]`
183
+ A filter on the list based on the key `name`. The filter is on the
184
+ full name only. The string can only contain lowercase alphanumeric
185
+ characters and `.`, `_` or `-` characters.
186
+ asset_type_name : :obj:`Sequence[str]`
187
+ A filter on the list based on the key `asset_type_name`. The filter is
188
+ on the full name only. The string can only contain lowercase
189
+ alphanumeric characters and `.`, `_` or `-` characters.
190
+ status_state : :obj:`Sequence[str]`
191
+ A filter on the list based on the key ['status']['state']. Multiple
192
+ statuses can be given and will be filtered as `OR`. The allowed values
193
+ are: `online`, `offline`, `unknown`.
194
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
195
+ Method of pagination to use for return results where `total_items` is
196
+ greater than `page_size`. `cursor` and `limits` will return one `page`
197
+ of results, `stream` will return all results. ('limits', 'cursor',
198
+ 'stream')
199
+ page_size : :obj:`int`
200
+ Number of objects to be returned in each page. Page size can range
201
+ between 1 and 1000 objects.
202
+ page : :obj:`int`
203
+ An integer for the wanted page of results. Used only with
204
+ `pagination_type` set as `limits`.
205
+ next : :obj:`str`
206
+ An alphanumeric string bookmark to indicate where to start for the
207
+ next page. Used only with `pagination_type` set as `cursor`.
208
+ previous : :obj:`str`
209
+ An alphanumeric string bookmark to indicate where to end for the
210
+ previous page. Used only with `pagination_type` set as `cursor`.
211
+ direction : :obj:`Literal['asc', 'desc']`
212
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
213
+ sort_by : :obj:`Sequence[str]`
214
+
215
+ """
216
+
217
+ from ..model import responses
218
+
219
+ result = cls._make_request(
220
+ _client,
221
+ "get",
222
+ "/api/v4/assets/list",
223
+ {},
224
+ {
225
+ "search": search,
226
+ "names": names,
227
+ "asset_type_name": asset_type_name,
228
+ "status_state": status_state,
229
+ "pagination_type": pagination_type,
230
+ "page_size": page_size,
231
+ "page": page,
232
+ "next": next,
233
+ "previous": previous,
234
+ "direction": direction,
235
+ "sort_by": sort_by,
236
+ },
237
+ {},
238
+ {},
239
+ None,
240
+ None,
241
+ False,
242
+ {"200": responses.AssetsListPaginatedResponseCursor, "400": None, "401": None, "404": None},
243
+ False,
244
+ _dry_run,
245
+ )
246
+ return result.fetch("/api/v4/assets/list", "GET") if fetch and not _dry_run else result
247
+
248
+ @classmethod
249
+ def list_assets_advanced(
250
+ cls,
251
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
252
+ page_size: Optional[int] = 10000,
253
+ page: Optional[int] = None,
254
+ next: Optional[str] = None,
255
+ previous: Optional[str] = None,
256
+ direction: Optional[Literal["asc", "desc"]] = None,
257
+ sort_by: Optional[Sequence[str]] = None,
258
+ data: Optional[Union[requests.AssetsAdvancedList, Mapping[str, Any]]] = None,
259
+ fetch: bool = True,
260
+ _dry_run: bool = False,
261
+ _client: Any = None,
262
+ **kwargs: Any,
263
+ ) -> Union[List[type.Asset], responses.AssetsAdvancedListPaginatedResponseCursor]:
264
+ """
265
+ Returns a list of Assets and its parameters. The Assets can be filtered and sorted on the server before being returned. Advanced filter options available for more granular return list.
266
+
267
+ **Permission Required:** `kelvin.permission.asset.read`.
268
+
269
+ ``listAssetsAdvanced``: ``POST`` ``/api/v4/assets/list``
270
+
271
+ Parameters
272
+ ----------
273
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
274
+ Method of pagination to use for return results where `total_items` is
275
+ greater than `page_size`. `cursor` and `limits` will return one `page`
276
+ of results, `stream` will return all results. ('limits', 'cursor',
277
+ 'stream')
278
+ page_size : :obj:`int`
279
+ Number of objects to be returned in each page. Page size can range
280
+ between 1 and 1000 objects.
281
+ page : :obj:`int`
282
+ An integer for the wanted page of results. Used only with
283
+ `pagination_type` set as `limits`.
284
+ next : :obj:`str`
285
+ An alphanumeric string bookmark to indicate where to start for the
286
+ next page. Used only with `pagination_type` set as `cursor`.
287
+ previous : :obj:`str`
288
+ An alphanumeric string bookmark to indicate where to end for the
289
+ previous page. Used only with `pagination_type` set as `cursor`.
290
+ direction : :obj:`Literal['asc', 'desc']`
291
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
292
+ sort_by : :obj:`Sequence[str]`
293
+ data: requests.AssetsAdvancedList, optional
294
+ **kwargs:
295
+ Extra parameters for requests.AssetsAdvancedList
296
+ - list_assets_advanced: dict
297
+
298
+ """
299
+
300
+ from ..model import responses
301
+
302
+ result = cls._make_request(
303
+ _client,
304
+ "post",
305
+ "/api/v4/assets/list",
306
+ {},
307
+ {
308
+ "pagination_type": pagination_type,
309
+ "page_size": page_size,
310
+ "page": page,
311
+ "next": next,
312
+ "previous": previous,
313
+ "direction": direction,
314
+ "sort_by": sort_by,
315
+ },
316
+ {},
317
+ {},
318
+ data,
319
+ "requests.AssetsAdvancedList",
320
+ False,
321
+ {"200": responses.AssetsAdvancedListPaginatedResponseCursor, "400": None, "401": None, "404": None},
322
+ False,
323
+ _dry_run,
324
+ kwargs,
325
+ )
326
+ return result.fetch("/api/v4/assets/list", "POST", data) if fetch and not _dry_run else result
327
+
328
+ @classmethod
329
+ def list_asset_property_definitions(
330
+ cls,
331
+ all: Optional[bool] = None,
332
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
333
+ page_size: Optional[int] = 10000,
334
+ page: Optional[int] = None,
335
+ next: Optional[str] = None,
336
+ previous: Optional[str] = None,
337
+ direction: Optional[Literal["asc", "desc"]] = None,
338
+ sort_by: Optional[Sequence[str]] = None,
339
+ data: Optional[Union[requests.AssetPropertyDefinitionsList, Mapping[str, Any]]] = None,
340
+ fetch: bool = True,
341
+ _dry_run: bool = False,
342
+ _client: Any = None,
343
+ **kwargs: Any,
344
+ ) -> Union[List[type.Property], responses.AssetPropertyDefinitionsListPaginatedResponseCursor]:
345
+ """
346
+ Returns a list of Asset Property Definitions and its parameters. The Asset Property Definitions can be filtered and sorted on the server before being returned.
347
+
348
+ **Permission Required:** `kelvin.permission.asset.read`.
349
+
350
+ ``listAssetPropertyDefinitions``: ``POST`` ``/api/v4/assets/properties/definitions/list``
351
+
352
+ Parameters
353
+ ----------
354
+ all : :obj:`bool`
355
+ Parameter to define whether all properties will be returned or only
356
+ those with values. Default is false.
357
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
358
+ Method of pagination to use for return results where `total_items` is
359
+ greater than `page_size`. `cursor` and `limits` will return one `page`
360
+ of results, `stream` will return all results. ('limits', 'cursor',
361
+ 'stream')
362
+ page_size : :obj:`int`
363
+ Number of objects to be returned in each page. Page size can range
364
+ between 1 and 1000 objects.
365
+ page : :obj:`int`
366
+ An integer for the wanted page of results. Used only with
367
+ `pagination_type` set as `limits`.
368
+ next : :obj:`str`
369
+ An alphanumeric string bookmark to indicate where to start for the
370
+ next page. Used only with `pagination_type` set as `cursor`.
371
+ previous : :obj:`str`
372
+ An alphanumeric string bookmark to indicate where to end for the
373
+ previous page. Used only with `pagination_type` set as `cursor`.
374
+ direction : :obj:`Literal['asc', 'desc']`
375
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
376
+ sort_by : :obj:`Sequence[str]`
377
+ data: requests.AssetPropertyDefinitionsList, optional
378
+ **kwargs:
379
+ Extra parameters for requests.AssetPropertyDefinitionsList
380
+ - list_asset_property_definitions: dict
381
+
382
+ """
383
+
384
+ from ..model import responses
385
+
386
+ result = cls._make_request(
387
+ _client,
388
+ "post",
389
+ "/api/v4/assets/properties/definitions/list",
390
+ {},
391
+ {
392
+ "all": all,
393
+ "pagination_type": pagination_type,
394
+ "page_size": page_size,
395
+ "page": page,
396
+ "next": next,
397
+ "previous": previous,
398
+ "direction": direction,
399
+ "sort_by": sort_by,
400
+ },
401
+ {},
402
+ {},
403
+ data,
404
+ "requests.AssetPropertyDefinitionsList",
405
+ False,
406
+ {
407
+ "200": responses.AssetPropertyDefinitionsListPaginatedResponseCursor,
408
+ "400": None,
409
+ "401": None,
410
+ "404": None,
411
+ },
412
+ False,
413
+ _dry_run,
414
+ kwargs,
415
+ )
416
+ return (
417
+ result.fetch("/api/v4/assets/properties/definitions/list", "POST", data)
418
+ if fetch and not _dry_run
419
+ else result
420
+ )
421
+
422
+ @classmethod
423
+ def get_asset_property_values(
424
+ cls,
425
+ data: Optional[Union[requests.AssetPropertyValuesGet, Mapping[str, Any]]] = None,
426
+ _dry_run: bool = False,
427
+ _client: Any = None,
428
+ **kwargs: Any,
429
+ ) -> responses.AssetPropertyValuesGet:
430
+ """
431
+ Returns a dictionary of Asset Property Values. The dictionary can be optionally filtered and sorted on the server before being returned.
432
+
433
+ **Permission Required:** `kelvin.permission.asset.read`.
434
+
435
+ ``getAssetPropertyValues``: ``POST`` ``/api/v4/assets/properties/values/get``
436
+
437
+ Parameters
438
+ ----------
439
+ data: requests.AssetPropertyValuesGet, optional
440
+ **kwargs:
441
+ Extra parameters for requests.AssetPropertyValuesGet
442
+ - get_asset_property_values: dict
443
+
444
+ """
445
+
446
+ from ..model import responses
447
+
448
+ result = cls._make_request(
449
+ _client,
450
+ "post",
451
+ "/api/v4/assets/properties/values/get",
452
+ {},
453
+ {},
454
+ {},
455
+ {},
456
+ data,
457
+ "requests.AssetPropertyValuesGet",
458
+ False,
459
+ {"200": responses.AssetPropertyValuesGet, "400": None, "401": None, "404": None},
460
+ False,
461
+ _dry_run,
462
+ kwargs,
463
+ )
464
+ return result
465
+
466
+ @classmethod
467
+ def get_asset_status_count(cls, _dry_run: bool = False, _client: Any = None) -> responses.AssetStatusCountGet:
468
+ """
469
+ Retrieve the total count of Assets grouped by the parameter `status`.
470
+
471
+ **Permission Required:** `kelvin.permission.asset.read`.
472
+
473
+ ``getAssetStatusCount``: ``GET`` ``/api/v4/assets/status/count/get``
474
+
475
+ """
476
+
477
+ from ..model import responses
478
+
479
+ result = cls._make_request(
480
+ _client,
481
+ "get",
482
+ "/api/v4/assets/status/count/get",
483
+ {},
484
+ {},
485
+ {},
486
+ {},
487
+ None,
488
+ None,
489
+ False,
490
+ {"200": responses.AssetStatusCountGet, "400": None, "401": None, "404": None},
491
+ False,
492
+ _dry_run,
493
+ )
494
+ return result
495
+
496
+ @classmethod
497
+ def get_asset_status_current(cls, _dry_run: bool = False, _client: Any = None) -> responses.AssetStatusCurrentGet:
498
+ """
499
+ Returns a list of all Assets and their current status (`state`).
500
+
501
+ **Permission Required:** `kelvin.permission.asset.read`.
502
+
503
+ ``getAssetStatusCurrent``: ``GET`` ``/api/v4/assets/status/current/get``
504
+
505
+ """
506
+
507
+ from ..model import responses
508
+
509
+ result = cls._make_request(
510
+ _client,
511
+ "get",
512
+ "/api/v4/assets/status/current/get",
513
+ {},
514
+ {},
515
+ {},
516
+ {},
517
+ None,
518
+ None,
519
+ False,
520
+ {"200": responses.AssetStatusCurrentGet, "400": None, "401": None, "404": None},
521
+ False,
522
+ _dry_run,
523
+ )
524
+ return result
525
+
526
+ @classmethod
527
+ def create_asset_type(
528
+ cls,
529
+ data: Optional[Union[requests.AssetTypeCreate, Mapping[str, Any]]] = None,
530
+ _dry_run: bool = False,
531
+ _client: Any = None,
532
+ **kwargs: Any,
533
+ ) -> responses.AssetTypeCreate:
534
+ """
535
+ Create a new Asset Type.
536
+
537
+ **Permission Required:** `kelvin.permission.asset_type.create`.
538
+
539
+ ``createAssetType``: ``POST`` ``/api/v4/assets/types/create``
540
+
541
+ Parameters
542
+ ----------
543
+ data: requests.AssetTypeCreate, optional
544
+ **kwargs:
545
+ Extra parameters for requests.AssetTypeCreate
546
+ - create_asset_type: dict
547
+
548
+ """
549
+
550
+ from ..model import responses
551
+
552
+ result = cls._make_request(
553
+ _client,
554
+ "post",
555
+ "/api/v4/assets/types/create",
556
+ {},
557
+ {},
558
+ {},
559
+ {},
560
+ data,
561
+ "requests.AssetTypeCreate",
562
+ False,
563
+ {"201": responses.AssetTypeCreate, "400": None, "401": None, "409": None},
564
+ False,
565
+ _dry_run,
566
+ kwargs,
567
+ )
568
+ return result
569
+
570
+ @classmethod
571
+ def delete_asset_type_bulk(
572
+ cls,
573
+ data: Optional[Union[requests.AssetTypeBulkDelete, Mapping[str, Any]]] = None,
574
+ _dry_run: bool = False,
575
+ _client: Any = None,
576
+ **kwargs: Any,
577
+ ) -> None:
578
+ """
579
+ Delete a list of existing Asset Types.
580
+
581
+ Permanently delete a list of existing Kelvin Asset Types. This cannot be undone once the API request has been submitted.
582
+
583
+ This command can not delete Kelvin Asset Types that are currently linked to any Kelvin Assets and will return an error 409.
584
+
585
+ **Permission Required:** `kelvin.permission.asset_type.delete`.
586
+
587
+ ``deleteAssetTypeBulk``: ``POST`` ``/api/v4/assets/types/delete``
588
+
589
+ Parameters
590
+ ----------
591
+ data: requests.AssetTypeBulkDelete, optional
592
+ **kwargs:
593
+ Extra parameters for requests.AssetTypeBulkDelete
594
+ - delete_asset_type_bulk: dict
595
+
596
+ """
597
+
598
+ result = cls._make_request(
599
+ _client,
600
+ "post",
601
+ "/api/v4/assets/types/delete",
602
+ {},
603
+ {},
604
+ {},
605
+ {},
606
+ data,
607
+ "requests.AssetTypeBulkDelete",
608
+ False,
609
+ {"200": None, "400": None, "401": None, "404": None, "409": None},
610
+ False,
611
+ _dry_run,
612
+ kwargs,
613
+ )
614
+ return result
615
+
616
+ @classmethod
617
+ def list_asset_types(
618
+ cls,
619
+ search: Optional[Sequence[str]] = None,
620
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
621
+ page_size: Optional[int] = 10000,
622
+ page: Optional[int] = None,
623
+ next: Optional[str] = None,
624
+ previous: Optional[str] = None,
625
+ direction: Optional[Literal["asc", "desc"]] = None,
626
+ sort_by: Optional[Sequence[str]] = None,
627
+ fetch: bool = True,
628
+ _dry_run: bool = False,
629
+ _client: Any = None,
630
+ ) -> Union[List[type.AssetType], responses.AssetTypesListPaginatedResponseCursor]:
631
+ """
632
+ Returns a list of Asset Types and its parameters. The Asset Types can be optionally filtered and sorted on the server before being returned.
633
+
634
+ **Permission Required:** `kelvin.permission.asset_type.read`.
635
+
636
+ ``listAssetTypes``: ``GET`` ``/api/v4/assets/types/list``
637
+
638
+ Parameters
639
+ ----------
640
+ search : :obj:`Sequence[str]`
641
+ Search and filter on the list based on the keys `title` (Display Name)
642
+ or `name`. The search is case insensitive and will find partial
643
+ matches as well.
644
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
645
+ Method of pagination to use for return results where `total_items` is
646
+ greater than `page_size`. `cursor` and `limits` will return one `page`
647
+ of results, `stream` will return all results. ('limits', 'cursor',
648
+ 'stream')
649
+ page_size : :obj:`int`
650
+ Number of objects to be returned in each page. Page size can range
651
+ between 1 and 1000 objects.
652
+ page : :obj:`int`
653
+ An integer for the wanted page of results. Used only with
654
+ `pagination_type` set as `limits`.
655
+ next : :obj:`str`
656
+ An alphanumeric string bookmark to indicate where to start for the
657
+ next page. Used only with `pagination_type` set as `cursor`.
658
+ previous : :obj:`str`
659
+ An alphanumeric string bookmark to indicate where to end for the
660
+ previous page. Used only with `pagination_type` set as `cursor`.
661
+ direction : :obj:`Literal['asc', 'desc']`
662
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
663
+ sort_by : :obj:`Sequence[str]`
664
+
665
+ """
666
+
667
+ from ..model import responses
668
+
669
+ result = cls._make_request(
670
+ _client,
671
+ "get",
672
+ "/api/v4/assets/types/list",
673
+ {},
674
+ {
675
+ "search": search,
676
+ "pagination_type": pagination_type,
677
+ "page_size": page_size,
678
+ "page": page,
679
+ "next": next,
680
+ "previous": previous,
681
+ "direction": direction,
682
+ "sort_by": sort_by,
683
+ },
684
+ {},
685
+ {},
686
+ None,
687
+ None,
688
+ False,
689
+ {"200": responses.AssetTypesListPaginatedResponseCursor, "400": None, "401": None},
690
+ False,
691
+ _dry_run,
692
+ )
693
+ return result.fetch("/api/v4/assets/types/list", "GET") if fetch and not _dry_run else result
694
+
695
+ @classmethod
696
+ def list_asset_types_advanced(
697
+ cls,
698
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
699
+ page_size: Optional[int] = 10000,
700
+ page: Optional[int] = None,
701
+ next: Optional[str] = None,
702
+ previous: Optional[str] = None,
703
+ direction: Optional[Literal["asc", "desc"]] = None,
704
+ sort_by: Optional[Sequence[str]] = None,
705
+ data: Optional[Union[requests.AssetTypesAdvancedList, Mapping[str, Any]]] = None,
706
+ fetch: bool = True,
707
+ _dry_run: bool = False,
708
+ _client: Any = None,
709
+ **kwargs: Any,
710
+ ) -> Union[List[type.AssetType], responses.AssetTypesAdvancedListPaginatedResponseCursor]:
711
+ """
712
+ Returns a list of Asset Types and its parameters. The Asset Types can be optionally filtered and sorted on the server before being returned.
713
+
714
+ **Permission Required:** `kelvin.permission.asset_type.read`.
715
+
716
+ ``listAssetTypesAdvanced``: ``POST`` ``/api/v4/assets/types/list``
717
+
718
+ Parameters
719
+ ----------
720
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
721
+ Method of pagination to use for return results where `total_items` is
722
+ greater than `page_size`. `cursor` and `limits` will return one `page`
723
+ of results, `stream` will return all results. ('limits', 'cursor',
724
+ 'stream')
725
+ page_size : :obj:`int`
726
+ Number of objects to be returned in each page. Page size can range
727
+ between 1 and 1000 objects.
728
+ page : :obj:`int`
729
+ An integer for the wanted page of results. Used only with
730
+ `pagination_type` set as `limits`.
731
+ next : :obj:`str`
732
+ An alphanumeric string bookmark to indicate where to start for the
733
+ next page. Used only with `pagination_type` set as `cursor`.
734
+ previous : :obj:`str`
735
+ An alphanumeric string bookmark to indicate where to end for the
736
+ previous page. Used only with `pagination_type` set as `cursor`.
737
+ direction : :obj:`Literal['asc', 'desc']`
738
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
739
+ sort_by : :obj:`Sequence[str]`
740
+ data: requests.AssetTypesAdvancedList, optional
741
+ **kwargs:
742
+ Extra parameters for requests.AssetTypesAdvancedList
743
+ - list_asset_types_advanced: dict
744
+
745
+ """
746
+
747
+ from ..model import responses
748
+
749
+ result = cls._make_request(
750
+ _client,
751
+ "post",
752
+ "/api/v4/assets/types/list",
753
+ {},
754
+ {
755
+ "pagination_type": pagination_type,
756
+ "page_size": page_size,
757
+ "page": page,
758
+ "next": next,
759
+ "previous": previous,
760
+ "direction": direction,
761
+ "sort_by": sort_by,
762
+ },
763
+ {},
764
+ {},
765
+ data,
766
+ "requests.AssetTypesAdvancedList",
767
+ False,
768
+ {"200": responses.AssetTypesAdvancedListPaginatedResponseCursor, "400": None, "401": None},
769
+ False,
770
+ _dry_run,
771
+ kwargs,
772
+ )
773
+ return result.fetch("/api/v4/assets/types/list", "POST", data) if fetch and not _dry_run else result
774
+
775
+ @classmethod
776
+ def delete_asset_type(cls, asset_type_name: str, _dry_run: bool = False, _client: Any = None) -> None:
777
+ """
778
+ Permanently delete an existing Asset Type. An error will be returned if there are any current links to an Asset. This cannot be undone once the API request has been submitted.
779
+
780
+ **Permission Required:** `kelvin.permission.asset_type.delete`.
781
+
782
+ ``deleteAssetType``: ``POST`` ``/api/v4/assets/types/{asset_type_name}/delete``
783
+
784
+ Parameters
785
+ ----------
786
+ asset_type_name : :obj:`str`, optional
787
+ Asset Type key `name` to delete. The string can only contain lowercase
788
+ alphanumeric characters and `.`, `_` or `-` characters.
789
+
790
+ """
791
+
792
+ result = cls._make_request(
793
+ _client,
794
+ "post",
795
+ "/api/v4/assets/types/{asset_type_name}/delete",
796
+ {"asset_type_name": asset_type_name},
797
+ {},
798
+ {},
799
+ {},
800
+ None,
801
+ None,
802
+ False,
803
+ {"200": None, "400": None, "401": None, "404": None, "409": None},
804
+ False,
805
+ _dry_run,
806
+ )
807
+ return result
808
+
809
+ @classmethod
810
+ def get_asset_type(
811
+ cls, asset_type_name: str, _dry_run: bool = False, _client: Any = None
812
+ ) -> responses.AssetTypeGet:
813
+ """
814
+ Retrieves the parameters of an Asset Type.
815
+ **Permission Required:** `kelvin.permission.asset_type.read`.
816
+
817
+ ``getAssetType``: ``GET`` ``/api/v4/assets/types/{asset_type_name}/get``
818
+
819
+ Parameters
820
+ ----------
821
+ asset_type_name : :obj:`str`, optional
822
+ Asset Type key `name` to get. The string can only contain lowercase
823
+ alphanumeric characters and `.`, `_` or `-` characters.
824
+
825
+ """
826
+
827
+ from ..model import responses
828
+
829
+ result = cls._make_request(
830
+ _client,
831
+ "get",
832
+ "/api/v4/assets/types/{asset_type_name}/get",
833
+ {"asset_type_name": asset_type_name},
834
+ {},
835
+ {},
836
+ {},
837
+ None,
838
+ None,
839
+ False,
840
+ {"200": responses.AssetTypeGet, "400": None, "401": None, "404": None},
841
+ False,
842
+ _dry_run,
843
+ )
844
+ return result
845
+
846
+ @classmethod
847
+ def update_asset_type(
848
+ cls,
849
+ asset_type_name: str,
850
+ data: Optional[Union[requests.AssetTypeUpdate, Mapping[str, Any]]] = None,
851
+ _dry_run: bool = False,
852
+ _client: Any = None,
853
+ **kwargs: Any,
854
+ ) -> responses.AssetTypeUpdate:
855
+ """
856
+ Updates an existing Asset Type with any new values passed through the body parameters. All body parameters are optional and if not provided will remain unchanged. Only the unique identifier `name` can not be changed.
857
+
858
+ **Permission Required:** `kelvin.permission.asset_type.update`.
859
+
860
+ ``updateAssetType``: ``POST`` ``/api/v4/assets/types/{asset_type_name}/update``
861
+
862
+ Parameters
863
+ ----------
864
+ asset_type_name : :obj:`str`, optional
865
+ Asset Type key `name` to update. The string can only contain lowercase
866
+ alphanumeric characters and `.`, `_` or `-` characters.
867
+ data: requests.AssetTypeUpdate, optional
868
+ **kwargs:
869
+ Extra parameters for requests.AssetTypeUpdate
870
+ - update_asset_type: dict
871
+
872
+ """
873
+
874
+ from ..model import responses
875
+
876
+ result = cls._make_request(
877
+ _client,
878
+ "post",
879
+ "/api/v4/assets/types/{asset_type_name}/update",
880
+ {"asset_type_name": asset_type_name},
881
+ {},
882
+ {},
883
+ {},
884
+ data,
885
+ "requests.AssetTypeUpdate",
886
+ False,
887
+ {"200": responses.AssetTypeUpdate, "400": None, "401": None, "403": None, "404": None, "409": None},
888
+ False,
889
+ _dry_run,
890
+ kwargs,
891
+ )
892
+ return result
893
+
894
+ @classmethod
895
+ def delete_asset(cls, asset_name: str, _dry_run: bool = False, _client: Any = None) -> None:
896
+ """
897
+ Permanently delete an existing Asset. This cannot be undone once the API request has been submitted.
898
+
899
+ The data in the Asset / Data Stream pairs is not deleted and can be recovered if you create the same Asset name again.
900
+
901
+ **Permission Required:** `kelvin.permission.asset.delete`.
902
+
903
+ ``deleteAsset``: ``POST`` ``/api/v4/assets/{asset_name}/delete``
904
+
905
+ Parameters
906
+ ----------
907
+ asset_name : :obj:`str`, optional
908
+ Asset key `name` to delete. The string can only contain lowercase
909
+ alphanumeric characters and `.`, `_` or `-` characters.
910
+
911
+ """
912
+
913
+ result = cls._make_request(
914
+ _client,
915
+ "post",
916
+ "/api/v4/assets/{asset_name}/delete",
917
+ {"asset_name": asset_name},
918
+ {},
919
+ {},
920
+ {},
921
+ None,
922
+ None,
923
+ False,
924
+ {"200": None, "400": None, "401": None, "404": None, "412": None},
925
+ False,
926
+ _dry_run,
927
+ )
928
+ return result
929
+
930
+ @classmethod
931
+ def get_asset(cls, asset_name: str, _dry_run: bool = False, _client: Any = None) -> responses.AssetGet:
932
+ """
933
+ Retrieve the parameters of an Asset.
934
+
935
+ **Permission Required:** `kelvin.permission.asset.read`.
936
+
937
+ ``getAsset``: ``GET`` ``/api/v4/assets/{asset_name}/get``
938
+
939
+ Parameters
940
+ ----------
941
+ asset_name : :obj:`str`, optional
942
+ Asset key `name` to get. The string can only contain lowercase
943
+ alphanumeric characters and `.`, `_` or `-` characters.
944
+
945
+ """
946
+
947
+ from ..model import responses
948
+
949
+ result = cls._make_request(
950
+ _client,
951
+ "get",
952
+ "/api/v4/assets/{asset_name}/get",
953
+ {"asset_name": asset_name},
954
+ {},
955
+ {},
956
+ {},
957
+ None,
958
+ None,
959
+ False,
960
+ {"200": responses.AssetGet, "400": None, "401": None, "404": None},
961
+ False,
962
+ _dry_run,
963
+ )
964
+ return result
965
+
966
+ @classmethod
967
+ def update_asset(
968
+ cls,
969
+ asset_name: str,
970
+ data: Optional[Union[requests.AssetUpdate, Mapping[str, Any]]] = None,
971
+ _dry_run: bool = False,
972
+ _client: Any = None,
973
+ **kwargs: Any,
974
+ ) -> responses.AssetUpdate:
975
+ """
976
+ Update an existing Asset with any new values passed through the body parameters. The minimum required in the body parameters is `title`. If this body parameter does not need to be changed, it should still have the original Display Name (`title``) given. Any other body parameters that are not required and not provided will remain unchanged.
977
+
978
+ **Permission Required:** `kelvin.permission.asset.update`.
979
+
980
+ ``updateAsset``: ``POST`` ``/api/v4/assets/{asset_name}/update``
981
+
982
+ Parameters
983
+ ----------
984
+ asset_name : :obj:`str`, optional
985
+ Asset key `name` to get. The string can only contain lowercase
986
+ alphanumeric characters and `.`, `_` or `-` characters.
987
+ data: requests.AssetUpdate, optional
988
+ **kwargs:
989
+ Extra parameters for requests.AssetUpdate
990
+ - update_asset: dict
991
+
992
+ """
993
+
994
+ from ..model import responses
995
+
996
+ result = cls._make_request(
997
+ _client,
998
+ "post",
999
+ "/api/v4/assets/{asset_name}/update",
1000
+ {"asset_name": asset_name},
1001
+ {},
1002
+ {},
1003
+ {},
1004
+ data,
1005
+ "requests.AssetUpdate",
1006
+ False,
1007
+ {"200": responses.AssetUpdate, "400": None, "401": None, "404": None, "412": None},
1008
+ False,
1009
+ _dry_run,
1010
+ kwargs,
1011
+ )
1012
+ return result