1818import pprint
1919from 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
2222from typing_extensions import Self
2323
2424from 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 ,
0 commit comments