stackit-edge 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.
- stackit/edge/__init__.py +79 -0
- stackit/edge/api/__init__.py +4 -0
- stackit/edge/api/default_api.py +3930 -0
- stackit/edge/api_client.py +639 -0
- stackit/edge/api_response.py +23 -0
- stackit/edge/configuration.py +163 -0
- stackit/edge/exceptions.py +217 -0
- stackit/edge/models/__init__.py +30 -0
- stackit/edge/models/bad_request.py +82 -0
- stackit/edge/models/create_instance_payload.py +89 -0
- stackit/edge/models/instance.py +133 -0
- stackit/edge/models/instance_list.py +98 -0
- stackit/edge/models/kubeconfig.py +81 -0
- stackit/edge/models/plan.py +93 -0
- stackit/edge/models/plan_list.py +98 -0
- stackit/edge/models/token.py +81 -0
- stackit/edge/models/unauthorized_request.py +82 -0
- stackit/edge/models/update_instance_by_name_payload.py +86 -0
- stackit/edge/models/update_instance_payload.py +86 -0
- stackit/edge/models/user.py +82 -0
- stackit/edge/py.typed +0 -0
- stackit/edge/rest.py +148 -0
- stackit_edge-0.1.0.dist-info/METADATA +48 -0
- stackit_edge-0.1.0.dist-info/RECORD +27 -0
- stackit_edge-0.1.0.dist-info/WHEEL +4 -0
- stackit_edge-0.1.0.dist-info/licenses/LICENSE.md +201 -0
- stackit_edge-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
23
|
+
from typing_extensions import Annotated, Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Instance(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Instance
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
created: datetime = Field(description="The date and time the creation of the instance was triggered.")
|
|
32
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(
|
|
33
|
+
default=None, description="A user chosen description to distinguish multiple instances."
|
|
34
|
+
)
|
|
35
|
+
display_name: Annotated[str, Field(strict=True, max_length=8)] = Field(
|
|
36
|
+
description="The displayed name of the instance.", alias="displayName"
|
|
37
|
+
)
|
|
38
|
+
frontend_url: StrictStr = Field(description="URL to the Management UI of the Instance.", alias="frontendUrl")
|
|
39
|
+
id: Annotated[str, Field(strict=True, max_length=16)] = Field(
|
|
40
|
+
description="A auto generated unique id which identifies the instance."
|
|
41
|
+
)
|
|
42
|
+
plan_id: StrictStr = Field(description="Service Plan configures the size of the Instance.", alias="planId")
|
|
43
|
+
status: StrictStr = Field(description="The current status of the instance.")
|
|
44
|
+
__properties: ClassVar[List[str]] = [
|
|
45
|
+
"created",
|
|
46
|
+
"description",
|
|
47
|
+
"displayName",
|
|
48
|
+
"frontendUrl",
|
|
49
|
+
"id",
|
|
50
|
+
"planId",
|
|
51
|
+
"status",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
@field_validator("created", mode="before")
|
|
55
|
+
def created_change_year_zero_to_one(cls, value):
|
|
56
|
+
"""Workaround which prevents year 0 issue"""
|
|
57
|
+
if isinstance(value, str):
|
|
58
|
+
# Check for year "0000" at the beginning of the string
|
|
59
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
60
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
61
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
62
|
+
):
|
|
63
|
+
# Workaround: Replace "0000" with "0001"
|
|
64
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
65
|
+
return value
|
|
66
|
+
|
|
67
|
+
@field_validator("status")
|
|
68
|
+
def status_validate_enum(cls, value):
|
|
69
|
+
"""Validates the enum"""
|
|
70
|
+
if value not in set(["error", "reconciling", "active", "deleting"]):
|
|
71
|
+
raise ValueError("must be one of enum values ('error', 'reconciling', 'active', 'deleting')")
|
|
72
|
+
return value
|
|
73
|
+
|
|
74
|
+
model_config = ConfigDict(
|
|
75
|
+
populate_by_name=True,
|
|
76
|
+
validate_assignment=True,
|
|
77
|
+
protected_namespaces=(),
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def to_str(self) -> str:
|
|
81
|
+
"""Returns the string representation of the model using alias"""
|
|
82
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
83
|
+
|
|
84
|
+
def to_json(self) -> str:
|
|
85
|
+
"""Returns the JSON representation of the model using alias"""
|
|
86
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
87
|
+
return json.dumps(self.to_dict())
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of Instance from a JSON string"""
|
|
92
|
+
return cls.from_dict(json.loads(json_str))
|
|
93
|
+
|
|
94
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
95
|
+
"""Return the dictionary representation of the model using alias.
|
|
96
|
+
|
|
97
|
+
This has the following differences from calling pydantic's
|
|
98
|
+
`self.model_dump(by_alias=True)`:
|
|
99
|
+
|
|
100
|
+
* `None` is only added to the output dict for nullable fields that
|
|
101
|
+
were set at model initialization. Other fields with value `None`
|
|
102
|
+
are ignored.
|
|
103
|
+
"""
|
|
104
|
+
excluded_fields: Set[str] = set([])
|
|
105
|
+
|
|
106
|
+
_dict = self.model_dump(
|
|
107
|
+
by_alias=True,
|
|
108
|
+
exclude=excluded_fields,
|
|
109
|
+
exclude_none=True,
|
|
110
|
+
)
|
|
111
|
+
return _dict
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
115
|
+
"""Create an instance of Instance from a dict"""
|
|
116
|
+
if obj is None:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
if not isinstance(obj, dict):
|
|
120
|
+
return cls.model_validate(obj)
|
|
121
|
+
|
|
122
|
+
_obj = cls.model_validate(
|
|
123
|
+
{
|
|
124
|
+
"created": obj.get("created"),
|
|
125
|
+
"description": obj.get("description"),
|
|
126
|
+
"displayName": obj.get("displayName"),
|
|
127
|
+
"frontendUrl": obj.get("frontendUrl"),
|
|
128
|
+
"id": obj.get("id"),
|
|
129
|
+
"planId": obj.get("planId"),
|
|
130
|
+
"status": obj.get("status"),
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
return _obj
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
from stackit.edge.models.instance import Instance
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class InstanceList(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
InstanceList
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
instances: List[Instance]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["instances"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
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 InstanceList 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
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
# override the default output from pydantic by calling `to_dict()` of each item in instances (list)
|
|
72
|
+
_items = []
|
|
73
|
+
if self.instances:
|
|
74
|
+
for _item in self.instances:
|
|
75
|
+
if _item:
|
|
76
|
+
_items.append(_item.to_dict())
|
|
77
|
+
_dict["instances"] = _items
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of InstanceList from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate(
|
|
90
|
+
{
|
|
91
|
+
"instances": (
|
|
92
|
+
[Instance.from_dict(_item) for _item in obj["instances"]]
|
|
93
|
+
if obj.get("instances") is not None
|
|
94
|
+
else None
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
return _obj
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Kubeconfig(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Kubeconfig
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
|
|
29
|
+
kubeconfig: Dict[str, Any] = Field(description="The kubeconfig for the instance.")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["kubeconfig"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
49
|
+
"""Create an instance of Kubeconfig from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
53
|
+
"""Return the dictionary representation of the model using alias.
|
|
54
|
+
|
|
55
|
+
This has the following differences from calling pydantic's
|
|
56
|
+
`self.model_dump(by_alias=True)`:
|
|
57
|
+
|
|
58
|
+
* `None` is only added to the output dict for nullable fields that
|
|
59
|
+
were set at model initialization. Other fields with value `None`
|
|
60
|
+
are ignored.
|
|
61
|
+
"""
|
|
62
|
+
excluded_fields: Set[str] = set([])
|
|
63
|
+
|
|
64
|
+
_dict = self.model_dump(
|
|
65
|
+
by_alias=True,
|
|
66
|
+
exclude=excluded_fields,
|
|
67
|
+
exclude_none=True,
|
|
68
|
+
)
|
|
69
|
+
return _dict
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
73
|
+
"""Create an instance of Kubeconfig from a dict"""
|
|
74
|
+
if obj is None:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
if not isinstance(obj, dict):
|
|
78
|
+
return cls.model_validate(obj)
|
|
79
|
+
|
|
80
|
+
_obj = cls.model_validate({"kubeconfig": obj.get("kubeconfig")})
|
|
81
|
+
return _obj
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Plan(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Plan
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
|
|
29
|
+
description: Optional[StrictStr] = Field(default=None, description="Description")
|
|
30
|
+
id: Optional[StrictStr] = Field(default=None, description="Service Plan Identifier")
|
|
31
|
+
max_edge_hosts: Optional[StrictInt] = Field(
|
|
32
|
+
default=None, description="Maximum number of EdgeHosts", alias="maxEdgeHosts"
|
|
33
|
+
)
|
|
34
|
+
name: Optional[StrictStr] = Field(default=None, description="Service Plan Name")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["description", "id", "maxEdgeHosts", "name"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
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 Plan 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
|
+
_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 Plan 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
|
+
{
|
|
87
|
+
"description": obj.get("description"),
|
|
88
|
+
"id": obj.get("id"),
|
|
89
|
+
"maxEdgeHosts": obj.get("maxEdgeHosts"),
|
|
90
|
+
"name": obj.get("name"),
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
return _obj
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
from stackit.edge.models.plan import Plan
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class PlanList(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
PlanList
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
valid_plans: Optional[List[Plan]] = Field(default=None, alias="validPlans")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["validPlans"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
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 PlanList 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
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
# override the default output from pydantic by calling `to_dict()` of each item in valid_plans (list)
|
|
72
|
+
_items = []
|
|
73
|
+
if self.valid_plans:
|
|
74
|
+
for _item in self.valid_plans:
|
|
75
|
+
if _item:
|
|
76
|
+
_items.append(_item.to_dict())
|
|
77
|
+
_dict["validPlans"] = _items
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of PlanList from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate(
|
|
90
|
+
{
|
|
91
|
+
"validPlans": (
|
|
92
|
+
[Plan.from_dict(_item) for _item in obj["validPlans"]]
|
|
93
|
+
if obj.get("validPlans") is not None
|
|
94
|
+
else None
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
return _obj
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Token(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Token
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
|
|
29
|
+
token: StrictStr = Field(description="The token for the instance.")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["token"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
49
|
+
"""Create an instance of Token from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
53
|
+
"""Return the dictionary representation of the model using alias.
|
|
54
|
+
|
|
55
|
+
This has the following differences from calling pydantic's
|
|
56
|
+
`self.model_dump(by_alias=True)`:
|
|
57
|
+
|
|
58
|
+
* `None` is only added to the output dict for nullable fields that
|
|
59
|
+
were set at model initialization. Other fields with value `None`
|
|
60
|
+
are ignored.
|
|
61
|
+
"""
|
|
62
|
+
excluded_fields: Set[str] = set([])
|
|
63
|
+
|
|
64
|
+
_dict = self.model_dump(
|
|
65
|
+
by_alias=True,
|
|
66
|
+
exclude=excluded_fields,
|
|
67
|
+
exclude_none=True,
|
|
68
|
+
)
|
|
69
|
+
return _dict
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
73
|
+
"""Create an instance of Token from a dict"""
|
|
74
|
+
if obj is None:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
if not isinstance(obj, dict):
|
|
78
|
+
return cls.model_validate(obj)
|
|
79
|
+
|
|
80
|
+
_obj = cls.model_validate({"token": obj.get("token")})
|
|
81
|
+
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class UnauthorizedRequest(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
UnauthorizedRequest
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
|
|
29
|
+
code: Optional[StrictStr] = None
|
|
30
|
+
message: Optional[StrictStr] = None
|
|
31
|
+
__properties: ClassVar[List[str]] = ["code", "message"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
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 UnauthorizedRequest 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
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of UnauthorizedRequest from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({"code": obj.get("code"), "message": obj.get("message")})
|
|
82
|
+
return _obj
|