Skip to content

Commit f7efe2a

Browse files
Generate postgresflex
1 parent e7d5564 commit f7efe2a

8 files changed

Lines changed: 102 additions & 20 deletions

File tree

services/postgresflex/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
da4701b7dbe20e984aef89711bb9ba716e19fcba
1+
1fdef398bea59d49731a7d9ac39394ba5b6bb72c

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,35 @@
1616

1717
import json
1818
import pprint
19+
import re # noqa: F401
1920
from typing import Any, ClassVar, Dict, List, Optional, Set
2021

21-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2223
from pydantic_core import to_jsonable_python
23-
from typing_extensions import Self
24+
from typing_extensions import Annotated, Self
2425

2526

2627
class CreateDatabasePayload(BaseModel):
2728
"""
2829
CreateDatabasePayload
2930
""" # noqa: E501
3031

31-
name: StrictStr = Field(description="The name of the database.")
32+
name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field(
33+
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." '
34+
)
3235
owner: Optional[StrictStr] = Field(default=None, description="The owner of the database.")
3336
__properties: ClassVar[List[str]] = ["name", "owner"]
3437

38+
@field_validator("name")
39+
def name_validate_regular_expression(cls, value):
40+
"""Validates the regular expression"""
41+
if not isinstance(value, str):
42+
value = str(value)
43+
44+
if not re.match(r"^[a-z_][a-z0-9_]*$", value):
45+
raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/")
46+
return value
47+
3548
model_config = ConfigDict(
3649
validate_by_name=True,
3750
validate_by_alias=True,

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,35 @@
1616

1717
import json
1818
import pprint
19+
import re # noqa: F401
1920
from typing import Any, ClassVar, Dict, List, Optional, Set
2021

21-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2223
from pydantic_core import to_jsonable_python
23-
from typing_extensions import Self
24+
from typing_extensions import Annotated, Self
2425

2526

2627
class DatabaseRoles(BaseModel):
2728
"""
2829
The name and the roles for a database for a user.
2930
""" # noqa: E501
3031

31-
name: StrictStr = Field(description="The name of the database.")
32+
name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field(
33+
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." '
34+
)
3235
roles: List[StrictStr] = Field(description="The name and the roles for a database")
3336
__properties: ClassVar[List[str]] = ["name", "roles"]
3437

38+
@field_validator("name")
39+
def name_validate_regular_expression(cls, value):
40+
"""Validates the regular expression"""
41+
if not isinstance(value, str):
42+
value = str(value)
43+
44+
if not re.match(r"^[a-z_][a-z0-9_]*$", value):
45+
raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/")
46+
return value
47+
3548
model_config = ConfigDict(
3649
validate_by_name=True,
3750
validate_by_alias=True,

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616

1717
import json
1818
import pprint
19+
import re # noqa: F401
1920
from typing import Any, ClassVar, Dict, List, Optional, Set
2021

21-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
2223
from pydantic_core import to_jsonable_python
23-
from typing_extensions import Self
24+
from typing_extensions import Annotated, Self
2425

2526

2627
class GetDatabaseResponse(BaseModel):
@@ -29,10 +30,22 @@ class GetDatabaseResponse(BaseModel):
2930
""" # noqa: E501
3031

3132
id: StrictInt = Field(description="The id of the database.")
32-
name: StrictStr = Field(description="The name of the database.")
33+
name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field(
34+
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." '
35+
)
3336
owner: StrictStr = Field(description="The owner of the database.")
3437
__properties: ClassVar[List[str]] = ["id", "name", "owner"]
3538

39+
@field_validator("name")
40+
def name_validate_regular_expression(cls, value):
41+
"""Validates the regular expression"""
42+
if not isinstance(value, str):
43+
value = str(value)
44+
45+
if not re.match(r"^[a-z_][a-z0-9_]*$", value):
46+
raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/")
47+
return value
48+
3649
model_config = ConfigDict(
3750
validate_by_name=True,
3851
validate_by_alias=True,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class InstanceNetworkAccessScope(str, Enum):
2424
"""
25-
The access scope of the instance. It defines if the instance is public or airgapped.
25+
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.
2626
"""
2727

2828
"""

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616

1717
import json
1818
import pprint
19+
import re # noqa: F401
1920
from typing import Any, ClassVar, Dict, List, Optional, Set
2021

21-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
2223
from pydantic_core import to_jsonable_python
23-
from typing_extensions import Self
24+
from typing_extensions import Annotated, Self
2425

2526

2627
class ListDatabase(BaseModel):
@@ -29,10 +30,22 @@ class ListDatabase(BaseModel):
2930
""" # noqa: E501
3031

3132
id: StrictInt = Field(description="The id of the database.")
32-
name: StrictStr = Field(description="The name of the database.")
33+
name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field(
34+
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." '
35+
)
3336
owner: StrictStr = Field(description="The owner of the database.")
3437
__properties: ClassVar[List[str]] = ["id", "name", "owner"]
3538

39+
@field_validator("name")
40+
def name_validate_regular_expression(cls, value):
41+
"""Validates the regular expression"""
42+
if not isinstance(value, str):
43+
value = str(value)
44+
45+
if not re.match(r"^[a-z_][a-z0-9_]*$", value):
46+
raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/")
47+
return value
48+
3649
model_config = ConfigDict(
3750
validate_by_name=True,
3851
validate_by_alias=True,

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,39 @@
1616

1717
import json
1818
import pprint
19+
import re # noqa: F401
1920
from typing import Any, ClassVar, Dict, List, Optional, Set
2021

21-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2223
from pydantic_core import to_jsonable_python
23-
from typing_extensions import Self
24+
from typing_extensions import Annotated, Self
2425

2526

2627
class PartialUpdateDatabasePayload(BaseModel):
2728
"""
2829
PartialUpdateDatabasePayload
2930
""" # noqa: E501
3031

31-
name: Optional[StrictStr] = Field(default=None, description="The name of the database.")
32+
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = Field(
33+
default=None,
34+
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." ',
35+
)
3236
owner: Optional[StrictStr] = Field(default=None, description="The owner of the database.")
3337
__properties: ClassVar[List[str]] = ["name", "owner"]
3438

39+
@field_validator("name")
40+
def name_validate_regular_expression(cls, value):
41+
"""Validates the regular expression"""
42+
if value is None:
43+
return value
44+
45+
if not isinstance(value, str):
46+
value = str(value)
47+
48+
if not re.match(r"^[a-z_][a-z0-9_]*$", value):
49+
raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/")
50+
return value
51+
3552
model_config = ConfigDict(
3653
validate_by_name=True,
3754
validate_by_alias=True,

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,35 @@
1616

1717
import json
1818
import pprint
19+
import re # noqa: F401
1920
from typing import Any, ClassVar, Dict, List, Optional, Set
2021

21-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2223
from pydantic_core import to_jsonable_python
23-
from typing_extensions import Self
24+
from typing_extensions import Annotated, Self
2425

2526

2627
class UpdateDatabasePayload(BaseModel):
2728
"""
2829
UpdateDatabasePayload
2930
""" # noqa: E501
3031

31-
name: StrictStr = Field(description="The name of the database.")
32+
name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field(
33+
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." '
34+
)
3235
owner: StrictStr = Field(description="The owner of the database.")
3336
__properties: ClassVar[List[str]] = ["name", "owner"]
3437

38+
@field_validator("name")
39+
def name_validate_regular_expression(cls, value):
40+
"""Validates the regular expression"""
41+
if not isinstance(value, str):
42+
value = str(value)
43+
44+
if not re.match(r"^[a-z_][a-z0-9_]*$", value):
45+
raise ValueError(r"must validate the regular expression /^[a-z_][a-z0-9_]*$/")
46+
return value
47+
3548
model_config = ConfigDict(
3649
validate_by_name=True,
3750
validate_by_alias=True,

0 commit comments

Comments
 (0)