2121
2222from typing import Any , Optional
2323from pydantic import BaseModel , Field
24+ from timeweb_cloud_api .models .cluster_edit_oidc_provider import ClusterEditOidcProvider
2425
2526class ClusterEdit (BaseModel ):
2627 """
2728 ClusterEdit
2829 """
30+ name : Optional [Any ] = Field (None , description = "Новое название кластера" )
2931 description : Optional [Any ] = Field (None , description = "Новое описание кластера" )
30- __properties = ["description" ]
32+ oidc_provider : Optional [ClusterEditOidcProvider ] = None
33+ __properties = ["name" , "description" , "oidc_provider" ]
3134
3235 class Config :
3336 """Pydantic configuration"""
@@ -53,6 +56,14 @@ def to_dict(self):
5356 exclude = {
5457 },
5558 exclude_none = True )
59+ # override the default output from pydantic by calling `to_dict()` of oidc_provider
60+ if self .oidc_provider :
61+ _dict ['oidc_provider' ] = self .oidc_provider .to_dict ()
62+ # set to None if name (nullable) is None
63+ # and __fields_set__ contains the field
64+ if self .name is None and "name" in self .__fields_set__ :
65+ _dict ['name' ] = None
66+
5667 # set to None if description (nullable) is None
5768 # and __fields_set__ contains the field
5869 if self .description is None and "description" in self .__fields_set__ :
@@ -70,7 +81,9 @@ def from_dict(cls, obj: dict) -> ClusterEdit:
7081 return ClusterEdit .parse_obj (obj )
7182
7283 _obj = ClusterEdit .parse_obj ({
73- "description" : obj .get ("description" )
84+ "name" : obj .get ("name" ),
85+ "description" : obj .get ("description" ),
86+ "oidc_provider" : ClusterEditOidcProvider .from_dict (obj .get ("oidc_provider" )) if obj .get ("oidc_provider" ) is not None else None
7487 })
7588 return _obj
7689
0 commit comments