Skip to content

Commit c016fac

Browse files
Generate edge
1 parent d14550d commit c016fac

24 files changed

Lines changed: 357 additions & 101 deletions

services/edge/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dced41b14515398157ee7204ef11256b9e3fcbdc
1+
876a48fb56473c7c844baa697906d461c0675f47

services/edge/src/stackit/edge/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
# flake8: noqa
44

55
"""
6-
STACKIT Edge Cloud API
6+
STACKIT Edge Cloud API
77
8-
This API provides endpoints for managing STACKIT Edge Cloud instances.
8+
This API provides endpoints for managing STACKIT Edge Cloud instances.
99
10-
The version of the OpenAPI document: 1beta1
11-
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
The version of the OpenAPI document: 1beta1
11+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1212
13-
Do not edit the class manually.
13+
Do not edit the class manually.
1414
""" # noqa: E501
1515

16+
1617
__version__ = "1.0.0"
1718

1819
# Define package exports
@@ -27,10 +28,12 @@
2728
"ApiKeyError",
2829
"ApiAttributeError",
2930
"ApiException",
31+
"Acl",
3032
"BadRequest",
3133
"CreateInstancePayload",
3234
"Instance",
3335
"InstanceList",
36+
"IpAllowListEntry",
3437
"Kubeconfig",
3538
"KubernetesReleaseList",
3639
"Plan",
@@ -57,12 +60,14 @@
5760
from stackit.edge.exceptions import OpenApiException as OpenApiException
5861

5962
# import models into sdk package
63+
from stackit.edge.models.acl import Acl as Acl
6064
from stackit.edge.models.bad_request import BadRequest as BadRequest
6165
from stackit.edge.models.create_instance_payload import (
6266
CreateInstancePayload as CreateInstancePayload,
6367
)
6468
from stackit.edge.models.instance import Instance as Instance
6569
from stackit.edge.models.instance_list import InstanceList as InstanceList
70+
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry as IpAllowListEntry
6671
from stackit.edge.models.kubeconfig import Kubeconfig as Kubeconfig
6772
from stackit.edge.models.kubernetes_release_list import (
6873
KubernetesReleaseList as KubernetesReleaseList,

services/edge/src/stackit/edge/api/default_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# coding: utf-8
22

33
"""
4-
STACKIT Edge Cloud API
4+
STACKIT Edge Cloud API
55
6-
This API provides endpoints for managing STACKIT Edge Cloud instances.
6+
This API provides endpoints for managing STACKIT Edge Cloud instances.
77
8-
The version of the OpenAPI document: 1beta1
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1beta1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
from typing import Any, Dict, List, Optional, Tuple, Union

services/edge/src/stackit/edge/api_client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# coding: utf-8
22

33
"""
4-
STACKIT Edge Cloud API
4+
STACKIT Edge Cloud API
55
6-
This API provides endpoints for managing STACKIT Edge Cloud instances.
6+
This API provides endpoints for managing STACKIT Edge Cloud instances.
77
8-
The version of the OpenAPI document: 1beta1
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1beta1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
import datetime
@@ -36,6 +36,7 @@
3636
ApiException,
3737
)
3838

39+
3940
RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
4041

4142

services/edge/src/stackit/edge/api_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from pydantic import BaseModel, Field, StrictBytes, StrictInt
88

9+
910
T = TypeVar("T")
1011

1112

services/edge/src/stackit/edge/configuration.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# coding: utf-8
22

33
"""
4-
STACKIT Edge Cloud API
4+
STACKIT Edge Cloud API
55
6-
This API provides endpoints for managing STACKIT Edge Cloud instances.
6+
This API provides endpoints for managing STACKIT Edge Cloud instances.
77
8-
The version of the OpenAPI document: 1beta1
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1beta1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
import sys
@@ -18,6 +18,7 @@
1818

1919
import os
2020

21+
2122
ServerVariablesT = Dict[str, str]
2223

2324

services/edge/src/stackit/edge/exceptions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# coding: utf-8
22

33
"""
4-
STACKIT Edge Cloud API
4+
STACKIT Edge Cloud API
55
6-
This API provides endpoints for managing STACKIT Edge Cloud instances.
6+
This API provides endpoints for managing STACKIT Edge Cloud instances.
77
8-
The version of the OpenAPI document: 1beta1
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1beta1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
from typing import Any, Optional

