Skip to content

Commit d355913

Browse files
stackit-pipelineFyuselrubenhoenle
authored
Generator: Update SDK /services/authorization (#1160)
* Generate authorization * Generate stackitmarketplace * Generate ske * Add changelog Signed-off-by: Alexander Dahmen <[email protected]> * Update CHANGELOG.md Co-authored-by: Ruben Hönle <[email protected]> * Update services/authorization/CHANGELOG.md Co-authored-by: Ruben Hönle <[email protected]> --------- Signed-off-by: Alexander Dahmen <[email protected]> Co-authored-by: Alexander Dahmen <[email protected]> Co-authored-by: Ruben Hönle <[email protected]>
1 parent 415d2dc commit d355913

File tree

17 files changed

+156
-19
lines changed

17 files changed

+156
-19
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Release (2025-XX-XX)
2+
- `authorization`: [v0.2.4](services/authorization/CHANGELOG.md#v024-2025-05-13)
3+
- **Bugfix:** Updated regex validator
4+
- `stackitmarketplace`: [v1.1.0](services/stackitmarketplace/CHANGELOG.md#v110-2025-05-13)
5+
- **Breaking Change:** Added organization id to `VendorSubscription`
6+
- `ske`: [v0.4.2](services/ske/CHANGELOG.md#v042-2025-05-13)
7+
- **Feature:** Added `ClusterError`
8+
19
## Release (2025-05-09)
210
- `stackitmarketplace`:
311
- [v1.0.1](services/stackitmarketplace/CHANGELOG.md#v101-2025-05-09)

services/authorization/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.2.4 (2025-05-13)
2+
- **Bugfix:** Updated regex validator
3+
14
## v0.2.3 (2025-05-09)
25
- **Feature:** Update user-agent header
36

services/authorization/src/stackit/authorization/models/existing_permission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class ExistingPermission(BaseModel):
3434
@field_validator("name")
3535
def name_validate_regular_expression(cls, value):
3636
"""Validates the regular expression"""
37-
if not re.match(r"^[a-z](?:-?\.?[a-z]){1,63}$", value):
38-
raise ValueError(r"must validate the regular expression /^[a-z](?:-?\.?[a-z]){1,63}$/")
37+
if not re.match(r"^[a-z](?:[-.]?[a-z]){1,63}$", value):
38+
raise ValueError(r"must validate the regular expression /^[a-z](?:[-.]?[a-z]){1,63}$/")
3939
return value
4040

4141
model_config = ConfigDict(

services/authorization/src/stackit/authorization/models/member.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Member(BaseModel):
3434
@field_validator("role")
3535
def role_validate_regular_expression(cls, value):
3636
"""Validates the regular expression"""
37-
if not re.match(r"^[a-z](?:-?\.?[a-z]){1,63}$", value):
38-
raise ValueError(r"must validate the regular expression /^[a-z](?:-?\.?[a-z]){1,63}$/")
37+
if not re.match(r"^[a-z](?:[-.]?[a-z]){1,63}$", value):
38+
raise ValueError(r"must validate the regular expression /^[a-z](?:[-.]?[a-z]){1,63}$/")
3939
return value
4040

4141
model_config = ConfigDict(

services/authorization/src/stackit/authorization/models/permission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Permission(BaseModel):
3434
@field_validator("name")
3535
def name_validate_regular_expression(cls, value):
3636
"""Validates the regular expression"""
37-
if not re.match(r"^[a-z](?:-?\.?[a-z]){1,63}$", value):
38-
raise ValueError(r"must validate the regular expression /^[a-z](?:-?\.?[a-z]){1,63}$/")
37+
if not re.match(r"^[a-z](?:[-.]?[a-z]){1,63}$", value):
38+
raise ValueError(r"must validate the regular expression /^[a-z](?:[-.]?[a-z]){1,63}$/")
3939
return value
4040

4141
model_config = ConfigDict(

services/authorization/src/stackit/authorization/models/role.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def id_validate_regular_expression(cls, value):
4848
@field_validator("name")
4949
def name_validate_regular_expression(cls, value):
5050
"""Validates the regular expression"""
51-
if not re.match(r"^[a-z](?:-?\.?[a-z]){1,63}$", value):
52-
raise ValueError(r"must validate the regular expression /^[a-z](?:-?\.?[a-z]){1,63}$/")
51+
if not re.match(r"^[a-z](?:[-.]?[a-z]){1,63}$", value):
52+
raise ValueError(r"must validate the regular expression /^[a-z](?:[-.]?[a-z]){1,63}$/")
5353
return value
5454

5555
model_config = ConfigDict(

services/authorization/src/stackit/authorization/models/user_membership.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def resource_type_validate_regular_expression(cls, value):
5050
@field_validator("role")
5151
def role_validate_regular_expression(cls, value):
5252
"""Validates the regular expression"""
53-
if not re.match(r"^[a-z](?:-?\.?[a-z]){1,63}$", value):
54-
raise ValueError(r"must validate the regular expression /^[a-z](?:-?\.?[a-z]){1,63}$/")
53+
if not re.match(r"^[a-z](?:[-.]?[a-z]){1,63}$", value):
54+
raise ValueError(r"must validate the regular expression /^[a-z](?:[-.]?[a-z]){1,63}$/")
5555
return value
5656

5757
model_config = ConfigDict(

services/ske/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.4.2 (2025-05-13)
2+
- **Feature:** Added `ClusterError`
3+
14
## v0.4.1 (2025-05-09)
25
- **Feature:** Update user-agent header
36

services/ske/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-ske"
33

44
[tool.poetry]
55
name = "stackit-ske"
6-
version = "v0.4.1"
6+
version = "v0.4.2"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/ske/src/stackit/ske/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from stackit.ske.models.argus import Argus
3838
from stackit.ske.models.availability_zone import AvailabilityZone
3939
from stackit.ske.models.cluster import Cluster
40+
from stackit.ske.models.cluster_error import ClusterError
4041
from stackit.ske.models.cluster_status import ClusterStatus
4142
from stackit.ske.models.cluster_status_state import ClusterStatusState
4243
from stackit.ske.models.create_kubeconfig_payload import CreateKubeconfigPayload

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from stackit.ske.models.argus import Argus
1919
from stackit.ske.models.availability_zone import AvailabilityZone
2020
from stackit.ske.models.cluster import Cluster
21+
from stackit.ske.models.cluster_error import ClusterError
2122
from stackit.ske.models.cluster_status import ClusterStatus
2223
from stackit.ske.models.cluster_status_state import ClusterStatusState
2324
from stackit.ske.models.create_kubeconfig_payload import CreateKubeconfigPayload
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# coding: utf-8
2+
3+
"""
4+
SKE-API
5+
6+
The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks.
7+
8+
The version of the OpenAPI document: 1.1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501 docstring might be too long
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, field_validator
21+
from typing_extensions import Self
22+
23+
24+
class ClusterError(BaseModel):
25+
"""
26+
ClusterError
27+
"""
28+
29+
code: Optional[StrictStr] = None
30+
message: Optional[StrictStr] = None
31+
__properties: ClassVar[List[str]] = ["code", "message"]
32+
33+
@field_validator("code")
34+
def code_validate_enum(cls, value):
35+
"""Validates the enum"""
36+
if value is None:
37+
return value
38+
39+
if value not in set(
40+
[
41+
"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND",
42+
"SKE_DNS_ZONE_NOT_FOUND",
43+
"SKE_NODE_MISCONFIGURED_PDB",
44+
"SKE_NODE_NO_VALID_HOST_FOUND",
45+
]
46+
):
47+
raise ValueError(
48+
"must be one of enum values ('SKE_OBSERVABILITY_INSTANCE_NOT_FOUND', 'SKE_DNS_ZONE_NOT_FOUND', 'SKE_NODE_MISCONFIGURED_PDB', 'SKE_NODE_NO_VALID_HOST_FOUND')"
49+
)
50+
return value
51+
52+
model_config = ConfigDict(
53+
populate_by_name=True,
54+
validate_assignment=True,
55+
protected_namespaces=(),
56+
)
57+
58+
def to_str(self) -> str:
59+
"""Returns the string representation of the model using alias"""
60+
return pprint.pformat(self.model_dump(by_alias=True))
61+
62+
def to_json(self) -> str:
63+
"""Returns the JSON representation of the model using alias"""
64+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65+
return json.dumps(self.to_dict())
66+
67+
@classmethod
68+
def from_json(cls, json_str: str) -> Optional[Self]:
69+
"""Create an instance of ClusterError from a JSON string"""
70+
return cls.from_dict(json.loads(json_str))
71+
72+
def to_dict(self) -> Dict[str, Any]:
73+
"""Return the dictionary representation of the model using alias.
74+
75+
This has the following differences from calling pydantic's
76+
`self.model_dump(by_alias=True)`:
77+
78+
* `None` is only added to the output dict for nullable fields that
79+
were set at model initialization. Other fields with value `None`
80+
are ignored.
81+
"""
82+
excluded_fields: Set[str] = set([])
83+
84+
_dict = self.model_dump(
85+
by_alias=True,
86+
exclude=excluded_fields,
87+
exclude_none=True,
88+
)
89+
return _dict
90+
91+
@classmethod
92+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93+
"""Create an instance of ClusterError from a dict"""
94+
if obj is None:
95+
return None
96+
97+
if not isinstance(obj, dict):
98+
return cls.model_validate(obj)
99+
100+
_obj = cls.model_validate({"code": obj.get("code"), "message": obj.get("message")})
101+
return _obj

services/ske/src/stackit/ske/models/cluster_status.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
2222
from typing_extensions import Self
2323

24+
from stackit.ske.models.cluster_error import ClusterError
2425
from stackit.ske.models.cluster_status_state import ClusterStatusState
2526
from stackit.ske.models.credentials_rotation_state import CredentialsRotationState
2627
from stackit.ske.models.runtime_error import RuntimeError
@@ -42,13 +43,15 @@ class ClusterStatus(BaseModel):
4243
alias="egressAddressRanges",
4344
)
4445
error: Optional[RuntimeError] = None
46+
errors: Optional[List[ClusterError]] = None
4547
hibernated: Optional[StrictBool] = None
4648
__properties: ClassVar[List[str]] = [
4749
"aggregated",
4850
"creationTime",
4951
"credentialsRotation",
5052
"egressAddressRanges",
5153
"error",
54+
"errors",
5255
"hibernated",
5356
]
5457

@@ -95,6 +98,13 @@ def to_dict(self) -> Dict[str, Any]:
9598
# override the default output from pydantic by calling `to_dict()` of error
9699
if self.error:
97100
_dict["error"] = self.error.to_dict()
101+
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
102+
_items = []
103+
if self.errors:
104+
for _item in self.errors:
105+
if _item:
106+
_items.append(_item.to_dict())
107+
_dict["errors"] = _items
98108
return _dict
99109

100110
@classmethod
@@ -119,6 +129,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119129
),
120130
"egressAddressRanges": obj.get("egressAddressRanges"),
121131
"error": RuntimeError.from_dict(obj["error"]) if obj.get("error") is not None else None,
132+
"errors": (
133+
[ClusterError.from_dict(_item) for _item in obj["errors"]]
134+
if obj.get("errors") is not None
135+
else None
136+
),
122137
"hibernated": obj.get("hibernated"),
123138
}
124139
)

services/stackitmarketplace/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v1.1.0 (2025-05-13)
2+
- **Breaking Change:** Added organization id to `VendorSubscription`
3+
14
## v1.0.1 (2025-05-09)
25
- **Feature:** Update user-agent header
36

services/stackitmarketplace/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace"
33

44
[tool.poetry]
55
name = "stackit-stackitmarketplace"
6-
version = "v1.0.1"
6+
version = "v1.1.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,9 +1514,9 @@ def list_vendor_subscriptions(
15141514
_headers: Optional[Dict[StrictStr, Any]] = None,
15151515
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
15161516
) -> ListVendorSubscriptionsResponse:
1517-
"""List all subscriptions
1517+
"""List all subscriptions of a project.
15181518
1519-
List all subscriptions.
1519+
List all subscriptions of a project.
15201520
15211521
:param project_id: The project ID. (required)
15221522
:type project_id: str
@@ -1606,9 +1606,9 @@ def list_vendor_subscriptions_with_http_info(
16061606
_headers: Optional[Dict[StrictStr, Any]] = None,
16071607
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
16081608
) -> ApiResponse[ListVendorSubscriptionsResponse]:
1609-
"""List all subscriptions
1609+
"""List all subscriptions of a project.
16101610
1611-
List all subscriptions.
1611+
List all subscriptions of a project.
16121612
16131613
:param project_id: The project ID. (required)
16141614
:type project_id: str
@@ -1698,9 +1698,9 @@ def list_vendor_subscriptions_without_preload_content(
16981698
_headers: Optional[Dict[StrictStr, Any]] = None,
16991699
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
17001700
) -> RESTResponseType:
1701-
"""List all subscriptions
1701+
"""List all subscriptions of a project.
17021702
1703-
List all subscriptions.
1703+
List all subscriptions of a project.
17041704
17051705
:param project_id: The project ID. (required)
17061706
:type project_id: str

services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ class VendorSubscription(BaseModel):
3333
"""
3434

3535
lifecycle_state: SubscriptionLifecycleState = Field(alias="lifecycleState")
36+
organization_id: object = Field(alias="organizationId")
3637
product: SubscriptionProduct
3738
project_id: object = Field(alias="projectId")
3839
subscription_id: object = Field(alias="subscriptionId")
39-
__properties: ClassVar[List[str]] = ["lifecycleState", "product", "projectId", "subscriptionId"]
40+
__properties: ClassVar[List[str]] = ["lifecycleState", "organizationId", "product", "projectId", "subscriptionId"]
4041

4142
model_config = ConfigDict(
4243
populate_by_name=True,
@@ -92,6 +93,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9293
_obj = cls.model_validate(
9394
{
9495
"lifecycleState": obj.get("lifecycleState"),
96+
"organizationId": obj.get("organizationId"),
9597
"product": SubscriptionProduct.from_dict(obj["product"]) if obj.get("product") is not None else None,
9698
"projectId": obj.get("projectId"),
9799
"subscriptionId": obj.get("subscriptionId"),

0 commit comments

Comments
 (0)