Skip to content

Commit b4aa19e

Browse files
Generator: Update SDK /services/postgresflex (#2396)
* Generate postgresflex * Add changelog Signed-off-by: Alexander Dahmen <[email protected]> --------- Signed-off-by: Alexander Dahmen <[email protected]> Co-authored-by: Alexander Dahmen <[email protected]>
1 parent ad3d867 commit b4aa19e

File tree

10 files changed

+118
-9
lines changed

10 files changed

+118
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
## Release (2025-xx-xx)
2+
- `postgresflex`: [v1.2.0](services/postgresflex/CHANGELOG.md#v120)
3+
- **Breaking Change:** The attribute type for `PartialUpdateInstancePayload` and `UpdateInstancePayload` changed from `Storage` to `StorageUpdate`.
4+
- **Deprecation:** `StorageUpdate`: updating the performance class field is not possible.
25
- `auditlog`: [v0.1.1](services/auditlog/CHANGELOG.md#v011)
36
- **Bugfix:** Prevent year 0 timestamp issue
47
- `authorization`: [v0.4.1](services/authorization/CHANGELOG.md#v041)

services/postgresflex/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v1.2.0
2+
- **Breaking Change:** The attribute type for `PartialUpdateInstancePayload` and `UpdateInstancePayload` changed from `Storage` to `StorageUpdate`.
3+
- **Deprecation:** `StorageUpdate`: updating the performance class field is not possible.
4+
15
## v1.1.0
26
- **Version**: Minimal version is now python 3.9
37

services/postgresflex/pyproject.toml

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

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

services/postgresflex/src/stackit/postgresflex/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"ResetUserResponse",
7979
"Storage",
8080
"StorageRange",
81+
"StorageUpdate",
8182
"UpdateBackupSchedulePayload",
8283
"UpdateInstancePayload",
8384
"UpdateUserPayload",
@@ -231,6 +232,7 @@
231232
)
232233
from stackit.postgresflex.models.storage import Storage as Storage
233234
from stackit.postgresflex.models.storage_range import StorageRange as StorageRange
235+
from stackit.postgresflex.models.storage_update import StorageUpdate as StorageUpdate
234236
from stackit.postgresflex.models.update_backup_schedule_payload import (
235237
UpdateBackupSchedulePayload as UpdateBackupSchedulePayload,
236238
)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
from stackit.postgresflex.models.reset_user_response import ResetUserResponse
9393
from stackit.postgresflex.models.storage import Storage
9494
from stackit.postgresflex.models.storage_range import StorageRange
95+
from stackit.postgresflex.models.storage_update import StorageUpdate
9596
from stackit.postgresflex.models.update_backup_schedule_payload import (
9697
UpdateBackupSchedulePayload,
9798
)

services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
import pprint
1919
from typing import Any, ClassVar, Dict, List, Optional, Set, Union
2020

21-
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
21+
from pydantic import (
22+
BaseModel,
23+
ConfigDict,
24+
StrictFloat,
25+
StrictInt,
26+
StrictStr,
27+
)
2228
from typing_extensions import Self
2329

2430

services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_payload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from typing_extensions import Self
2323

2424
from stackit.postgresflex.models.acl import ACL
25-
from stackit.postgresflex.models.storage import Storage
25+
from stackit.postgresflex.models.storage_update import StorageUpdate
2626

2727

2828
class PartialUpdateInstancePayload(BaseModel):
@@ -37,7 +37,7 @@ class PartialUpdateInstancePayload(BaseModel):
3737
name: Optional[StrictStr] = None
3838
options: Optional[Dict[str, StrictStr]] = None
3939
replicas: Optional[StrictInt] = None
40-
storage: Optional[Storage] = None
40+
storage: Optional[StorageUpdate] = None
4141
version: Optional[StrictStr] = None
4242
__properties: ClassVar[List[str]] = [
4343
"acl",
@@ -114,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114114
"name": obj.get("name"),
115115
"options": obj.get("options"),
116116
"replicas": obj.get("replicas"),
117-
"storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
117+
"storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
118118
"version": obj.get("version"),
119119
}
120120
)

services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
import pprint
1919
from typing import Any, ClassVar, Dict, List, Optional, Set
2020

21-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21+
from pydantic import (
22+
BaseModel,
23+
ConfigDict,
24+
Field,
25+
StrictBool,
26+
StrictStr,
27+
)
2228
from typing_extensions import Self
2329

2430

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT PostgreSQL Flex API
5+
6+
This is the documentation for the STACKIT postgres service
7+
8+
The version of the OpenAPI document: 2.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, StrictInt, StrictStr
22+
from typing_extensions import Self
23+
24+
25+
class StorageUpdate(BaseModel):
26+
"""
27+
StorageUpdate
28+
""" # noqa: E501
29+
30+
var_class: Optional[StrictStr] = Field(
31+
default=None,
32+
description=" ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. ",
33+
alias="class",
34+
)
35+
size: Optional[StrictInt] = None
36+
__properties: ClassVar[List[str]] = ["class", "size"]
37+
38+
model_config = ConfigDict(
39+
populate_by_name=True,
40+
validate_assignment=True,
41+
protected_namespaces=(),
42+
)
43+
44+
def to_str(self) -> str:
45+
"""Returns the string representation of the model using alias"""
46+
return pprint.pformat(self.model_dump(by_alias=True))
47+
48+
def to_json(self) -> str:
49+
"""Returns the JSON representation of the model using alias"""
50+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51+
return json.dumps(self.to_dict())
52+
53+
@classmethod
54+
def from_json(cls, json_str: str) -> Optional[Self]:
55+
"""Create an instance of StorageUpdate from a JSON string"""
56+
return cls.from_dict(json.loads(json_str))
57+
58+
def to_dict(self) -> Dict[str, Any]:
59+
"""Return the dictionary representation of the model using alias.
60+
61+
This has the following differences from calling pydantic's
62+
`self.model_dump(by_alias=True)`:
63+
64+
* `None` is only added to the output dict for nullable fields that
65+
were set at model initialization. Other fields with value `None`
66+
are ignored.
67+
"""
68+
excluded_fields: Set[str] = set([])
69+
70+
_dict = self.model_dump(
71+
by_alias=True,
72+
exclude=excluded_fields,
73+
exclude_none=True,
74+
)
75+
return _dict
76+
77+
@classmethod
78+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79+
"""Create an instance of StorageUpdate from a dict"""
80+
if obj is None:
81+
return None
82+
83+
if not isinstance(obj, dict):
84+
return cls.model_validate(obj)
85+
86+
_obj = cls.model_validate({"class": obj.get("class"), "size": obj.get("size")})
87+
return _obj

services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from typing_extensions import Self
2323

2424
from stackit.postgresflex.models.acl import ACL
25-
from stackit.postgresflex.models.storage import Storage
25+
from stackit.postgresflex.models.storage_update import StorageUpdate
2626

2727

2828
class UpdateInstancePayload(BaseModel):
@@ -37,7 +37,7 @@ class UpdateInstancePayload(BaseModel):
3737
name: Optional[StrictStr] = None
3838
options: Optional[Dict[str, StrictStr]] = None
3939
replicas: Optional[StrictInt] = None
40-
storage: Optional[Storage] = None
40+
storage: Optional[StorageUpdate] = None
4141
version: Optional[StrictStr] = None
4242
__properties: ClassVar[List[str]] = [
4343
"acl",
@@ -114,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114114
"name": obj.get("name"),
115115
"options": obj.get("options"),
116116
"replicas": obj.get("replicas"),
117-
"storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
117+
"storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
118118
"version": obj.get("version"),
119119
}
120120
)

0 commit comments

Comments
 (0)