3131)
3232from typing_extensions import Annotated , Self
3333
34+ from stackit .iaasalpha .models .image_checksum import ImageChecksum
3435from stackit .iaasalpha .models .image_config import ImageConfig
3536
3637
@@ -39,6 +40,7 @@ class CreateImagePayload(BaseModel):
3940 Object that represents an Image and its parameters. Used for Creating and returning (get/list).
4041 """
4142
43+ checksum : Optional [ImageChecksum ] = None
4244 config : Optional [ImageConfig ] = None
4345 created_at : Optional [datetime ] = Field (
4446 default = None , description = "Date-time when resource was created." , alias = "createdAt"
@@ -56,11 +58,13 @@ class CreateImagePayload(BaseModel):
5658 description = "The name for a General Object. Matches Names and also UUIDs."
5759 )
5860 protected : Optional [StrictBool ] = None
61+ scope : Optional [StrictStr ] = Field (default = None , description = "Scope of an Image." )
5962 status : Optional [StrictStr ] = Field (default = None , description = "The status of an image object." )
6063 updated_at : Optional [datetime ] = Field (
6164 default = None , description = "Date-time when resource was last updated." , alias = "updatedAt"
6265 )
6366 __properties : ClassVar [List [str ]] = [
67+ "checksum" ,
6468 "config" ,
6569 "createdAt" ,
6670 "diskFormat" ,
@@ -70,6 +74,7 @@ class CreateImagePayload(BaseModel):
7074 "minRam" ,
7175 "name" ,
7276 "protected" ,
77+ "scope" ,
7378 "status" ,
7479 "updatedAt" ,
7580 ]
@@ -126,11 +131,15 @@ def to_dict(self) -> Dict[str, Any]:
126131 * OpenAPI `readOnly` fields are excluded.
127132 * OpenAPI `readOnly` fields are excluded.
128133 * OpenAPI `readOnly` fields are excluded.
134+ * OpenAPI `readOnly` fields are excluded.
135+ * OpenAPI `readOnly` fields are excluded.
129136 """
130137 excluded_fields : Set [str ] = set (
131138 [
139+ "checksum" ,
132140 "created_at" ,
133141 "id" ,
142+ "scope" ,
134143 "status" ,
135144 "updated_at" ,
136145 ]
@@ -141,6 +150,9 @@ def to_dict(self) -> Dict[str, Any]:
141150 exclude = excluded_fields ,
142151 exclude_none = True ,
143152 )
153+ # override the default output from pydantic by calling `to_dict()` of checksum
154+ if self .checksum :
155+ _dict ["checksum" ] = self .checksum .to_dict ()
144156 # override the default output from pydantic by calling `to_dict()` of config
145157 if self .config :
146158 _dict ["config" ] = self .config .to_dict ()
@@ -157,6 +169,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
157169
158170 _obj = cls .model_validate (
159171 {
172+ "checksum" : ImageChecksum .from_dict (obj ["checksum" ]) if obj .get ("checksum" ) is not None else None ,
160173 "config" : ImageConfig .from_dict (obj ["config" ]) if obj .get ("config" ) is not None else None ,
161174 "createdAt" : obj .get ("createdAt" ),
162175 "diskFormat" : obj .get ("diskFormat" ),
@@ -166,6 +179,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
166179 "minRam" : obj .get ("minRam" ),
167180 "name" : obj .get ("name" ),
168181 "protected" : obj .get ("protected" ),
182+ "scope" : obj .get ("scope" ),
169183 "status" : obj .get ("status" ),
170184 "updatedAt" : obj .get ("updatedAt" ),
171185 }
0 commit comments