From f7efe2ac1deb9a0bd5831669553c925f2b8d9eaa Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 3 Sep 2026 08:11:13 +0000 Subject: [PATCH 1/2] Generate postgresflex --- services/postgresflex/oas_commit | 2 +- .../models/create_database_payload.py | 19 ++++++++++++--- .../postgresflex/models/database_roles.py | 19 ++++++++++++--- .../models/get_database_response.py | 19 ++++++++++++--- .../models/instance_network_access_scope.py | 2 +- .../postgresflex/models/list_database.py | 19 ++++++++++++--- .../models/partial_update_database_payload.py | 23 ++++++++++++++++--- .../models/update_database_payload.py | 19 ++++++++++++--- 8 files changed, 102 insertions(+), 20 deletions(-) diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index e05d493f3..3df2932d2 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -da4701b7dbe20e984aef89711bb9ba716e19fcba +1fdef398bea59d49731a7d9ac39394ba5b6bb72c diff --git a/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py b/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py index 4229b1b9b..7ab4b83d3 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py @@ -16,11 +16,12 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class CreateDatabasePayload(BaseModel): @@ -28,10 +29,22 @@ class CreateDatabasePayload(BaseModel): CreateDatabasePayload """ # noqa: E501 - name: StrictStr = Field(description="The name of the database.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field( + description='"The name of the database." "Database name must be 1–63 characters long, start with a lowercase letter or underscore, and contain only lowercase letters, numbers, or underscores." ' + ) owner: Optional[StrictStr] = Field(default=None, description="The owner of the database.") __properties: ClassVar[List[str]] = ["name", "owner"] + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z_][a-z0-9_]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, diff --git a/services/postgresflex/src/stackit/postgresflex/models/database_roles.py b/services/postgresflex/src/stackit/postgresflex/models/database_roles.py index a3398b631..549900d90 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/database_roles.py +++ b/services/postgresflex/src/stackit/postgresflex/models/database_roles.py @@ -16,11 +16,12 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class DatabaseRoles(BaseModel): @@ -28,10 +29,22 @@ class DatabaseRoles(BaseModel): The name and the roles for a database for a user. """ # noqa: E501 - name: StrictStr = Field(description="The name of the database.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field( + description='"The name of the database." "Database name must be 1–63 characters long, start with a lowercase letter or underscore, and contain only lowercase letters, numbers, or underscores." ' + ) roles: List[StrictStr] = Field(description="The name and the roles for a database") __properties: ClassVar[List[str]] = ["name", "roles"] + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z_][a-z0-9_]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, diff --git a/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py b/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py index 7e04ec741..9a3dbac2f 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py @@ -16,11 +16,12 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class GetDatabaseResponse(BaseModel): @@ -29,10 +30,22 @@ class GetDatabaseResponse(BaseModel): """ # noqa: E501 id: StrictInt = Field(description="The id of the database.") - name: StrictStr = Field(description="The name of the database.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field( + description='"The name of the database." "Database name must be 1–63 characters long, start with a lowercase letter or underscore, and contain only lowercase letters, numbers, or underscores." ' + ) owner: StrictStr = Field(description="The owner of the database.") __properties: ClassVar[List[str]] = ["id", "name", "owner"] + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z_][a-z0-9_]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py b/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py index 5e28a9cd1..f8a956a89 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py @@ -22,7 +22,7 @@ class InstanceNetworkAccessScope(str, Enum): """ - The access scope of the instance. It defines if the instance is public or airgapped. + The access scope of the instance. It defines if the instance is public or airgapped. ⚠️ **Note:** \"SNA\" value for the \"network.accessScope\" field is only permitted for enabled accounts. If your account does not have access, the request will be rejected. """ """ diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_database.py b/services/postgresflex/src/stackit/postgresflex/models/list_database.py index d6224ae3d..e52794197 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_database.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_database.py @@ -16,11 +16,12 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class ListDatabase(BaseModel): @@ -29,10 +30,22 @@ class ListDatabase(BaseModel): """ # noqa: E501 id: StrictInt = Field(description="The id of the database.") - name: StrictStr = Field(description="The name of the database.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field( + description='"The name of the database." "Database name must be 1–63 characters long, start with a lowercase letter or underscore, and contain only lowercase letters, numbers, or underscores." ' + ) owner: StrictStr = Field(description="The owner of the database.") __properties: ClassVar[List[str]] = ["id", "name", "owner"] + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z_][a-z0-9_]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, diff --git a/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py b/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py index 84077dd5d..b04d0aa64 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py @@ -16,11 +16,12 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class PartialUpdateDatabasePayload(BaseModel): @@ -28,10 +29,26 @@ class PartialUpdateDatabasePayload(BaseModel): PartialUpdateDatabasePayload """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="The name of the database.") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = Field( + default=None, + description='"The name of the database." "Database name must be 1–63 characters long, start with a lowercase letter or underscore, and contain only lowercase letters, numbers, or underscores." ', + ) owner: Optional[StrictStr] = Field(default=None, description="The owner of the database.") __properties: ClassVar[List[str]] = ["name", "owner"] + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z_][a-z0-9_]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, diff --git a/services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py b/services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py index f0dd46873..cb662b742 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py @@ -16,11 +16,12 @@ import json import pprint +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class UpdateDatabasePayload(BaseModel): @@ -28,10 +29,22 @@ class UpdateDatabasePayload(BaseModel): UpdateDatabasePayload """ # noqa: E501 - name: StrictStr = Field(description="The name of the database.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field( + description='"The name of the database." "Database name must be 1–63 characters long, start with a lowercase letter or underscore, and contain only lowercase letters, numbers, or underscores." ' + ) owner: StrictStr = Field(description="The owner of the database.") __properties: ClassVar[List[str]] = ["name", "owner"] + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z_][a-z0-9_]*$", value): + raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/") + return value + model_config = ConfigDict( validate_by_name=True, validate_by_alias=True, From 319a598003bb2f3bc7255fba36ef77ed498a631d Mon Sep 17 00:00:00 2001 From: Alexander Dahmen Date: Thu, 3 Sep 2026 13:44:36 +0200 Subject: [PATCH 2/2] chore(postgresflex): Add changelog Signed-off-by: Alexander Dahmen --- CHANGELOG.md | 3 +++ services/postgresflex/CHANGELOG.md | 4 ++++ services/postgresflex/pyproject.toml | 2 +- services/postgresflex/uv.lock | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a4e32a1..c338f7446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ - **Breaking Change/Fix:** `create_backup` operation now returns `CreateBackupResponseItem` instead of `List[CreateBackupResponseItem]` The return type now correctly models the actual JSON response, this operation was broken beforehand. - `postgresflex`: + - [v1.6.1](services/postgresflex/CHANGELOG.md#v161) + - **Improvement:** Add validation for `name` field in `CreateDatabasePayload`, `DatabaseRoles`, `GetDatabaseResponse`, `ListDatabase`, `PartialUpdateDatabasePayload` and `UpdateDatabasePayload` models + - **Docs:** Extend description of `InstanceNetworkAccessScope` enum to note that the `SNA` value is only permitted for enabled accounts - [v1.6.0](services/postgresflex/CHANGELOG.md#v160) - **Breaking Change:** `class` attribute in `CloneInstanceOverrides` and `StorageCreate` model is now required (previously optional) - `rabbitmq`: diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 624a5c0eb..121fba8b9 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.6.1 +- **Improvement:** Add validation for `name` field in `CreateDatabasePayload`, `DatabaseRoles`, `GetDatabaseResponse`, `ListDatabase`, `PartialUpdateDatabasePayload` and `UpdateDatabasePayload` models +- **Docs:** Extend description of `InstanceNetworkAccessScope` enum to note that the `SNA` value is only permitted for enabled accounts + ## v1.6.0 - **Breaking Change:** `class` attribute in `CloneInstanceOverrides` and `StorageCreate` model is now required (previously optional) diff --git a/services/postgresflex/pyproject.toml b/services/postgresflex/pyproject.toml index e413f20b5..5c92b2d4d 100644 --- a/services/postgresflex/pyproject.toml +++ b/services/postgresflex/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stackit-postgresflex" -version = "v1.6.0" +version = "v1.6.1" description = "STACKIT PostgreSQL Flex API" authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }] requires-python = ">=3.10,<4.0" diff --git a/services/postgresflex/uv.lock b/services/postgresflex/uv.lock index 211f5109e..35843e35f 100644 --- a/services/postgresflex/uv.lock +++ b/services/postgresflex/uv.lock @@ -1057,7 +1057,7 @@ dev = [ [[package]] name = "stackit-postgresflex" -version = "1.6.0" +version = "1.6.1" source = { editable = "." } dependencies = [ { name = "pydantic" },