platform-api-python-client 0.1.0__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 (59) hide show
  1. platform_api_python_client/__init__.py +78 -0
  2. platform_api_python_client/api/__init__.py +5 -0
  3. platform_api_python_client/api/external_api.py +7341 -0
  4. platform_api_python_client/api_client.py +797 -0
  5. platform_api_python_client/api_response.py +21 -0
  6. platform_api_python_client/configuration.py +458 -0
  7. platform_api_python_client/exceptions.py +199 -0
  8. platform_api_python_client/models/__init__.py +61 -0
  9. platform_api_python_client/models/add_hardware_request.py +87 -0
  10. platform_api_python_client/models/api_key_request.py +87 -0
  11. platform_api_python_client/models/api_key_response.py +92 -0
  12. platform_api_python_client/models/c_serve_recipe_input.py +166 -0
  13. platform_api_python_client/models/c_serve_recipe_output.py +166 -0
  14. platform_api_python_client/models/c_serve_recipe_perf.py +98 -0
  15. platform_api_python_client/models/c_serve_recipe_response.py +105 -0
  16. platform_api_python_client/models/client_secret_response.py +87 -0
  17. platform_api_python_client/models/create_c_serve_deployment_request.py +117 -0
  18. platform_api_python_client/models/create_c_serve_deployment_response.py +92 -0
  19. platform_api_python_client/models/create_compute_deployment_response.py +94 -0
  20. platform_api_python_client/models/create_compute_deployment_v2_request.py +107 -0
  21. platform_api_python_client/models/create_inference_deployment_response.py +92 -0
  22. platform_api_python_client/models/create_inference_deployment_v2_request.py +141 -0
  23. platform_api_python_client/models/create_payment_request.py +89 -0
  24. platform_api_python_client/models/credits_response.py +87 -0
  25. platform_api_python_client/models/daily_bill_response.py +90 -0
  26. platform_api_python_client/models/deployment_status.py +38 -0
  27. platform_api_python_client/models/deployment_status_request.py +88 -0
  28. platform_api_python_client/models/deployment_status_response_v2.py +115 -0
  29. platform_api_python_client/models/deployment_type.py +43 -0
  30. platform_api_python_client/models/deployment_usage_value.py +89 -0
  31. platform_api_python_client/models/feedback_request.py +91 -0
  32. platform_api_python_client/models/get_c_serve_deployment_response.py +210 -0
  33. platform_api_python_client/models/get_cluster_response.py +89 -0
  34. platform_api_python_client/models/get_compute_v2_deployment_response.py +134 -0
  35. platform_api_python_client/models/get_deployment_log_response.py +94 -0
  36. platform_api_python_client/models/get_deployment_usage_response.py +95 -0
  37. platform_api_python_client/models/get_deployment_v2_response.py +111 -0
  38. platform_api_python_client/models/get_inference_v2_deployment_response.py +145 -0
  39. platform_api_python_client/models/hardware_instance_response.py +99 -0
  40. platform_api_python_client/models/health_status.py +40 -0
  41. platform_api_python_client/models/http_validation_error.py +95 -0
  42. platform_api_python_client/models/list_api_key_response.py +95 -0
  43. platform_api_python_client/models/list_c_serve_recipe_response.py +95 -0
  44. platform_api_python_client/models/list_daily_bill_response.py +95 -0
  45. platform_api_python_client/models/list_get_cluster_response.py +95 -0
  46. platform_api_python_client/models/list_get_deployment_v2_response.py +95 -0
  47. platform_api_python_client/models/list_hardware_instance_response.py +95 -0
  48. platform_api_python_client/models/list_payment_method_response.py +87 -0
  49. platform_api_python_client/models/list_prebuilt_image_response.py +95 -0
  50. platform_api_python_client/models/metric.py +38 -0
  51. platform_api_python_client/models/prebuilt_image_response.py +94 -0
  52. platform_api_python_client/models/validation_error.py +99 -0
  53. platform_api_python_client/models/validation_error_loc_inner.py +138 -0
  54. platform_api_python_client/py.typed +0 -0
  55. platform_api_python_client/rest.py +257 -0
  56. platform_api_python_client-0.1.0.dist-info/METADATA +16 -0
  57. platform_api_python_client-0.1.0.dist-info/RECORD +59 -0
  58. platform_api_python_client-0.1.0.dist-info/WHEEL +5 -0
  59. platform_api_python_client-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,89 @@
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
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetClusterResponse(BaseModel):
26
+ """
27
+ GetClusterResponse
28
+ """ # noqa: E501
29
+ id: StrictInt
30
+ display_name: StrictStr
31
+ __properties: ClassVar[List[str]] = ["id", "display_name"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of GetClusterResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of GetClusterResponse from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "id": obj.get("id"),
85
+ "display_name": obj.get("display_name")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,134 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from platform_api_python_client.models.deployment_status import DeploymentStatus
24
+ from platform_api_python_client.models.deployment_type import DeploymentType
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class GetComputeV2DeploymentResponse(BaseModel):
29
+ """
30
+ GetComputeV2DeploymentResponse
31
+ """ # noqa: E501
32
+ cluster_id: StrictInt
33
+ id: StrictInt
34
+ name: StrictStr
35
+ endpoint_url: StrictStr
36
+ image_url: Optional[StrictStr]
37
+ type: DeploymentType
38
+ status: DeploymentStatus
39
+ created_at: datetime
40
+ hardware_instance_id: StrictInt
41
+ exposed_port: StrictInt
42
+ ssh_public_key: Optional[StrictStr]
43
+ ssh_password: Optional[StrictStr]
44
+ env_vars: Optional[Dict[str, StrictStr]]
45
+ __properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "exposed_port", "ssh_public_key", "ssh_password", "env_vars"]
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of GetComputeV2DeploymentResponse from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ ])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # set to None if image_url (nullable) is None
87
+ # and model_fields_set contains the field
88
+ if self.image_url is None and "image_url" in self.model_fields_set:
89
+ _dict['image_url'] = None
90
+
91
+ # set to None if ssh_public_key (nullable) is None
92
+ # and model_fields_set contains the field
93
+ if self.ssh_public_key is None and "ssh_public_key" in self.model_fields_set:
94
+ _dict['ssh_public_key'] = None
95
+
96
+ # set to None if ssh_password (nullable) is None
97
+ # and model_fields_set contains the field
98
+ if self.ssh_password is None and "ssh_password" in self.model_fields_set:
99
+ _dict['ssh_password'] = None
100
+
101
+ # set to None if env_vars (nullable) is None
102
+ # and model_fields_set contains the field
103
+ if self.env_vars is None and "env_vars" in self.model_fields_set:
104
+ _dict['env_vars'] = None
105
+
106
+ return _dict
107
+
108
+ @classmethod
109
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110
+ """Create an instance of GetComputeV2DeploymentResponse from a dict"""
111
+ if obj is None:
112
+ return None
113
+
114
+ if not isinstance(obj, dict):
115
+ return cls.model_validate(obj)
116
+
117
+ _obj = cls.model_validate({
118
+ "cluster_id": obj.get("cluster_id"),
119
+ "id": obj.get("id"),
120
+ "name": obj.get("name"),
121
+ "endpoint_url": obj.get("endpoint_url"),
122
+ "image_url": obj.get("image_url"),
123
+ "type": obj.get("type"),
124
+ "status": obj.get("status"),
125
+ "created_at": obj.get("created_at"),
126
+ "hardware_instance_id": obj.get("hardware_instance_id"),
127
+ "exposed_port": obj.get("exposed_port"),
128
+ "ssh_public_key": obj.get("ssh_public_key"),
129
+ "ssh_password": obj.get("ssh_password"),
130
+ "env_vars": obj.get("env_vars")
131
+ })
132
+ return _obj
133
+
134
+
@@ -0,0 +1,94 @@
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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetDeploymentLogResponse(BaseModel):
26
+ """
27
+ GetDeploymentLogResponse
28
+ """ # noqa: E501
29
+ events: List[Dict[str, Any]]
30
+ next_page_token: Optional[StrictStr]
31
+ __properties: ClassVar[List[str]] = ["events", "next_page_token"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of GetDeploymentLogResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # set to None if next_page_token (nullable) is None
73
+ # and model_fields_set contains the field
74
+ if self.next_page_token is None and "next_page_token" in self.model_fields_set:
75
+ _dict['next_page_token'] = None
76
+
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of GetDeploymentLogResponse from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "events": obj.get("events"),
90
+ "next_page_token": obj.get("next_page_token")
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,95 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetDeploymentUsageResponse(BaseModel):
27
+ """
28
+ GetDeploymentUsageResponse
29
+ """ # noqa: E501
30
+ values: List[DeploymentUsageValue]
31
+ __properties: ClassVar[List[str]] = ["values"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of GetDeploymentUsageResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in values (list)
73
+ _items = []
74
+ if self.values:
75
+ for _item_values in self.values:
76
+ if _item_values:
77
+ _items.append(_item_values.to_dict())
78
+ _dict['values'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of GetDeploymentUsageResponse 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
+ "values": [DeploymentUsageValue.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,111 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from platform_api_python_client.models.deployment_status import DeploymentStatus
24
+ from platform_api_python_client.models.deployment_type import DeploymentType
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class GetDeploymentV2Response(BaseModel):
29
+ """
30
+ GetDeploymentV2Response
31
+ """ # noqa: E501
32
+ cluster_id: StrictInt
33
+ id: StrictInt
34
+ name: StrictStr
35
+ endpoint_url: StrictStr
36
+ image_url: Optional[StrictStr]
37
+ type: DeploymentType
38
+ status: DeploymentStatus
39
+ created_at: datetime
40
+ hardware_instance_id: StrictInt
41
+ __properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id"]
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 GetDeploymentV2Response 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
+ # set to None if image_url (nullable) is None
83
+ # and model_fields_set contains the field
84
+ if self.image_url is None and "image_url" in self.model_fields_set:
85
+ _dict['image_url'] = None
86
+
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of GetDeploymentV2Response from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "cluster_id": obj.get("cluster_id"),
100
+ "id": obj.get("id"),
101
+ "name": obj.get("name"),
102
+ "endpoint_url": obj.get("endpoint_url"),
103
+ "image_url": obj.get("image_url"),
104
+ "type": obj.get("type"),
105
+ "status": obj.get("status"),
106
+ "created_at": obj.get("created_at"),
107
+ "hardware_instance_id": obj.get("hardware_instance_id")
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,145 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from platform_api_python_client.models.deployment_status import DeploymentStatus
24
+ from platform_api_python_client.models.deployment_type import DeploymentType
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class GetInferenceV2DeploymentResponse(BaseModel):
29
+ """
30
+ GetInferenceV2DeploymentResponse
31
+ """ # noqa: E501
32
+ cluster_id: StrictInt
33
+ id: StrictInt
34
+ name: StrictStr
35
+ endpoint_url: StrictStr
36
+ image_url: Optional[StrictStr]
37
+ type: DeploymentType
38
+ status: DeploymentStatus
39
+ created_at: datetime
40
+ hardware_instance_id: StrictInt
41
+ container_port: StrictInt
42
+ min_scale: StrictInt
43
+ max_scale: StrictInt
44
+ concurrency: Optional[StrictInt]
45
+ healthcheck: Optional[StrictStr]
46
+ endpoint_certificate_authority: Optional[StrictStr]
47
+ env_vars: Optional[Dict[str, StrictStr]]
48
+ __properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "container_port", "min_scale", "max_scale", "concurrency", "healthcheck", "endpoint_certificate_authority", "env_vars"]
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 GetInferenceV2DeploymentResponse 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
+ # set to None if image_url (nullable) is None
90
+ # and model_fields_set contains the field
91
+ if self.image_url is None and "image_url" in self.model_fields_set:
92
+ _dict['image_url'] = None
93
+
94
+ # set to None if concurrency (nullable) is None
95
+ # and model_fields_set contains the field
96
+ if self.concurrency is None and "concurrency" in self.model_fields_set:
97
+ _dict['concurrency'] = None
98
+
99
+ # set to None if healthcheck (nullable) is None
100
+ # and model_fields_set contains the field
101
+ if self.healthcheck is None and "healthcheck" in self.model_fields_set:
102
+ _dict['healthcheck'] = None
103
+
104
+ # set to None if endpoint_certificate_authority (nullable) is None
105
+ # and model_fields_set contains the field
106
+ if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
107
+ _dict['endpoint_certificate_authority'] = None
108
+
109
+ # set to None if env_vars (nullable) is None
110
+ # and model_fields_set contains the field
111
+ if self.env_vars is None and "env_vars" in self.model_fields_set:
112
+ _dict['env_vars'] = None
113
+
114
+ return _dict
115
+
116
+ @classmethod
117
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
118
+ """Create an instance of GetInferenceV2DeploymentResponse from a dict"""
119
+ if obj is None:
120
+ return None
121
+
122
+ if not isinstance(obj, dict):
123
+ return cls.model_validate(obj)
124
+
125
+ _obj = cls.model_validate({
126
+ "cluster_id": obj.get("cluster_id"),
127
+ "id": obj.get("id"),
128
+ "name": obj.get("name"),
129
+ "endpoint_url": obj.get("endpoint_url"),
130
+ "image_url": obj.get("image_url"),
131
+ "type": obj.get("type"),
132
+ "status": obj.get("status"),
133
+ "created_at": obj.get("created_at"),
134
+ "hardware_instance_id": obj.get("hardware_instance_id"),
135
+ "container_port": obj.get("container_port"),
136
+ "min_scale": obj.get("min_scale"),
137
+ "max_scale": obj.get("max_scale"),
138
+ "concurrency": obj.get("concurrency"),
139
+ "healthcheck": obj.get("healthcheck"),
140
+ "endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
141
+ "env_vars": obj.get("env_vars")
142
+ })
143
+ return _obj
144
+
145
+