From d69f3eeeae84909982a23dbf4799a28dfafe851b Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 4 Aug 2025 06:55:07 +0000 Subject: [PATCH 1/3] Generate scf --- services/scf/src/stackit/scf/__init__.py | 8 ++ .../scf/src/stackit/scf/models/__init__.py | 4 + .../scf/src/stackit/scf/models/org_manager.py | 3 + .../organization_create_bff_response.py | 105 ++++++++++++++++++ .../scf/models/space_created_bff_response.py | 105 ++++++++++++++++++ 5 files changed, 225 insertions(+) create mode 100644 services/scf/src/stackit/scf/models/organization_create_bff_response.py create mode 100644 services/scf/src/stackit/scf/models/space_created_bff_response.py diff --git a/services/scf/src/stackit/scf/__init__.py b/services/scf/src/stackit/scf/__init__.py index 79aa92ea7..060b977e2 100644 --- a/services/scf/src/stackit/scf/__init__.py +++ b/services/scf/src/stackit/scf/__init__.py @@ -42,6 +42,7 @@ "OrgRoleResponse", "OrgRoleType", "Organization", + "OrganizationCreateBffResponse", "OrganizationCreateResponse", "OrganizationDeleteResponse", "OrganizationQuota", @@ -57,6 +58,7 @@ "QuotaRoutes", "QuotaServices", "Space", + "SpaceCreatedBffResponse", "SpaceDeleteResponse", "SpaceRoleCreateBffRequest", "SpaceRoleCreateBffResponse", @@ -112,6 +114,9 @@ from stackit.scf.models.org_role_response import OrgRoleResponse as OrgRoleResponse from stackit.scf.models.org_role_type import OrgRoleType as OrgRoleType from stackit.scf.models.organization import Organization as Organization +from stackit.scf.models.organization_create_bff_response import ( + OrganizationCreateBffResponse as OrganizationCreateBffResponse, +) from stackit.scf.models.organization_create_response import ( OrganizationCreateResponse as OrganizationCreateResponse, ) @@ -135,6 +140,9 @@ from stackit.scf.models.quota_routes import QuotaRoutes as QuotaRoutes from stackit.scf.models.quota_services import QuotaServices as QuotaServices from stackit.scf.models.space import Space as Space +from stackit.scf.models.space_created_bff_response import ( + SpaceCreatedBffResponse as SpaceCreatedBffResponse, +) from stackit.scf.models.space_delete_response import ( SpaceDeleteResponse as SpaceDeleteResponse, ) diff --git a/services/scf/src/stackit/scf/models/__init__.py b/services/scf/src/stackit/scf/models/__init__.py index 86392b955..4da3f7927 100644 --- a/services/scf/src/stackit/scf/models/__init__.py +++ b/services/scf/src/stackit/scf/models/__init__.py @@ -30,6 +30,9 @@ from stackit.scf.models.org_role_response import OrgRoleResponse from stackit.scf.models.org_role_type import OrgRoleType from stackit.scf.models.organization import Organization +from stackit.scf.models.organization_create_bff_response import ( + OrganizationCreateBffResponse, +) from stackit.scf.models.organization_create_response import OrganizationCreateResponse from stackit.scf.models.organization_delete_response import OrganizationDeleteResponse from stackit.scf.models.organization_quota import OrganizationQuota @@ -45,6 +48,7 @@ from stackit.scf.models.quota_routes import QuotaRoutes from stackit.scf.models.quota_services import QuotaServices from stackit.scf.models.space import Space +from stackit.scf.models.space_created_bff_response import SpaceCreatedBffResponse from stackit.scf.models.space_delete_response import SpaceDeleteResponse from stackit.scf.models.space_role_create_bff_request import SpaceRoleCreateBffRequest from stackit.scf.models.space_role_create_bff_response import SpaceRoleCreateBffResponse diff --git a/services/scf/src/stackit/scf/models/org_manager.py b/services/scf/src/stackit/scf/models/org_manager.py index c56c95021..d1faa8188 100644 --- a/services/scf/src/stackit/scf/models/org_manager.py +++ b/services/scf/src/stackit/scf/models/org_manager.py @@ -30,6 +30,7 @@ class OrgManager(BaseModel): created_at: datetime = Field(alias="createdAt") guid: StrictStr + org_id: StrictStr = Field(alias="orgId") platform_id: StrictStr = Field(alias="platformId") project_id: StrictStr = Field(alias="projectId") region: StrictStr @@ -38,6 +39,7 @@ class OrgManager(BaseModel): __properties: ClassVar[List[str]] = [ "createdAt", "guid", + "orgId", "platformId", "projectId", "region", @@ -97,6 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "createdAt": obj.get("createdAt"), "guid": obj.get("guid"), + "orgId": obj.get("orgId"), "platformId": obj.get("platformId"), "projectId": obj.get("projectId"), "region": obj.get("region"), diff --git a/services/scf/src/stackit/scf/models/organization_create_bff_response.py b/services/scf/src/stackit/scf/models/organization_create_bff_response.py new file mode 100644 index 000000000..5fbda13e9 --- /dev/null +++ b/services/scf/src/stackit/scf/models/organization_create_bff_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + STACKIT Cloud Foundry API + + API endpoints for managing STACKIT Cloud Foundry + + The version of the OpenAPI document: 1.0.0 + Contact: support@stackit.cloud + 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 +from typing_extensions import Self + +from stackit.scf.models.org_role_response import OrgRoleResponse +from stackit.scf.models.organization_create_response import OrganizationCreateResponse + + +class OrganizationCreateBffResponse(BaseModel): + """ + OrganizationCreateBffResponse + """ # noqa: E501 + + org: OrganizationCreateResponse + roles: Dict[str, OrgRoleResponse] + __properties: ClassVar[List[str]] = ["org", "roles"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrganizationCreateBffResponse 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 org + if self.org: + _dict["org"] = self.org.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in roles (dict) + _field_dict = {} + if self.roles: + for _key in self.roles: + if self.roles[_key]: + _field_dict[_key] = self.roles[_key].to_dict() + _dict["roles"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationCreateBffResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "org": OrganizationCreateResponse.from_dict(obj["org"]) if obj.get("org") is not None else None, + "roles": ( + dict((_k, OrgRoleResponse.from_dict(_v)) for _k, _v in obj["roles"].items()) + if obj.get("roles") is not None + else None + ), + } + ) + return _obj diff --git a/services/scf/src/stackit/scf/models/space_created_bff_response.py b/services/scf/src/stackit/scf/models/space_created_bff_response.py new file mode 100644 index 000000000..f1d668ff8 --- /dev/null +++ b/services/scf/src/stackit/scf/models/space_created_bff_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + STACKIT Cloud Foundry API + + API endpoints for managing STACKIT Cloud Foundry + + The version of the OpenAPI document: 1.0.0 + Contact: support@stackit.cloud + 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 typing_extensions import Self + +from stackit.scf.models.org_role_response import OrgRoleResponse +from stackit.scf.models.space import Space +from stackit.scf.models.space_role_create_response import SpaceRoleCreateResponse + + +class SpaceCreatedBffResponse(BaseModel): + """ + SpaceCreatedBffResponse + """ # noqa: E501 + + org_role: Optional[OrgRoleResponse] = Field(default=None, alias="orgRole") + space: Space + space_role: SpaceRoleCreateResponse = Field(alias="spaceRole") + __properties: ClassVar[List[str]] = ["orgRole", "space", "spaceRole"] + + model_config = ConfigDict( + populate_by_name=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""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpaceCreatedBffResponse 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 org_role + if self.org_role: + _dict["orgRole"] = self.org_role.to_dict() + # override the default output from pydantic by calling `to_dict()` of space + if self.space: + _dict["space"] = self.space.to_dict() + # override the default output from pydantic by calling `to_dict()` of space_role + if self.space_role: + _dict["spaceRole"] = self.space_role.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpaceCreatedBffResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "orgRole": OrgRoleResponse.from_dict(obj["orgRole"]) if obj.get("orgRole") is not None else None, + "space": Space.from_dict(obj["space"]) if obj.get("space") is not None else None, + "spaceRole": ( + SpaceRoleCreateResponse.from_dict(obj["spaceRole"]) if obj.get("spaceRole") is not None else None + ), + } + ) + return _obj From e4545468f4c52932e9644630ef0a977d8fc827db Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Mon, 4 Aug 2025 09:42:46 +0200 Subject: [PATCH 2/3] update CHANGELOG.md and version in pyproject.toml --- CHANGELOG.md | 8 ++++++-- services/scf/CHANGELOG.md | 4 ++++ services/scf/pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dac8835e..f6a5284b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ ## Release (2025-XX-YY) -- `scf`: [v0.1.0](services/scf/CHANGELOG.md#v010) - - **New:** STACKIT Cloud Foundry module +- `scf`: + - [v0.2.0](services/scf/CHANGELOG.md#v020) + - **Feature:** Add field `OrgId` in model `OrgManager` + - **Feature:** Add ned model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` + - [v0.1.0](services/scf/CHANGELOG.md#v010) + - **New:** STACKIT Cloud Foundry module - `alb`: [v0.5.0](services/alb/CHANGELOG.md#v050) - **Version**: Minimal version is now python 3.9 - `authorization`: [v0.3.0](services/authorization/CHANGELOG.md#v030) diff --git a/services/scf/CHANGELOG.md b/services/scf/CHANGELOG.md index e8670bf7f..0f10bb461 100644 --- a/services/scf/CHANGELOG.md +++ b/services/scf/CHANGELOG.md @@ -1,2 +1,6 @@ +## v0.2.0 +- **Feature:** Add field `OrgId` in model `OrgManager` +- **Feature:** Add ned model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` + ## v0.1.0 - **New:** STACKIT Cloud Foundry module \ No newline at end of file diff --git a/services/scf/pyproject.toml b/services/scf/pyproject.toml index 309407804..a9215e06c 100644 --- a/services/scf/pyproject.toml +++ b/services/scf/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-scf" [tool.poetry] name = "stackit-scf" -version = "v0.1.0" +version = "v0.2.0" authors = [ "STACKIT Developer Tools ", ] From c3e2d685fd4128e3ef58022f962a3e5592984939 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Mon, 4 Aug 2025 09:59:08 +0200 Subject: [PATCH 3/3] fix typo --- CHANGELOG.md | 2 +- services/scf/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a5284b7..636f79099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ - `scf`: - [v0.2.0](services/scf/CHANGELOG.md#v020) - **Feature:** Add field `OrgId` in model `OrgManager` - - **Feature:** Add ned model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` + - **Feature:** Add new model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` - [v0.1.0](services/scf/CHANGELOG.md#v010) - **New:** STACKIT Cloud Foundry module - `alb`: [v0.5.0](services/alb/CHANGELOG.md#v050) diff --git a/services/scf/CHANGELOG.md b/services/scf/CHANGELOG.md index 0f10bb461..e4ee50462 100644 --- a/services/scf/CHANGELOG.md +++ b/services/scf/CHANGELOG.md @@ -1,6 +1,6 @@ ## v0.2.0 - **Feature:** Add field `OrgId` in model `OrgManager` -- **Feature:** Add ned model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` +- **Feature:** Add new model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` ## v0.1.0 - **New:** STACKIT Cloud Foundry module \ No newline at end of file