services/edge/src/stackit/edge/models/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22

33
# flake8: noqa
44
"""
5-
STACKIT Edge Cloud API
5+
STACKIT Edge Cloud API
66
7-
This API provides endpoints for managing STACKIT Edge Cloud instances.
7+
This API provides endpoints for managing STACKIT Edge Cloud instances.
88
9-
The version of the OpenAPI document: 1beta1
10-
Generated by OpenAPI Generator (https://openapi-generator.tech)
9+
The version of the OpenAPI document: 1beta1
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
12-
Do not edit the class manually.
12+
Do not edit the class manually.
1313
""" # noqa: E501
1414

1515
# import models into model package
16+
from stackit.edge.models.acl import Acl
1617
from stackit.edge.models.bad_request import BadRequest
1718
from stackit.edge.models.create_instance_payload import CreateInstancePayload
1819
from stackit.edge.models.instance import Instance
1920
from stackit.edge.models.instance_list import InstanceList
21+
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry
2022
from stackit.edge.models.kubeconfig import Kubeconfig
2123
from stackit.edge.models.kubernetes_release_list import KubernetesReleaseList
2224
from stackit.edge.models.plan import Plan
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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 pydantic_core import to_jsonable_python
22+
from typing_extensions import Self
23+
24+
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry
25+
26+
27+
class Acl(BaseModel):
28+
"""
29+
The ACL config for the instances API.
30+
""" # noqa: E501
31+
32+
ip_allow_list: Optional[List[IpAllowListEntry]] = Field(default=None, alias="ipAllowList")
33+
__properties: ClassVar[List[str]] = ["ipAllowList"]
34+
35+
model_config = ConfigDict(
36+
validate_by_name=True,
37+
validate_by_alias=True,
38+
validate_assignment=True,
39+
protected_namespaces=(),
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+
return json.dumps(to_jsonable_python(self.to_dict()))
49+
50+
@classmethod
51+
def from_json(cls, json_str: str) -> Optional[Self]:
52+
"""Create an instance of Acl from a JSON string"""
53+
return cls.from_dict(json.loads(json_str))
54+
55+
def to_dict(self) -> Dict[str, Any]:
56+
"""Return the dictionary representation of the model using alias.
57+
58+
This has the following differences from calling pydantic's
59+
`self.model_dump(by_alias=True)`:
60+
61+
* `None` is only added to the output dict for nullable fields that
62+
were set at model initialization. Other fields with value `None`
63+
are ignored.
64+
"""
65+
excluded_fields: Set[str] = set([])
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 ip_allow_list (list)
73+
_items = []
74+
if self.ip_allow_list:
75+
for _item_ip_allow_list in self.ip_allow_list:
76+
if _item_ip_allow_list:
77+
_items.append(_item_ip_allow_list.to_dict())
78+
_dict["ipAllowList"] = _items
79+
return _dict
80+
81+
@classmethod
82+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83+
"""Create an instance of Acl 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+
{
92+
"ipAllowList": (
93+
[IpAllowListEntry.from_dict(_item) for _item in obj["ipAllowList"]]
94+
if obj.get("ipAllowList") is not None
95+
else None
96+
)
97+
}
98+
)
99+
return _obj

services/edge/src/stackit/edge/models/bad_request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# coding: utf-8
22

33
"""
4-
STACKIT Edge Cloud API
4+
STACKIT Edge Cloud API
55
6-
This API provides endpoints for managing STACKIT Edge Cloud instances.
6+
This API provides endpoints for managing STACKIT Edge Cloud instances.
77
8-
The version of the OpenAPI document: 1beta1
9-
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
The version of the OpenAPI document: 1beta1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
11-
Do not edit the class manually.
11+
Do not edit the class manually.
1212
""" # noqa: E501
1313

1414
from __future__ import annotations

0 commit comments

Comments
 (0)