-
Notifications
You must be signed in to change notification settings - Fork 2
Generator: Update SDK /services/scf #2112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| ## v0.2.0 | ||
| - **Feature:** Add field `OrgId` in model `OrgManager` | ||
| - **Feature:** Add ned model `OrganizationCreateBffResponse` and `SpaceCreatedBffResponse` | ||
marceljk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## v0.1.0 | ||
| - **New:** STACKIT Cloud Foundry module | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ name = "stackit-scf" | |
|
|
||
| [tool.poetry] | ||
| name = "stackit-scf" | ||
| version = "v0.1.0" | ||
| version = "v0.2.0" | ||
| authors = [ | ||
| "STACKIT Developer Tools <[email protected]>", | ||
| ] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
services/scf/src/stackit/scf/models/organization_create_bff_response.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: [email protected] | ||
| 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 |
105 changes: 105 additions & 0 deletions
105
services/scf/src/stackit/scf/models/space_created_bff_response.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: [email protected] | ||
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.