Skip to content

Commit fcbb2d4

Browse files
stackit-pipelinebahkauv70
authored andcommitted
Generate mongodbflex
1 parent 00ef318 commit fcbb2d4

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

services/mongodbflex/src/stackit/mongodbflex/configuration.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# coding: utf-8
22

3+
import sys
4+
5+
import os
6+
7+
38
"""
49
STACKIT MongoDB Service API
510
@@ -12,8 +17,6 @@
1217
Do not edit the class manually.
1318
""" # noqa: E501 docstring might be too long
1419

15-
import os
16-
1720

1821
class HostConfiguration:
1922
def __init__(
@@ -30,6 +33,7 @@ def __init__(
3033
"as a function argument instead of being set in the client configuration.\n"
3134
"Once all services have migrated, the methods to specify the region in the client configuration "
3235
"will be removed.",
36+
file=sys.stderr,
3337
)
3438
"""Constructor
3539
"""

services/mongodbflex/src/stackit/mongodbflex/models/instance.py

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

21-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
2222
from typing_extensions import Self
2323

2424
from stackit.mongodbflex.models.acl import ACL
@@ -38,7 +38,7 @@ class Instance(BaseModel):
3838
name: Optional[StrictStr] = None
3939
options: Optional[Dict[str, StrictStr]] = None
4040
replicas: Optional[StrictInt] = None
41-
status: Optional[StrictStr] = None
41+
status: Optional[StrictStr] = Field(default=None, description="The current status of the instance.")
4242
storage: Optional[Storage] = None
4343
version: Optional[StrictStr] = None
4444
__properties: ClassVar[List[str]] = [
@@ -54,6 +54,16 @@ class Instance(BaseModel):
5454
"version",
5555
]
5656

57+
@field_validator("status")
58+
def status_validate_enum(cls, value):
59+
"""Validates the enum"""
60+
if value is None:
61+
return value
62+
63+
if value not in set(["READY", "PENDING", "PROCESSING", "FAILED", "UNKNOWN"]):
64+
raise ValueError("must be one of enum values ('READY', 'PENDING', 'PROCESSING', 'FAILED', 'UNKNOWN')")
65+
return value
66+
5767
model_config = ConfigDict(
5868
populate_by_name=True,
5969
validate_assignment=True,

services/mongodbflex/src/stackit/mongodbflex/models/instance_list_instance.py

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

21-
from pydantic import BaseModel, ConfigDict, StrictStr
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2222
from typing_extensions import Self
2323

2424

@@ -29,9 +29,19 @@ class InstanceListInstance(BaseModel):
2929

3030
id: Optional[StrictStr] = None
3131
name: Optional[StrictStr] = None
32-
status: Optional[StrictStr] = None
32+
status: Optional[StrictStr] = Field(default=None, description="The current status of the instance.")
3333
__properties: ClassVar[List[str]] = ["id", "name", "status"]
3434

35+
@field_validator("status")
36+
def status_validate_enum(cls, value):
37+
"""Validates the enum"""
38+
if value is None:
39+
return value
40+
41+
if value not in set(["READY", "PENDING", "PROCESSING", "FAILED", "UNKNOWN"]):
42+
raise ValueError("must be one of enum values ('READY', 'PENDING', 'PROCESSING', 'FAILED', 'UNKNOWN')")
43+
return value
44+
3545
model_config = ConfigDict(
3646
populate_by_name=True,
3747
validate_assignment=True,

0 commit comments

Comments
 (0)