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,804 @@
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 Recommendation(DataModelBase):
17
+ @classmethod
18
+ def get_recommendation_clustering(
19
+ cls,
20
+ data: Optional[Union[requests.RecommendationClusteringGet, Mapping[str, Any]]] = None,
21
+ _dry_run: bool = False,
22
+ _client: Any = None,
23
+ **kwargs: Any,
24
+ ) -> List[responses.RecommendationClustering]:
25
+ """
26
+ Retrieve the total count of Recommendations matching an array of `resources` and filter options between two dates grouped by the parameter `time_bucket`. Will also return a list of all the Recommendation `id`s counted.
27
+
28
+ **Permission Required:** `kelvin.permission.recommendation.read`.
29
+
30
+ ``getRecommendationClustering``: ``POST`` ``/api/v4/recommendations/clustering/get``
31
+
32
+ Parameters
33
+ ----------
34
+ data: requests.RecommendationClusteringGet, optional
35
+ **kwargs:
36
+ Extra parameters for requests.RecommendationClusteringGet
37
+ - get_recommendation_clustering: dict
38
+
39
+ """
40
+
41
+ from ..model import responses
42
+
43
+ result = cls._make_request(
44
+ _client,
45
+ "post",
46
+ "/api/v4/recommendations/clustering/get",
47
+ {},
48
+ {},
49
+ {},
50
+ {},
51
+ data,
52
+ "requests.RecommendationClusteringGet",
53
+ False,
54
+ {"200": List[responses.RecommendationClustering], "400": None, "401": None, "404": None},
55
+ False,
56
+ _dry_run,
57
+ kwargs,
58
+ )
59
+ return result
60
+
61
+ @classmethod
62
+ def create_recommendation(
63
+ cls,
64
+ data: Optional[Union[requests.RecommendationCreate, Mapping[str, Any]]] = None,
65
+ _dry_run: bool = False,
66
+ _client: Any = None,
67
+ **kwargs: Any,
68
+ ) -> responses.RecommendationCreate:
69
+ """
70
+ Create a new Recommendation. The new recommendation will automatically inherit the state `pending`.
71
+
72
+ **Permission Required:** `kelvin.permission.recommendation.create`.
73
+
74
+ ``createRecommendation``: ``POST`` ``/api/v4/recommendations/create``
75
+
76
+ Parameters
77
+ ----------
78
+ data: requests.RecommendationCreate, optional
79
+ **kwargs:
80
+ Extra parameters for requests.RecommendationCreate
81
+ - create_recommendation: dict
82
+
83
+ """
84
+
85
+ from ..model import responses
86
+
87
+ result = cls._make_request(
88
+ _client,
89
+ "post",
90
+ "/api/v4/recommendations/create",
91
+ {},
92
+ {},
93
+ {},
94
+ {},
95
+ data,
96
+ "requests.RecommendationCreate",
97
+ False,
98
+ {"201": responses.RecommendationCreate, "400": None, "404": None},
99
+ False,
100
+ _dry_run,
101
+ kwargs,
102
+ )
103
+ return result
104
+
105
+ @classmethod
106
+ def get_recommendation_last(
107
+ cls,
108
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
109
+ page_size: Optional[int] = 10000,
110
+ page: Optional[int] = None,
111
+ next: Optional[str] = None,
112
+ previous: Optional[str] = None,
113
+ direction: Optional[Literal["asc", "desc"]] = None,
114
+ sort_by: Optional[Sequence[str]] = None,
115
+ data: Optional[Union[requests.RecommendationLastGet, Mapping[str, Any]]] = None,
116
+ fetch: bool = True,
117
+ _dry_run: bool = False,
118
+ _client: Any = None,
119
+ **kwargs: Any,
120
+ ) -> Union[List[type.Recommendation], responses.RecommendationLastGetPaginatedResponseCursor]:
121
+ """
122
+ Returns a dictionary with a data property containing an array of latest Recommendations. Only the latest Recommendation for each `resource` in the request filters will be returned.
123
+
124
+ **Permission Required:** `kelvin.permission.recommendation.read`.
125
+
126
+ ``getRecommendationLast``: ``POST`` ``/api/v4/recommendations/last/get``
127
+
128
+ Parameters
129
+ ----------
130
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
131
+ Method of pagination to use for return results where `total_items` is
132
+ greater than `page_size`. `cursor` and `limits` will return one `page`
133
+ of results, `stream` will return all results. ('limits', 'cursor',
134
+ 'stream')
135
+ page_size : :obj:`int`
136
+ Number of objects to be returned in each page. Page size can range
137
+ between 1 and 1000 objects.
138
+ page : :obj:`int`
139
+ An integer for the wanted page of results. Used only with
140
+ `pagination_type` set as `limits`.
141
+ next : :obj:`str`
142
+ An alphanumeric string bookmark to indicate where to start for the
143
+ next page. Used only with `pagination_type` set as `cursor`.
144
+ previous : :obj:`str`
145
+ An alphanumeric string bookmark to indicate where to end for the
146
+ previous page. Used only with `pagination_type` set as `cursor`.
147
+ direction : :obj:`Literal['asc', 'desc']`
148
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
149
+ sort_by : :obj:`Sequence[str]`
150
+ data: requests.RecommendationLastGet, optional
151
+ **kwargs:
152
+ Extra parameters for requests.RecommendationLastGet
153
+ - get_recommendation_last: dict
154
+
155
+ """
156
+
157
+ from ..model import responses
158
+
159
+ result = cls._make_request(
160
+ _client,
161
+ "post",
162
+ "/api/v4/recommendations/last/get",
163
+ {},
164
+ {
165
+ "pagination_type": pagination_type,
166
+ "page_size": page_size,
167
+ "page": page,
168
+ "next": next,
169
+ "previous": previous,
170
+ "direction": direction,
171
+ "sort_by": sort_by,
172
+ },
173
+ {},
174
+ {},
175
+ data,
176
+ "requests.RecommendationLastGet",
177
+ False,
178
+ {"200": responses.RecommendationLastGetPaginatedResponseCursor, "400": None},
179
+ False,
180
+ _dry_run,
181
+ kwargs,
182
+ )
183
+ return result.fetch("/api/v4/recommendations/last/get", "POST", data) if fetch and not _dry_run else result
184
+
185
+ @classmethod
186
+ def list_recommendations(
187
+ cls,
188
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
189
+ page_size: Optional[int] = 10000,
190
+ page: Optional[int] = None,
191
+ next: Optional[str] = None,
192
+ previous: Optional[str] = None,
193
+ direction: Optional[Literal["asc", "desc"]] = None,
194
+ sort_by: Optional[Sequence[str]] = None,
195
+ data: Optional[Union[requests.RecommendationsList, Mapping[str, Any]]] = None,
196
+ fetch: bool = True,
197
+ _dry_run: bool = False,
198
+ _client: Any = None,
199
+ **kwargs: Any,
200
+ ) -> Union[List[type.Recommendation], responses.RecommendationsListPaginatedResponseCursor]:
201
+ """
202
+ Returns a list of Recommendation objects. The list can be optionally filtered and sorted on the server before being returned.
203
+
204
+ **Permission Required:** `kelvin.permission.recommendation.read`.
205
+
206
+ ``listRecommendations``: ``POST`` ``/api/v4/recommendations/list``
207
+
208
+ Parameters
209
+ ----------
210
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
211
+ Method of pagination to use for return results where `total_items` is
212
+ greater than `page_size`. `cursor` and `limits` will return one `page`
213
+ of results, `stream` will return all results. ('limits', 'cursor',
214
+ 'stream')
215
+ page_size : :obj:`int`
216
+ Number of objects to be returned in each page. Page size can range
217
+ between 1 and 1000 objects.
218
+ page : :obj:`int`
219
+ An integer for the wanted page of results. Used only with
220
+ `pagination_type` set as `limits`.
221
+ next : :obj:`str`
222
+ An alphanumeric string bookmark to indicate where to start for the
223
+ next page. Used only with `pagination_type` set as `cursor`.
224
+ previous : :obj:`str`
225
+ An alphanumeric string bookmark to indicate where to end for the
226
+ previous page. Used only with `pagination_type` set as `cursor`.
227
+ direction : :obj:`Literal['asc', 'desc']`
228
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
229
+ sort_by : :obj:`Sequence[str]`
230
+ data: requests.RecommendationsList, optional
231
+ **kwargs:
232
+ Extra parameters for requests.RecommendationsList
233
+ - list_recommendations: dict
234
+
235
+ """
236
+
237
+ from ..model import responses
238
+
239
+ result = cls._make_request(
240
+ _client,
241
+ "post",
242
+ "/api/v4/recommendations/list",
243
+ {},
244
+ {
245
+ "pagination_type": pagination_type,
246
+ "page_size": page_size,
247
+ "page": page,
248
+ "next": next,
249
+ "previous": previous,
250
+ "direction": direction,
251
+ "sort_by": sort_by,
252
+ },
253
+ {},
254
+ {},
255
+ data,
256
+ "requests.RecommendationsList",
257
+ False,
258
+ {"200": responses.RecommendationsListPaginatedResponseCursor, "400": None},
259
+ False,
260
+ _dry_run,
261
+ kwargs,
262
+ )
263
+ return result.fetch("/api/v4/recommendations/list", "POST", data) if fetch and not _dry_run else result
264
+
265
+ @classmethod
266
+ def get_recommendation_range(
267
+ cls,
268
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
269
+ page_size: Optional[int] = 10000,
270
+ page: Optional[int] = None,
271
+ next: Optional[str] = None,
272
+ previous: Optional[str] = None,
273
+ direction: Optional[Literal["asc", "desc"]] = None,
274
+ sort_by: Optional[Sequence[str]] = None,
275
+ data: Optional[Union[requests.RecommendationRangeGet, Mapping[str, Any]]] = None,
276
+ fetch: bool = True,
277
+ _dry_run: bool = False,
278
+ _client: Any = None,
279
+ **kwargs: Any,
280
+ ) -> Union[List[type.Recommendation], responses.RecommendationRangeGetPaginatedResponseCursor]:
281
+ """
282
+ Returns a dictionary with a data property containing an array of Recommendations within a specified time range for all of the `resources` in the `resources` array that match the filter options.
283
+
284
+ **Permission Required:** `kelvin.permission.recommendation.read`.
285
+
286
+ ``getRecommendationRange``: ``POST`` ``/api/v4/recommendations/range/get``
287
+
288
+ Parameters
289
+ ----------
290
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
291
+ Method of pagination to use for return results where `total_items` is
292
+ greater than `page_size`. `cursor` and `limits` will return one `page`
293
+ of results, `stream` will return all results. ('limits', 'cursor',
294
+ 'stream')
295
+ page_size : :obj:`int`
296
+ Number of objects to be returned in each page. Page size can range
297
+ between 1 and 1000 objects.
298
+ page : :obj:`int`
299
+ An integer for the wanted page of results. Used only with
300
+ `pagination_type` set as `limits`.
301
+ next : :obj:`str`
302
+ An alphanumeric string bookmark to indicate where to start for the
303
+ next page. Used only with `pagination_type` set as `cursor`.
304
+ previous : :obj:`str`
305
+ An alphanumeric string bookmark to indicate where to end for the
306
+ previous page. Used only with `pagination_type` set as `cursor`.
307
+ direction : :obj:`Literal['asc', 'desc']`
308
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
309
+ sort_by : :obj:`Sequence[str]`
310
+ data: requests.RecommendationRangeGet, optional
311
+ **kwargs:
312
+ Extra parameters for requests.RecommendationRangeGet
313
+ - get_recommendation_range: dict
314
+
315
+ """
316
+
317
+ from ..model import responses
318
+
319
+ result = cls._make_request(
320
+ _client,
321
+ "post",
322
+ "/api/v4/recommendations/range/get",
323
+ {},
324
+ {
325
+ "pagination_type": pagination_type,
326
+ "page_size": page_size,
327
+ "page": page,
328
+ "next": next,
329
+ "previous": previous,
330
+ "direction": direction,
331
+ "sort_by": sort_by,
332
+ },
333
+ {},
334
+ {},
335
+ data,
336
+ "requests.RecommendationRangeGet",
337
+ False,
338
+ {"200": responses.RecommendationRangeGetPaginatedResponseCursor, "400": None},
339
+ False,
340
+ _dry_run,
341
+ kwargs,
342
+ )
343
+ return result.fetch("/api/v4/recommendations/range/get", "POST", data) if fetch and not _dry_run else result
344
+
345
+ @classmethod
346
+ def create_recommendation_type(
347
+ cls,
348
+ data: Optional[Union[requests.RecommendationTypeCreate, Mapping[str, Any]]] = None,
349
+ _dry_run: bool = False,
350
+ _client: Any = None,
351
+ **kwargs: Any,
352
+ ) -> responses.RecommendationTypeCreate:
353
+ """
354
+ Create a new Recommendation Type.
355
+
356
+ **Permission Required:** `kelvin.permission.recommendation.create`.
357
+
358
+ ``createRecommendationType``: ``POST`` ``/api/v4/recommendations/types/create``
359
+
360
+ Parameters
361
+ ----------
362
+ data: requests.RecommendationTypeCreate, optional
363
+ **kwargs:
364
+ Extra parameters for requests.RecommendationTypeCreate
365
+ - create_recommendation_type: dict
366
+
367
+ """
368
+
369
+ from ..model import responses
370
+
371
+ result = cls._make_request(
372
+ _client,
373
+ "post",
374
+ "/api/v4/recommendations/types/create",
375
+ {},
376
+ {},
377
+ {},
378
+ {},
379
+ data,
380
+ "requests.RecommendationTypeCreate",
381
+ False,
382
+ {"201": responses.RecommendationTypeCreate, "400": None, "409": None},
383
+ False,
384
+ _dry_run,
385
+ kwargs,
386
+ )
387
+ return result
388
+
389
+ @classmethod
390
+ def list_recommendation_types(
391
+ cls,
392
+ pagination_type: Optional[Literal["limits", "cursor", "stream"]] = None,
393
+ page_size: Optional[int] = 10000,
394
+ page: Optional[int] = None,
395
+ next: Optional[str] = None,
396
+ previous: Optional[str] = None,
397
+ direction: Optional[Literal["asc", "desc"]] = None,
398
+ sort_by: Optional[Sequence[str]] = None,
399
+ search: Optional[Sequence[str]] = None,
400
+ fetch: bool = True,
401
+ _dry_run: bool = False,
402
+ _client: Any = None,
403
+ ) -> Union[List[type.RecommendationType], responses.RecommendationTypesListPaginatedCursor]:
404
+ """
405
+ Returns a list of Recommendation Type objects. The list can be optionally filtered and sorted on the server before being returned.
406
+ **Permission Required:** `kelvin.permission.recommendation.read`.
407
+
408
+ ``listRecommendationTypes``: ``GET`` ``/api/v4/recommendations/types/list``
409
+
410
+ Parameters
411
+ ----------
412
+ pagination_type : :obj:`Literal['limits', 'cursor', 'stream']`
413
+ Method of pagination to use for return results where `total_items` is
414
+ greater than `page_size`. `cursor` and `limits` will return one `page`
415
+ of results, `stream` will return all results. ('limits', 'cursor',
416
+ 'stream')
417
+ page_size : :obj:`int`
418
+ Number of objects to be returned in each page. Page size can range
419
+ between 1 and 1000 objects.
420
+ page : :obj:`int`
421
+ An integer for the wanted page of results. Used only with
422
+ `pagination_type` set as `limits`.
423
+ next : :obj:`str`
424
+ An alphanumeric string bookmark to indicate where to start for the
425
+ next page. Used only with `pagination_type` set as `cursor`.
426
+ previous : :obj:`str`
427
+ An alphanumeric string bookmark to indicate where to end for the
428
+ previous page. Used only with `pagination_type` set as `cursor`.
429
+ direction : :obj:`Literal['asc', 'desc']`
430
+ Sorting order according to the `sort_by` parameter. ('asc', 'desc')
431
+ sort_by : :obj:`Sequence[str]`
432
+ search : :obj:`Sequence[str]`
433
+ Search and filter on the list based on the keys `title` (Display Name)
434
+ or `name`. The search is case insensitive and will find partial
435
+ matches as well.
436
+
437
+ """
438
+
439
+ from ..model import responses
440
+
441
+ result = cls._make_request(
442
+ _client,
443
+ "get",
444
+ "/api/v4/recommendations/types/list",
445
+ {},
446
+ {
447
+ "pagination_type": pagination_type,
448
+ "page_size": page_size,
449
+ "page": page,
450
+ "next": next,
451
+ "previous": previous,
452
+ "direction": direction,
453
+ "sort_by": sort_by,
454
+ "search": search,
455
+ },
456
+ {},
457
+ {},
458
+ None,
459
+ None,
460
+ False,
461
+ {"200": responses.RecommendationTypesListPaginatedCursor, "400": None, "401": None},
462
+ False,
463
+ _dry_run,
464
+ )
465
+ return result.fetch("/api/v4/recommendations/types/list", "GET") if fetch and not _dry_run else result
466
+
467
+ @classmethod
468
+ def delete_recommendation_type(cls, name: str, _dry_run: bool = False, _client: Any = None) -> None:
469
+ """
470
+ Permanently delete an existing Recommendation Type. An error will be returned if there are any current Recommendations linked to the Recommendation Type. This cannot be undone once the API request has been submitted.
471
+
472
+ **Permission Required:** `kelvin.permission.recommendation.delete`.
473
+
474
+ ``deleteRecommendationType``: ``POST`` ``/api/v4/recommendations/types/{name}/delete``
475
+
476
+ Parameters
477
+ ----------
478
+ name : :obj:`str`, optional
479
+ Recommendation Type key `name` to delete. The string can only contain
480
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
481
+
482
+ """
483
+
484
+ result = cls._make_request(
485
+ _client,
486
+ "post",
487
+ "/api/v4/recommendations/types/{name}/delete",
488
+ {"name": name},
489
+ {},
490
+ {},
491
+ {},
492
+ None,
493
+ None,
494
+ False,
495
+ {"200": None, "400": None, "404": None, "409": None},
496
+ False,
497
+ _dry_run,
498
+ )
499
+ return result
500
+
501
+ @classmethod
502
+ def get_recommendation_type(
503
+ cls, name: str, _dry_run: bool = False, _client: Any = None
504
+ ) -> responses.RecommendationTypeGet:
505
+ """
506
+ Retrieves the parameters of a Recommendation Type.
507
+
508
+ **Permission Required:** `kelvin.permission.recommendation.read`.
509
+
510
+ ``getRecommendationType``: ``GET`` ``/api/v4/recommendations/types/{name}/get``
511
+
512
+ Parameters
513
+ ----------
514
+ name : :obj:`str`, optional
515
+ Recommendation Type key `name` to get. The string can only contain
516
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
517
+
518
+ """
519
+
520
+ from ..model import responses
521
+
522
+ result = cls._make_request(
523
+ _client,
524
+ "get",
525
+ "/api/v4/recommendations/types/{name}/get",
526
+ {"name": name},
527
+ {},
528
+ {},
529
+ {},
530
+ None,
531
+ None,
532
+ False,
533
+ {"200": responses.RecommendationTypeGet, "400": None, "404": None},
534
+ False,
535
+ _dry_run,
536
+ )
537
+ return result
538
+
539
+ @classmethod
540
+ def update_recommendation_type(
541
+ cls,
542
+ name: str,
543
+ data: Optional[Union[requests.RecommendationTypeUpdate, Mapping[str, Any]]] = None,
544
+ _dry_run: bool = False,
545
+ _client: Any = None,
546
+ **kwargs: Any,
547
+ ) -> responses.RecommendationTypeUpdate:
548
+ """
549
+ Updates an existing Recommendation 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.
550
+
551
+ **Permission Required:** `kelvin.permission.recommendation.update`.
552
+
553
+ ``updateRecommendationType``: ``POST`` ``/api/v4/recommendations/types/{name}/update``
554
+
555
+ Parameters
556
+ ----------
557
+ name : :obj:`str`, optional
558
+ Recommendation Type key `name` to update. The string can only contain
559
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
560
+ data: requests.RecommendationTypeUpdate, optional
561
+ **kwargs:
562
+ Extra parameters for requests.RecommendationTypeUpdate
563
+ - update_recommendation_type: dict
564
+
565
+ """
566
+
567
+ from ..model import responses
568
+
569
+ result = cls._make_request(
570
+ _client,
571
+ "post",
572
+ "/api/v4/recommendations/types/{name}/update",
573
+ {"name": name},
574
+ {},
575
+ {},
576
+ {},
577
+ data,
578
+ "requests.RecommendationTypeUpdate",
579
+ False,
580
+ {"200": responses.RecommendationTypeUpdate, "400": None, "404": None},
581
+ False,
582
+ _dry_run,
583
+ kwargs,
584
+ )
585
+ return result
586
+
587
+ @classmethod
588
+ def update_recommendation_accept(
589
+ cls,
590
+ recommendation_id: str,
591
+ data: Optional[Union[requests.RecommendationAcceptUpdate, Mapping[str, Any]]] = None,
592
+ _dry_run: bool = False,
593
+ _client: Any = None,
594
+ **kwargs: Any,
595
+ ) -> responses.RecommendationAcceptUpdate:
596
+ """
597
+ Update a Recommendation `state` to `accepted`. This will trigger all objects in the `actions` parameter to be initiated. You will need to continue to monitor each action individually (for example a Control Change) to ensure it is completed successfully.
598
+
599
+ **Permission Required:** `kelvin.permission.recommendation.update`.
600
+
601
+ ``updateRecommendationAccept``: ``POST`` ``/api/v4/recommendations/{recommendation_id}/accept/update``
602
+
603
+ Parameters
604
+ ----------
605
+ recommendation_id : :obj:`str`, optional
606
+ Recommendation key `id` to accept. The string can only contain
607
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
608
+ data: requests.RecommendationAcceptUpdate, optional
609
+ **kwargs:
610
+ Extra parameters for requests.RecommendationAcceptUpdate
611
+ - update_recommendation_accept: dict
612
+
613
+ """
614
+
615
+ from ..model import responses
616
+
617
+ result = cls._make_request(
618
+ _client,
619
+ "post",
620
+ "/api/v4/recommendations/{recommendation_id}/accept/update",
621
+ {"recommendation_id": recommendation_id},
622
+ {},
623
+ {},
624
+ {},
625
+ data,
626
+ "requests.RecommendationAcceptUpdate",
627
+ False,
628
+ {"200": responses.RecommendationAcceptUpdate, "400": None, "404": None},
629
+ False,
630
+ _dry_run,
631
+ kwargs,
632
+ )
633
+ return result
634
+
635
+ @classmethod
636
+ def delete_recommendation(
637
+ cls, recommendation_id: str, _dry_run: bool = False, _client: Any = None
638
+ ) -> responses.RecommendationDelete:
639
+ """
640
+ Permanently delete an existing Recommendation. Recommendations with `states` tagged as `accepted`, `auto_accepted` or `error` can not be deleted. This action cannot be undone once the API request has been submitted.
641
+ **Permission Required:** `kelvin.permission.recommendation.delete`.
642
+
643
+ ``deleteRecommendation``: ``POST`` ``/api/v4/recommendations/{recommendation_id}/delete``
644
+
645
+ Parameters
646
+ ----------
647
+ recommendation_id : :obj:`str`, optional
648
+ Recommendation key `id` to delete. The string can only contain
649
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
650
+
651
+ """
652
+
653
+ from ..model import responses
654
+
655
+ result = cls._make_request(
656
+ _client,
657
+ "post",
658
+ "/api/v4/recommendations/{recommendation_id}/delete",
659
+ {"recommendation_id": recommendation_id},
660
+ {},
661
+ {},
662
+ {},
663
+ None,
664
+ None,
665
+ False,
666
+ {"200": responses.RecommendationDelete, "400": None, "404": None},
667
+ False,
668
+ _dry_run,
669
+ )
670
+ return result
671
+
672
+ @classmethod
673
+ def get_recommendation(
674
+ cls, recommendation_id: str, _dry_run: bool = False, _client: Any = None
675
+ ) -> responses.RecommendationGet:
676
+ """
677
+ Retrieves the properties, status and all associated actions of a Recommendation.
678
+
679
+ **Permission Required:** `kelvin.permission.recommendation.read`.
680
+
681
+ ``getRecommendation``: ``GET`` ``/api/v4/recommendations/{recommendation_id}/get``
682
+
683
+ Parameters
684
+ ----------
685
+ recommendation_id : :obj:`str`, optional
686
+ Recommendation key `id` of the Recommendation to get. The string can
687
+ only contain lowercase alphanumeric characters and `.`, `_` or `-`
688
+ characters.
689
+
690
+ """
691
+
692
+ from ..model import responses
693
+
694
+ result = cls._make_request(
695
+ _client,
696
+ "get",
697
+ "/api/v4/recommendations/{recommendation_id}/get",
698
+ {"recommendation_id": recommendation_id},
699
+ {},
700
+ {},
701
+ {},
702
+ None,
703
+ None,
704
+ False,
705
+ {"200": responses.RecommendationGet, "404": None},
706
+ False,
707
+ _dry_run,
708
+ )
709
+ return result
710
+
711
+ @classmethod
712
+ def create_recommendation_log(
713
+ cls,
714
+ recommendation_id: str,
715
+ data: Optional[Union[requests.RecommendationLogCreate, Mapping[str, Any]]] = None,
716
+ _dry_run: bool = False,
717
+ _client: Any = None,
718
+ **kwargs: Any,
719
+ ) -> None:
720
+ """
721
+ Create a new log entry for a Recommendation. An unlimited number of logs can be attached. This has no effect on the `state` of the Recommendation.
722
+
723
+ **Permission Required:** `kelvin.permission.recommendation.update`.
724
+
725
+ ``createRecommendationLog``: ``POST`` ``/api/v4/recommendations/{recommendation_id}/log/create``
726
+
727
+ Parameters
728
+ ----------
729
+ recommendation_id : :obj:`str`, optional
730
+ Recommendation key `id` to attach new log to. The string can only
731
+ contain lowercase alphanumeric characters and `.`, `_` or `-`
732
+ characters.
733
+ data: requests.RecommendationLogCreate, optional
734
+ **kwargs:
735
+ Extra parameters for requests.RecommendationLogCreate
736
+ - create_recommendation_log: dict
737
+
738
+ """
739
+
740
+ result = cls._make_request(
741
+ _client,
742
+ "post",
743
+ "/api/v4/recommendations/{recommendation_id}/log/create",
744
+ {"recommendation_id": recommendation_id},
745
+ {},
746
+ {},
747
+ {},
748
+ data,
749
+ "requests.RecommendationLogCreate",
750
+ False,
751
+ {"201": None, "404": None},
752
+ False,
753
+ _dry_run,
754
+ kwargs,
755
+ )
756
+ return result
757
+
758
+ @classmethod
759
+ def update_recommendation_reject(
760
+ cls,
761
+ recommendation_id: str,
762
+ data: Optional[Union[requests.RecommendationRejectUpdate, Mapping[str, Any]]] = None,
763
+ _dry_run: bool = False,
764
+ _client: Any = None,
765
+ **kwargs: Any,
766
+ ) -> responses.RecommendationRejectUpdate:
767
+ """
768
+ Update a Recommendation `state` to `rejected`. All `actions` will only be archived and not implemented.
769
+
770
+ **Permission Required:** `kelvin.permission.recommendation.update`.
771
+
772
+ ``updateRecommendationReject``: ``POST`` ``/api/v4/recommendations/{recommendation_id}/reject/update``
773
+
774
+ Parameters
775
+ ----------
776
+ recommendation_id : :obj:`str`, optional
777
+ Recommendation key `id` to reject. The string can only contain
778
+ lowercase alphanumeric characters and `.`, `_` or `-` characters.
779
+ data: requests.RecommendationRejectUpdate, optional
780
+ **kwargs:
781
+ Extra parameters for requests.RecommendationRejectUpdate
782
+ - update_recommendation_reject: dict
783
+
784
+ """
785
+
786
+ from ..model import responses
787
+
788
+ result = cls._make_request(
789
+ _client,
790
+ "post",
791
+ "/api/v4/recommendations/{recommendation_id}/reject/update",
792
+ {"recommendation_id": recommendation_id},
793
+ {},
794
+ {},
795
+ {},
796
+ data,
797
+ "requests.RecommendationRejectUpdate",
798
+ False,
799
+ {"200": responses.RecommendationRejectUpdate, "400": None, "404": None},
800
+ False,
801
+ _dry_run,
802
+ kwargs,
803
+ )
804
+ return result