Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/edge/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dced41b14515398157ee7204ef11256b9e3fcbdc
876a48fb56473c7c844baa697906d461c0675f47
15 changes: 10 additions & 5 deletions services/edge/src/stackit/edge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# flake8: noqa

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


__version__ = "1.0.0"

# Define package exports
Expand All @@ -27,10 +28,12 @@
"ApiKeyError",
"ApiAttributeError",
"ApiException",
"Acl",
"BadRequest",
"CreateInstancePayload",
"Instance",
"InstanceList",
"IpAllowListEntry",
"Kubeconfig",
"KubernetesReleaseList",
"Plan",
Expand All @@ -57,12 +60,14 @@
from stackit.edge.exceptions import OpenApiException as OpenApiException

# import models into sdk package
from stackit.edge.models.acl import Acl as Acl
from stackit.edge.models.bad_request import BadRequest as BadRequest
from stackit.edge.models.create_instance_payload import (
CreateInstancePayload as CreateInstancePayload,
)
from stackit.edge.models.instance import Instance as Instance
from stackit.edge.models.instance_list import InstanceList as InstanceList
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry as IpAllowListEntry
from stackit.edge.models.kubeconfig import Kubeconfig as Kubeconfig
from stackit.edge.models.kubernetes_release_list import (
KubernetesReleaseList as KubernetesReleaseList,
Expand Down
10 changes: 5 additions & 5 deletions services/edge/src/stackit/edge/api/default_api.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

from typing import Any, Dict, List, Optional, Tuple, Union
Expand Down
11 changes: 6 additions & 5 deletions services/edge/src/stackit/edge/api_client.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

import datetime
Expand Down Expand Up @@ -36,6 +36,7 @@
ApiException,
)


RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]


Expand Down
1 change: 1 addition & 0 deletions services/edge/src/stackit/edge/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from pydantic import BaseModel, Field, StrictBytes, StrictInt


T = TypeVar("T")


Expand Down
11 changes: 6 additions & 5 deletions services/edge/src/stackit/edge/configuration.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

import sys
Expand All @@ -18,6 +18,7 @@

import os


ServerVariablesT = Dict[str, str]


Expand Down
10 changes: 5 additions & 5 deletions services/edge/src/stackit/edge/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

from typing import Any, Optional
Expand Down
12 changes: 7 additions & 5 deletions services/edge/src/stackit/edge/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

# flake8: noqa
"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

# import models into model package
from stackit.edge.models.acl import Acl
from stackit.edge.models.bad_request import BadRequest
from stackit.edge.models.create_instance_payload import CreateInstancePayload
from stackit.edge.models.instance import Instance
from stackit.edge.models.instance_list import InstanceList
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry
from stackit.edge.models.kubeconfig import Kubeconfig
from stackit.edge.models.kubernetes_release_list import KubernetesReleaseList
from stackit.edge.models.plan import Plan
Expand Down
99 changes: 99 additions & 0 deletions services/edge/src/stackit/edge/models/acl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# coding: utf-8

"""
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic_core import to_jsonable_python
from typing_extensions import Self

from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry


class Acl(BaseModel):
"""
The ACL config for the instances API.
""" # noqa: E501

ip_allow_list: Optional[List[IpAllowListEntry]] = Field(default=None, alias="ipAllowList")
__properties: ClassVar[List[str]] = ["ipAllowList"]

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of Acl from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in ip_allow_list (list)
_items = []
if self.ip_allow_list:
for _item_ip_allow_list in self.ip_allow_list:
if _item_ip_allow_list:
_items.append(_item_ip_allow_list.to_dict())
_dict["ipAllowList"] = _items
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of Acl from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{
"ipAllowList": (
[IpAllowListEntry.from_dict(_item) for _item in obj["ipAllowList"]]
if obj.get("ipAllowList") is not None
else None
)
}
)
return _obj
10 changes: 5 additions & 5 deletions services/edge/src/stackit/edge/models/bad_request.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations
Expand Down
18 changes: 13 additions & 5 deletions services/edge/src/stackit/edge/models/instance.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# coding: utf-8

"""
STACKIT Edge Cloud API
STACKIT Edge Cloud API

This API provides endpoints for managing STACKIT Edge Cloud instances.
This API provides endpoints for managing STACKIT Edge Cloud instances.

The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 1beta1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations
Expand All @@ -24,12 +24,15 @@
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self

from stackit.edge.models.acl import Acl


class Instance(BaseModel):
"""
Instance
""" # noqa: E501

acl: Optional[Acl] = None
created: datetime = Field(description="The date and time the creation of the instance was triggered.")
description: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(
default=None, description="A user chosen description to distinguish multiple instances."
Expand All @@ -44,6 +47,7 @@ class Instance(BaseModel):
plan_id: UUID = Field(description="Service Plan configures the size of the Instance.", alias="planId")
status: StrictStr = Field(description="The current status of the instance.")
__properties: ClassVar[List[str]] = [
"acl",
"created",
"description",
"displayName",
Expand Down Expand Up @@ -110,6 +114,9 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of acl
if self.acl:
_dict["acl"] = self.acl.to_dict()
return _dict

@classmethod
Expand All @@ -123,6 +130,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate(
{
"acl": Acl.from_dict(obj["acl"]) if obj.get("acl") is not None else None,
"created": obj.get("created"),
"description": obj.get("description"),
"displayName": obj.get("displayName"),
Expand Down
Loading
Loading