Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Release (2025-xx-xx)
- `postgresflex`: [v1.2.0](services/postgresflex/CHANGELOG.md#v120)
- **Breaking Change:** The attribute type for `PartialUpdateInstancePayload` and `UpdateInstancePayload` changed from `Storage` to `StorageUpdate`.
- **Deprecation:** `StorageUpdate`: updating the performance class field is not possible.
- `auditlog`: [v0.1.1](services/auditlog/CHANGELOG.md#v011)
- **Bugfix:** Prevent year 0 timestamp issue
- `authorization`: [v0.4.1](services/authorization/CHANGELOG.md#v041)
Expand Down
4 changes: 4 additions & 0 deletions services/postgresflex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.2.0
- **Breaking Change:** The attribute type for `PartialUpdateInstancePayload` and `UpdateInstancePayload` changed from `Storage` to `StorageUpdate`.
- **Deprecation:** `StorageUpdate`: updating the performance class field is not possible.

## v1.1.0
- **Version**: Minimal version is now python 3.9

Expand Down
2 changes: 1 addition & 1 deletion services/postgresflex/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "stackit-postgresflex"

[tool.poetry]
name = "stackit-postgresflex"
version = "v1.1.0"
version = "v1.2.0"
authors = [
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
]
Expand Down
2 changes: 2 additions & 0 deletions services/postgresflex/src/stackit/postgresflex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"ResetUserResponse",
"Storage",
"StorageRange",
"StorageUpdate",
"UpdateBackupSchedulePayload",
"UpdateInstancePayload",
"UpdateUserPayload",
Expand Down Expand Up @@ -231,6 +232,7 @@
)
from stackit.postgresflex.models.storage import Storage as Storage
from stackit.postgresflex.models.storage_range import StorageRange as StorageRange
from stackit.postgresflex.models.storage_update import StorageUpdate as StorageUpdate
from stackit.postgresflex.models.update_backup_schedule_payload import (
UpdateBackupSchedulePayload as UpdateBackupSchedulePayload,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
from stackit.postgresflex.models.reset_user_response import ResetUserResponse
from stackit.postgresflex.models.storage import Storage
from stackit.postgresflex.models.storage_range import StorageRange
from stackit.postgresflex.models.storage_update import StorageUpdate
from stackit.postgresflex.models.update_backup_schedule_payload import (
UpdateBackupSchedulePayload,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set, Union

from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
from pydantic import (
BaseModel,
ConfigDict,
StrictFloat,
StrictInt,
StrictStr,
)
from typing_extensions import Self


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing_extensions import Self

from stackit.postgresflex.models.acl import ACL
from stackit.postgresflex.models.storage import Storage
from stackit.postgresflex.models.storage_update import StorageUpdate


class PartialUpdateInstancePayload(BaseModel):
Expand All @@ -37,7 +37,7 @@ class PartialUpdateInstancePayload(BaseModel):
name: Optional[StrictStr] = None
options: Optional[Dict[str, StrictStr]] = None
replicas: Optional[StrictInt] = None
storage: Optional[Storage] = None
storage: Optional[StorageUpdate] = None
version: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = [
"acl",
Expand Down Expand Up @@ -114,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"name": obj.get("name"),
"options": obj.get("options"),
"replicas": obj.get("replicas"),
"storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
"storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
"version": obj.get("version"),
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import (
BaseModel,
ConfigDict,
Field,
StrictBool,
StrictStr,
)
from typing_extensions import Self


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# coding: utf-8

"""
STACKIT PostgreSQL Flex API

This is the documentation for the STACKIT postgres service

The version of the OpenAPI document: 2.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, StrictInt, StrictStr
from typing_extensions import Self


class StorageUpdate(BaseModel):
"""
StorageUpdate
""" # noqa: E501

var_class: Optional[StrictStr] = Field(
default=None,
description=" ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. ",
alias="class",
)
size: Optional[StrictInt] = None
__properties: ClassVar[List[str]] = ["class", "size"]

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 StorageUpdate 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,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of StorageUpdate from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"class": obj.get("class"), "size": obj.get("size")})
return _obj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing_extensions import Self

from stackit.postgresflex.models.acl import ACL
from stackit.postgresflex.models.storage import Storage
from stackit.postgresflex.models.storage_update import StorageUpdate


class UpdateInstancePayload(BaseModel):
Expand All @@ -37,7 +37,7 @@ class UpdateInstancePayload(BaseModel):
name: Optional[StrictStr] = None
options: Optional[Dict[str, StrictStr]] = None
replicas: Optional[StrictInt] = None
storage: Optional[Storage] = None
storage: Optional[StorageUpdate] = None
version: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = [
"acl",
Expand Down Expand Up @@ -114,7 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"name": obj.get("name"),
"options": obj.get("options"),
"replicas": obj.get("replicas"),
"storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
"storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
"version": obj.get("version"),
}
)
Expand Down