Skip to content

Commit 79fcca3

Browse files
Generator: Update SDK /services/scf (#2112)
* Generate scf v0.2.0 - **Feature:** Add field `OrgId` in model `OrgManager` - **Feature:** Add ned model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` --------- Co-authored-by: Marcel Jacek <[email protected]>
1 parent 5064b39 commit 79fcca3

File tree

8 files changed

+236
-3
lines changed

8 files changed

+236
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## Release (2025-XX-YY)
2-
- `scf`: [v0.1.0](services/scf/CHANGELOG.md#v010)
3-
- **New:** STACKIT Cloud Foundry module
2+
- `scf`:
3+
- [v0.2.0](services/scf/CHANGELOG.md#v020)
4+
- **Feature:** Add field `OrgId` in model `OrgManager`
5+
- **Feature:** Add new model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse`
6+
- [v0.1.0](services/scf/CHANGELOG.md#v010)
7+
- **New:** STACKIT Cloud Foundry module
48
- `alb`: [v0.5.0](services/alb/CHANGELOG.md#v050)
59
- **Version**: Minimal version is now python 3.9
610
- `authorization`: [v0.3.0](services/authorization/CHANGELOG.md#v030)

services/scf/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
## v0.2.0
2+
- **Feature:** Add field `OrgId` in model `OrgManager`
3+
- **Feature:** Add new model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse`
4+
15
## v0.1.0
26
- **New:** STACKIT Cloud Foundry module

services/scf/pyproject.toml

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

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

services/scf/src/stackit/scf/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"OrgRoleResponse",
4343
"OrgRoleType",
4444
"Organization",
45+
"OrganizationCreateBffResponse",
4546
"OrganizationCreateResponse",
4647
"OrganizationDeleteResponse",
4748
"OrganizationQuota",
@@ -57,6 +58,7 @@
5758
"QuotaRoutes",
5859
"QuotaServices",
5960
"Space",
61+
"SpaceCreatedBffResponse",
6062
"SpaceDeleteResponse",
6163
"SpaceRoleCreateBffRequest",
6264
"SpaceRoleCreateBffResponse",
@@ -112,6 +114,9 @@
112114
from stackit.scf.models.org_role_response import OrgRoleResponse as OrgRoleResponse
113115
from stackit.scf.models.org_role_type import OrgRoleType as OrgRoleType
114116
from stackit.scf.models.organization import Organization as Organization
117+
from stackit.scf.models.organization_create_bff_response import (
118+
OrganizationCreateBffResponse as OrganizationCreateBffResponse,
119+
)
115120
from stackit.scf.models.organization_create_response import (
116121
OrganizationCreateResponse as OrganizationCreateResponse,
117122
)
@@ -135,6 +140,9 @@
135140
from stackit.scf.models.quota_routes import QuotaRoutes as QuotaRoutes
136141
from stackit.scf.models.quota_services import QuotaServices as QuotaServices
137142
from stackit.scf.models.space import Space as Space
143+
from stackit.scf.models.space_created_bff_response import (
144+
SpaceCreatedBffResponse as SpaceCreatedBffResponse,
145+
)
138146
from stackit.scf.models.space_delete_response import (
139147
SpaceDeleteResponse as SpaceDeleteResponse,
140148
)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
from stackit.scf.models.org_role_response import OrgRoleResponse
3131
from stackit.scf.models.org_role_type import OrgRoleType
3232
from stackit.scf.models.organization import Organization
33+
from stackit.scf.models.organization_create_bff_response import (
34+
OrganizationCreateBffResponse,
35+
)
3336
from stackit.scf.models.organization_create_response import OrganizationCreateResponse
3437
from stackit.scf.models.organization_delete_response import OrganizationDeleteResponse
3538
from stackit.scf.models.organization_quota import OrganizationQuota
@@ -45,6 +48,7 @@
4548
from stackit.scf.models.quota_routes import QuotaRoutes
4649
from stackit.scf.models.quota_services import QuotaServices
4750
from stackit.scf.models.space import Space
51+
from stackit.scf.models.space_created_bff_response import SpaceCreatedBffResponse
4852
from stackit.scf.models.space_delete_response import SpaceDeleteResponse
4953
from stackit.scf.models.space_role_create_bff_request import SpaceRoleCreateBffRequest
5054
from stackit.scf.models.space_role_create_bff_response import SpaceRoleCreateBffResponse

services/scf/src/stackit/scf/models/org_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class OrgManager(BaseModel):
3030

3131
created_at: datetime = Field(alias="createdAt")
3232
guid: StrictStr
33+
org_id: StrictStr = Field(alias="orgId")
3334
platform_id: StrictStr = Field(alias="platformId")
3435
project_id: StrictStr = Field(alias="projectId")
3536
region: StrictStr
@@ -38,6 +39,7 @@ class OrgManager(BaseModel):
3839
__properties: ClassVar[List[str]] = [
3940
"createdAt",
4041
"guid",
42+
"orgId",
4143
"platformId",
4244
"projectId",
4345
"region",
@@ -97,6 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9799
{
98100
"createdAt": obj.get("createdAt"),
99101
"guid": obj.get("guid"),
102+
"orgId": obj.get("orgId"),
100103
"platformId": obj.get("platformId"),
101104
"projectId": obj.get("projectId"),
102105
"region": obj.get("region"),
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Cloud Foundry API
5+
6+
API endpoints for managing STACKIT Cloud Foundry
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict
22+
from typing_extensions import Self
23+
24+
from stackit.scf.models.org_role_response import OrgRoleResponse
25+
from stackit.scf.models.organization_create_response import OrganizationCreateResponse
26+
27+
28+
class OrganizationCreateBffResponse(BaseModel):
29+
"""
30+
OrganizationCreateBffResponse
31+
""" # noqa: E501
32+
33+
org: OrganizationCreateResponse
34+
roles: Dict[str, OrgRoleResponse]
35+
__properties: ClassVar[List[str]] = ["org", "roles"]
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 OrganizationCreateBffResponse 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+
# override the default output from pydantic by calling `to_dict()` of org
75+
if self.org:
76+
_dict["org"] = self.org.to_dict()
77+
# override the default output from pydantic by calling `to_dict()` of each value in roles (dict)
78+
_field_dict = {}
79+
if self.roles:
80+
for _key in self.roles:
81+
if self.roles[_key]:
82+
_field_dict[_key] = self.roles[_key].to_dict()
83+
_dict["roles"] = _field_dict
84+
return _dict
85+
86+
@classmethod
87+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88+
"""Create an instance of OrganizationCreateBffResponse from a dict"""
89+
if obj is None:
90+
return None
91+
92+
if not isinstance(obj, dict):
93+
return cls.model_validate(obj)
94+
95+
_obj = cls.model_validate(
96+
{
97+
"org": OrganizationCreateResponse.from_dict(obj["org"]) if obj.get("org") is not None else None,
98+
"roles": (
99+
dict((_k, OrgRoleResponse.from_dict(_v)) for _k, _v in obj["roles"].items())
100+
if obj.get("roles") is not None
101+
else None
102+
),
103+
}
104+
)
105+
return _obj
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Cloud Foundry API
5+
6+
API endpoints for managing STACKIT Cloud Foundry
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, Field
22+
from typing_extensions import Self
23+
24+
from stackit.scf.models.org_role_response import OrgRoleResponse
25+
from stackit.scf.models.space import Space
26+
from stackit.scf.models.space_role_create_response import SpaceRoleCreateResponse
27+
28+
29+
class SpaceCreatedBffResponse(BaseModel):
30+
"""
31+
SpaceCreatedBffResponse
32+
""" # noqa: E501
33+
34+
org_role: Optional[OrgRoleResponse] = Field(default=None, alias="orgRole")
35+
space: Space
36+
space_role: SpaceRoleCreateResponse = Field(alias="spaceRole")
37+
__properties: ClassVar[List[str]] = ["orgRole", "space", "spaceRole"]
38+
39+
model_config = ConfigDict(
40+
populate_by_name=True,
41+
validate_assignment=True,
42+
protected_namespaces=(),
43+
)
44+
45+
def to_str(self) -> str:
46+
"""Returns the string representation of the model using alias"""
47+
return pprint.pformat(self.model_dump(by_alias=True))
48+
49+
def to_json(self) -> str:
50+
"""Returns the JSON representation of the model using alias"""
51+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52+
return json.dumps(self.to_dict())
53+
54+
@classmethod
55+
def from_json(cls, json_str: str) -> Optional[Self]:
56+
"""Create an instance of SpaceCreatedBffResponse from a JSON string"""
57+
return cls.from_dict(json.loads(json_str))
58+
59+
def to_dict(self) -> Dict[str, Any]:
60+
"""Return the dictionary representation of the model using alias.
61+
62+
This has the following differences from calling pydantic's
63+
`self.model_dump(by_alias=True)`:
64+
65+
* `None` is only added to the output dict for nullable fields that
66+
were set at model initialization. Other fields with value `None`
67+
are ignored.
68+
"""
69+
excluded_fields: Set[str] = set([])
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 org_role
77+
if self.org_role:
78+
_dict["orgRole"] = self.org_role.to_dict()
79+
# override the default output from pydantic by calling `to_dict()` of space
80+
if self.space:
81+
_dict["space"] = self.space.to_dict()
82+
# override the default output from pydantic by calling `to_dict()` of space_role
83+
if self.space_role:
84+
_dict["spaceRole"] = self.space_role.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 SpaceCreatedBffResponse 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+
{
98+
"orgRole": OrgRoleResponse.from_dict(obj["orgRole"]) if obj.get("orgRole") is not None else None,
99+
"space": Space.from_dict(obj["space"]) if obj.get("space") is not None else None,
100+
"spaceRole": (
101+
SpaceRoleCreateResponse.from_dict(obj["spaceRole"]) if obj.get("spaceRole") is not None else None
102+
),
103+
}
104+
)
105+
return _obj

0 commit comments

Comments
 (0)