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
Expand Up @@ -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`:
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.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)

Expand Down
2 changes: 1 addition & 1 deletion services/postgresflex/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
da4701b7dbe20e984aef89711bb9ba716e19fcba
1fdef398bea59d49731a7d9ac39394ba5b6bb72c
2 changes: 1 addition & 1 deletion services/postgresflex/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,35 @@

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):
"""
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,35 @@

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):
"""
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,39 @@

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):
"""
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,35 @@

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):
"""
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,
Expand Down
2 changes: 1 addition & 1 deletion services/postgresflex/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading