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,98 @@
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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing_extensions import Annotated
23
+ from platform_api_python_client.models.c_serve_recipe_output import CServeRecipeOutput
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CServeRecipePerf(BaseModel):
28
+ """
29
+ CServeRecipePerf
30
+ """ # noqa: E501
31
+ recipe: CServeRecipeOutput
32
+ hardware_instance_id: StrictInt
33
+ output_tp: List[Annotated[List[Any], Field(min_length=2, max_length=2)]]
34
+ mean_ttft: List[Annotated[List[Any], Field(min_length=2, max_length=2)]]
35
+ __properties: ClassVar[List[str]] = ["recipe", "hardware_instance_id", "output_tp", "mean_ttft"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of CServeRecipePerf from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of recipe
77
+ if self.recipe:
78
+ _dict['recipe'] = self.recipe.to_dict()
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of CServeRecipePerf 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
+ "recipe": CServeRecipeOutput.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
92
+ "hardware_instance_id": obj.get("hardware_instance_id"),
93
+ "output_tp": obj.get("output_tp"),
94
+ "mean_ttft": obj.get("mean_ttft")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,105 @@
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 platform_api_python_client.models.c_serve_recipe_perf import CServeRecipePerf
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CServeRecipeResponse(BaseModel):
27
+ """
28
+ CServeRecipeResponse
29
+ """ # noqa: E501
30
+ model: StrictStr
31
+ cluster_id: StrictInt
32
+ fastest: CServeRecipePerf
33
+ cheapest: CServeRecipePerf
34
+ best_value: CServeRecipePerf
35
+ __properties: ClassVar[List[str]] = ["model", "cluster_id", "fastest", "cheapest", "best_value"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of CServeRecipeResponse from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of fastest
77
+ if self.fastest:
78
+ _dict['fastest'] = self.fastest.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of cheapest
80
+ if self.cheapest:
81
+ _dict['cheapest'] = self.cheapest.to_dict()
82
+ # override the default output from pydantic by calling `to_dict()` of best_value
83
+ if self.best_value:
84
+ _dict['best_value'] = self.best_value.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 CServeRecipeResponse 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
+ "model": obj.get("model"),
98
+ "cluster_id": obj.get("cluster_id"),
99
+ "fastest": CServeRecipePerf.from_dict(obj["fastest"]) if obj.get("fastest") is not None else None,
100
+ "cheapest": CServeRecipePerf.from_dict(obj["cheapest"]) if obj.get("cheapest") is not None else None,
101
+ "best_value": CServeRecipePerf.from_dict(obj["best_value"]) if obj.get("best_value") is not None else None
102
+ })
103
+ return _obj
104
+
105
+
@@ -0,0 +1,87 @@
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
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ClientSecretResponse(BaseModel):
26
+ """
27
+ ClientSecretResponse
28
+ """ # noqa: E501
29
+ client_secret: StrictStr
30
+ __properties: ClassVar[List[str]] = ["client_secret"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of ClientSecretResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of ClientSecretResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "client_secret": obj.get("client_secret")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,117 @@
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.c_serve_recipe_input import CServeRecipeInput
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateCServeDeploymentRequest(BaseModel):
27
+ """
28
+ CreateCServeDeploymentRequest
29
+ """ # noqa: E501
30
+ name: StrictStr
31
+ cluster_id: StrictInt
32
+ hardware_instance_id: StrictInt
33
+ recipe: CServeRecipeInput
34
+ hf_token: StrictStr
35
+ endpoint_certificate_authority: Optional[StrictStr] = None
36
+ min_scale: StrictInt
37
+ max_scale: StrictInt
38
+ concurrency: Optional[StrictInt] = None
39
+ __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "hf_token", "endpoint_certificate_authority", "min_scale", "max_scale", "concurrency"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of CreateCServeDeploymentRequest from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # override the default output from pydantic by calling `to_dict()` of recipe
81
+ if self.recipe:
82
+ _dict['recipe'] = self.recipe.to_dict()
83
+ # set to None if endpoint_certificate_authority (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
86
+ _dict['endpoint_certificate_authority'] = None
87
+
88
+ # set to None if concurrency (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.concurrency is None and "concurrency" in self.model_fields_set:
91
+ _dict['concurrency'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of CreateCServeDeploymentRequest from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "name": obj.get("name"),
106
+ "cluster_id": obj.get("cluster_id"),
107
+ "hardware_instance_id": obj.get("hardware_instance_id"),
108
+ "recipe": CServeRecipeInput.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
109
+ "hf_token": obj.get("hf_token"),
110
+ "endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
111
+ "min_scale": obj.get("min_scale"),
112
+ "max_scale": obj.get("max_scale"),
113
+ "concurrency": obj.get("concurrency")
114
+ })
115
+ return _obj
116
+
117
+
@@ -0,0 +1,92 @@
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
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateCServeDeploymentResponse(BaseModel):
27
+ """
28
+ CreateCServeDeploymentResponse
29
+ """ # noqa: E501
30
+ id: StrictInt
31
+ created_at: datetime
32
+ endpoint_url: StrictStr
33
+ __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
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 CreateCServeDeploymentResponse 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
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of CreateCServeDeploymentResponse from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "id": obj.get("id"),
87
+ "created_at": obj.get("created_at"),
88
+ "endpoint_url": obj.get("endpoint_url")
89
+ })
90
+ return _obj
91
+
92
+
@@ -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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateComputeDeploymentResponse(BaseModel):
27
+ """
28
+ CreateComputeDeploymentResponse
29
+ """ # noqa: E501
30
+ id: StrictInt
31
+ created_at: datetime
32
+ endpoint_url: StrictStr
33
+ port: StrictInt
34
+ __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url", "port"]
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 CreateComputeDeploymentResponse 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
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of CreateComputeDeploymentResponse from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "id": obj.get("id"),
88
+ "created_at": obj.get("created_at"),
89
+ "endpoint_url": obj.get("endpoint_url"),
90
+ "port": obj.get("port")
91
+ })
92
+ return _obj
93
+
94
+