platform-api-python-client 4.28.0__py3-none-any.whl → 4.37.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 (79) hide show
  1. platform_api_python_client/__init__.py +43 -10
  2. platform_api_python_client/api/external_api.py +6332 -1348
  3. platform_api_python_client/api_client.py +1 -1
  4. platform_api_python_client/configuration.py +1 -1
  5. platform_api_python_client/models/__init__.py +42 -9
  6. platform_api_python_client/models/ccl_dynamo_pools.py +116 -0
  7. platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +12 -13
  8. platform_api_python_client/models/cloud_provider.py +5 -0
  9. platform_api_python_client/models/cluster_credential.py +2 -2
  10. platform_api_python_client/models/create_compute_deployment_request.py +40 -7
  11. platform_api_python_client/models/create_dynamo_deployment_request.py +97 -6
  12. platform_api_python_client/models/create_inference_v3_deployment_request.py +59 -2
  13. platform_api_python_client/models/create_job_deployment_request.py +43 -10
  14. platform_api_python_client/models/create_object_volume_request.py +19 -19
  15. platform_api_python_client/models/deployment_response.py +23 -23
  16. platform_api_python_client/models/deployment_type.py +14 -0
  17. platform_api_python_client/models/{c_serve_recipe_perf.py → dynamo_communications_input.py} +12 -19
  18. platform_api_python_client/models/dynamo_communications_output.py +91 -0
  19. platform_api_python_client/models/dynamo_image.py +105 -0
  20. platform_api_python_client/models/dynamo_kv_transfer_configuration.py +88 -0
  21. platform_api_python_client/models/dynamo_kv_transfer_policy.py +37 -0
  22. platform_api_python_client/models/dynamo_weight_transfer_configuration.py +88 -0
  23. platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
  24. platform_api_python_client/models/dynamo_worker_pool_config.py +37 -17
  25. platform_api_python_client/models/dynamo_worker_pools.py +23 -16
  26. platform_api_python_client/models/env.py +89 -0
  27. platform_api_python_client/models/get_cluster_response.py +4 -2
  28. platform_api_python_client/models/get_compute_deployment_response.py +45 -4
  29. platform_api_python_client/models/get_deployment_response.py +26 -2
  30. platform_api_python_client/models/get_deployment_usage_response.py +19 -4
  31. platform_api_python_client/models/get_dynamo_deployment_response.py +89 -5
  32. platform_api_python_client/models/get_inference_deployment_response.py +25 -1
  33. platform_api_python_client/models/get_inference_v3_deployment_response.py +67 -2
  34. platform_api_python_client/models/get_job_deployment_response.py +52 -11
  35. platform_api_python_client/models/get_object_volume_response.py +2 -16
  36. platform_api_python_client/models/hardware_instance_response.py +6 -4
  37. platform_api_python_client/models/image.py +112 -0
  38. platform_api_python_client/models/ingress.py +103 -0
  39. platform_api_python_client/models/insight_list_item_response.py +108 -0
  40. platform_api_python_client/models/insight_resource.py +97 -0
  41. platform_api_python_client/models/insight_resource_type.py +37 -0
  42. platform_api_python_client/models/insight_response.py +133 -0
  43. platform_api_python_client/models/insight_severity.py +40 -0
  44. platform_api_python_client/models/insight_status.py +39 -0
  45. platform_api_python_client/models/{c_serve_recipe_response.py → insight_status_change_response.py} +28 -24
  46. platform_api_python_client/models/list_insights_response.py +95 -0
  47. platform_api_python_client/models/metric.py +13 -0
  48. platform_api_python_client/models/pool.py +116 -0
  49. platform_api_python_client/models/unified_get_compute_deployment_response.py +177 -0
  50. platform_api_python_client/models/unified_get_deployment_logs_response.py +95 -0
  51. platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → unified_get_deployment_pods_response.py} +8 -13
  52. platform_api_python_client/models/unified_get_deployment_response.py +164 -0
  53. platform_api_python_client/models/unified_get_deployment_revision_response.py +109 -0
  54. platform_api_python_client/models/unified_get_deployment_rollout_response.py +90 -0
  55. platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
  56. platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
  57. platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
  58. platform_api_python_client/models/unified_get_job_deployment_response.py +204 -0
  59. platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +7 -7
  60. platform_api_python_client/models/unified_update_deployment_rollout_request.py +87 -0
  61. platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
  62. platform_api_python_client/models/unified_write_deployment_request.py +164 -0
  63. platform_api_python_client/models/{c_serve_v2_recipe.py → unified_write_deployment_response.py} +27 -27
  64. platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
  65. platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +207 -0
  66. platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
  67. platform_api_python_client/models/update_insight_status_request.py +106 -0
  68. platform_api_python_client/models/upsert_user_vault_item_request.py +1 -1
  69. platform_api_python_client/models/usage_availability.py +40 -0
  70. platform_api_python_client/models/usage_component.py +39 -0
  71. platform_api_python_client/models/validation_error.py +12 -3
  72. platform_api_python_client/models/volume_mount.py +1 -1
  73. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/METADATA +1 -1
  74. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/RECORD +76 -43
  75. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/WHEEL +1 -1
  76. platform_api_python_client/models/create_c_serve_v3_deployment_request.py +0 -182
  77. platform_api_python_client/models/get_c_serve_v2_deployment_response.py +0 -169
  78. platform_api_python_client/models/get_c_serve_v3_deployment_response.py +0 -170
  79. {platform_api_python_client-4.28.0.dist-info → platform_api_python_client-4.37.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,112 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class Image(BaseModel):
27
+ """
28
+ Image
29
+ """ # noqa: E501
30
+ url: StrictStr
31
+ pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
32
+ pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
33
+ __properties: ClassVar[List[str]] = ["url", "pull_ref", "pull_secret_name"]
34
+
35
+ @field_validator('pull_secret_name')
36
+ def pull_secret_name_validate_regular_expression(cls, value):
37
+ """Validates the regular expression"""
38
+ if value is None:
39
+ return value
40
+
41
+ if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
42
+ raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of Image from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # set to None if pull_ref (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.pull_ref is None and "pull_ref" in self.model_fields_set:
87
+ _dict['pull_ref'] = None
88
+
89
+ # set to None if pull_secret_name (nullable) is None
90
+ # and model_fields_set contains the field
91
+ if self.pull_secret_name is None and "pull_secret_name" in self.model_fields_set:
92
+ _dict['pull_secret_name'] = None
93
+
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of Image from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "url": obj.get("url"),
107
+ "pull_ref": obj.get("pull_ref"),
108
+ "pull_secret_name": obj.get("pull_secret_name")
109
+ })
110
+ return _obj
111
+
112
+
@@ -0,0 +1,103 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from platform_api_python_client.models.backend_protocol import BackendProtocol
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class Ingress(BaseModel):
28
+ """
29
+ Ingress
30
+ """ # noqa: E501
31
+ backend_protocol: Optional[BackendProtocol] = None
32
+ bearer_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
33
+ certificate_authority: Optional[StrictStr] = None
34
+ __properties: ClassVar[List[str]] = ["backend_protocol", "bearer_token_ref", "certificate_authority"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Ingress from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # set to None if bearer_token_ref (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.bearer_token_ref is None and "bearer_token_ref" in self.model_fields_set:
78
+ _dict['bearer_token_ref'] = None
79
+
80
+ # set to None if certificate_authority (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.certificate_authority is None and "certificate_authority" in self.model_fields_set:
83
+ _dict['certificate_authority'] = None
84
+
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of Ingress from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "backend_protocol": obj.get("backend_protocol"),
98
+ "bearer_token_ref": obj.get("bearer_token_ref"),
99
+ "certificate_authority": obj.get("certificate_authority")
100
+ })
101
+ return _obj
102
+
103
+
@@ -0,0 +1,108 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from platform_api_python_client.models.insight_resource import InsightResource
24
+ from platform_api_python_client.models.insight_severity import InsightSeverity
25
+ from platform_api_python_client.models.insight_status import InsightStatus
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class InsightListItemResponse(BaseModel):
30
+ """
31
+ InsightListItemResponse
32
+ """ # noqa: E501
33
+ id: StrictInt
34
+ identity: StrictStr = Field(description="Human-readable identifier, e.g. INSIGHT-42")
35
+ severity: InsightSeverity
36
+ status: InsightStatus
37
+ title: StrictStr
38
+ observed_at: datetime
39
+ created_at: datetime
40
+ resource: InsightResource
41
+ __properties: ClassVar[List[str]] = ["id", "identity", "severity", "status", "title", "observed_at", "created_at", "resource"]
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of InsightListItemResponse from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ # override the default output from pydantic by calling `to_dict()` of resource
83
+ if self.resource:
84
+ _dict['resource'] = self.resource.to_dict()
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of InsightListItemResponse from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "id": obj.get("id"),
98
+ "identity": obj.get("identity"),
99
+ "severity": obj.get("severity"),
100
+ "status": obj.get("status"),
101
+ "title": obj.get("title"),
102
+ "observed_at": obj.get("observed_at"),
103
+ "created_at": obj.get("created_at"),
104
+ "resource": InsightResource.from_dict(obj["resource"]) if obj.get("resource") is not None else None
105
+ })
106
+ return _obj
107
+
108
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from platform_api_python_client.models.insight_resource_type import InsightResourceType
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class InsightResource(BaseModel):
27
+ """
28
+ InsightResource
29
+ """ # noqa: E501
30
+ type: InsightResourceType
31
+ id: StrictInt
32
+ name: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["type", "id", "name"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of InsightResource from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # set to None if name (nullable) is None
75
+ # and model_fields_set contains the field
76
+ if self.name is None and "name" in self.model_fields_set:
77
+ _dict['name'] = None
78
+
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of InsightResource from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "type": obj.get("type"),
92
+ "id": obj.get("id"),
93
+ "name": obj.get("name")
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class InsightResourceType(str, Enum):
22
+ """
23
+ InsightResourceType
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ CLUSTER = 'cluster'
30
+ DEPLOYMENT = 'deployment'
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of InsightResourceType from a JSON string"""
35
+ return cls(json.loads(json_str))
36
+
37
+
@@ -0,0 +1,133 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from platform_api_python_client.models.insight_resource import InsightResource
24
+ from platform_api_python_client.models.insight_severity import InsightSeverity
25
+ from platform_api_python_client.models.insight_status import InsightStatus
26
+ from platform_api_python_client.models.insight_status_change_response import InsightStatusChangeResponse
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class InsightResponse(BaseModel):
31
+ """
32
+ InsightResponse
33
+ """ # noqa: E501
34
+ id: StrictInt
35
+ identity: StrictStr = Field(description="Human-readable identifier, e.g. INSIGHT-42")
36
+ severity: InsightSeverity
37
+ status: InsightStatus
38
+ title: StrictStr
39
+ observed_at: datetime
40
+ created_at: datetime
41
+ resource: InsightResource
42
+ observed_summary: StrictStr
43
+ recommended_steps: StrictStr
44
+ content: Optional[StrictStr] = None
45
+ reported_by: StrictStr = Field(description="Name of the user that reported it; a service account shows its creator")
46
+ updated_at: datetime
47
+ history: List[InsightStatusChangeResponse] = Field(description="Status changes, newest first")
48
+ __properties: ClassVar[List[str]] = ["id", "identity", "severity", "status", "title", "observed_at", "created_at", "resource", "observed_summary", "recommended_steps", "content", "reported_by", "updated_at", "history"]
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+
57
+ def to_str(self) -> str:
58
+ """Returns the string representation of the model using alias"""
59
+ return pprint.pformat(self.model_dump(by_alias=True))
60
+
61
+ def to_json(self) -> str:
62
+ """Returns the JSON representation of the model using alias"""
63
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
64
+ return json.dumps(self.to_dict())
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> Optional[Self]:
68
+ """Create an instance of InsightResponse from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self) -> Dict[str, Any]:
72
+ """Return the dictionary representation of the model using alias.
73
+
74
+ This has the following differences from calling pydantic's
75
+ `self.model_dump(by_alias=True)`:
76
+
77
+ * `None` is only added to the output dict for nullable fields that
78
+ were set at model initialization. Other fields with value `None`
79
+ are ignored.
80
+ """
81
+ excluded_fields: Set[str] = set([
82
+ ])
83
+
84
+ _dict = self.model_dump(
85
+ by_alias=True,
86
+ exclude=excluded_fields,
87
+ exclude_none=True,
88
+ )
89
+ # override the default output from pydantic by calling `to_dict()` of resource
90
+ if self.resource:
91
+ _dict['resource'] = self.resource.to_dict()
92
+ # override the default output from pydantic by calling `to_dict()` of each item in history (list)
93
+ _items = []
94
+ if self.history:
95
+ for _item_history in self.history:
96
+ if _item_history:
97
+ _items.append(_item_history.to_dict())
98
+ _dict['history'] = _items
99
+ # set to None if content (nullable) is None
100
+ # and model_fields_set contains the field
101
+ if self.content is None and "content" in self.model_fields_set:
102
+ _dict['content'] = None
103
+
104
+ return _dict
105
+
106
+ @classmethod
107
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
+ """Create an instance of InsightResponse from a dict"""
109
+ if obj is None:
110
+ return None
111
+
112
+ if not isinstance(obj, dict):
113
+ return cls.model_validate(obj)
114
+
115
+ _obj = cls.model_validate({
116
+ "id": obj.get("id"),
117
+ "identity": obj.get("identity"),
118
+ "severity": obj.get("severity"),
119
+ "status": obj.get("status"),
120
+ "title": obj.get("title"),
121
+ "observed_at": obj.get("observed_at"),
122
+ "created_at": obj.get("created_at"),
123
+ "resource": InsightResource.from_dict(obj["resource"]) if obj.get("resource") is not None else None,
124
+ "observed_summary": obj.get("observed_summary"),
125
+ "recommended_steps": obj.get("recommended_steps"),
126
+ "content": obj.get("content"),
127
+ "reported_by": obj.get("reported_by"),
128
+ "updated_at": obj.get("updated_at"),
129
+ "history": [InsightStatusChangeResponse.from_dict(_item) for _item in obj["history"]] if obj.get("history") is not None else None
130
+ })
131
+ return _obj
132
+
133
+
@@ -0,0 +1,40 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class InsightSeverity(str, Enum):
22
+ """
23
+ InsightSeverity
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ CRITICAL = 'critical'
30
+ HIGH = 'high'
31
+ MEDIUM = 'medium'
32
+ LOW = 'low'
33
+ INFO = 'info'
34
+
35
+ @classmethod
36
+ def from_json(cls, json_str: str) -> Self:
37
+ """Create an instance of InsightSeverity from a JSON string"""
38
+ return cls(json.loads(json_str))
39
+
40
+
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class InsightStatus(str, Enum):
22
+ """
23
+ InsightStatus
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ NEW = 'new'
30
+ ACKNOWLEDGED = 'acknowledged'
31
+ RESOLVED = 'resolved'
32
+ NOT_RELEVANT = 'not_relevant'
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of InsightStatus from a JSON string"""
37
+ return cls(json.loads(json_str))
38
+
39
+