@@ -34,7 +34,8 @@ class ImageInAPI(BaseModel):
3434 upload_url : Optional [Any ] = Field (None , description = "Ссылка для загрузки образа." )
3535 location : Location = Field (...)
3636 os : OS = Field (...)
37- __properties = ["name" , "description" , "disk_id" , "upload_url" , "location" , "os" ]
37+ hostname : Optional [Any ] = Field (None , description = "Сетевое имя сервера" )
38+ __properties = ["name" , "description" , "disk_id" , "upload_url" , "location" , "os" , "hostname" ]
3839
3940 class Config :
4041 """Pydantic configuration"""
@@ -80,6 +81,11 @@ def to_dict(self):
8081 if self .upload_url is None and "upload_url" in self .__fields_set__ :
8182 _dict ['upload_url' ] = None
8283
84+ # set to None if hostname (nullable) is None
85+ # and __fields_set__ contains the field
86+ if self .hostname is None and "hostname" in self .__fields_set__ :
87+ _dict ['hostname' ] = None
88+
8389 return _dict
8490
8591 @classmethod
@@ -97,7 +103,8 @@ def from_dict(cls, obj: dict) -> ImageInAPI:
97103 "disk_id" : obj .get ("disk_id" ),
98104 "upload_url" : obj .get ("upload_url" ),
99105 "location" : obj .get ("location" ),
100- "os" : obj .get ("os" )
106+ "os" : obj .get ("os" ),
107+ "hostname" : obj .get ("hostname" )
101108 })
102109 return _obj
103110
0 commit comments