1818import re # noqa: F401
1919import json
2020
21- from pydantic import BaseModel , ConfigDict , StrictStr
21+ from pydantic import BaseModel , ConfigDict , StrictInt , StrictStr
2222from typing import Any , ClassVar , Dict , List , Optional
2323from notehub_py .models .env_var import EnvVar
2424from typing import Optional , Set
@@ -36,10 +36,10 @@ class EnvTreeJsonNode(BaseModel):
3636 device_uid : Optional [StrictStr ] = None
3737 fleet_label : Optional [StrictStr ] = None
3838 fleet_uid : Optional [StrictStr ] = None
39- inherited_var_count : Int
39+ inherited_var_count : StrictInt
4040 type : StrictStr
4141 url : Optional [StrictStr ] = None
42- var_count : Int
42+ var_count : StrictInt
4343 variables : List [EnvVar ]
4444 __properties : ClassVar [List [str ]] = [
4545 "app_label" ,
@@ -99,12 +99,6 @@ def to_dict(self) -> Dict[str, Any]:
9999 if _item :
100100 _items .append (_item .to_dict ())
101101 _dict ["children" ] = _items
102- # override the default output from pydantic by calling `to_dict()` of inherited_var_count
103- if self .inherited_var_count :
104- _dict ["inherited_var_count" ] = self .inherited_var_count .to_dict ()
105- # override the default output from pydantic by calling `to_dict()` of var_count
106- if self .var_count :
107- _dict ["var_count" ] = self .var_count .to_dict ()
108102 # override the default output from pydantic by calling `to_dict()` of each item in variables (list)
109103 _items = []
110104 if self .variables :
@@ -135,18 +129,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
135129 "device_uid" : obj .get ("device_uid" ),
136130 "fleet_label" : obj .get ("fleet_label" ),
137131 "fleet_uid" : obj .get ("fleet_uid" ),
138- "inherited_var_count" : (
139- Int .from_dict (obj ["inherited_var_count" ])
140- if obj .get ("inherited_var_count" ) is not None
141- else None
142- ),
132+ "inherited_var_count" : obj .get ("inherited_var_count" ),
143133 "type" : obj .get ("type" ),
144134 "url" : obj .get ("url" ),
145- "var_count" : (
146- Int .from_dict (obj ["var_count" ])
147- if obj .get ("var_count" ) is not None
148- else None
149- ),
135+ "var_count" : obj .get ("var_count" ),
150136 "variables" : (
151137 [EnvVar .from_dict (_item ) for _item in obj ["variables" ]]
152138 if obj .get ("variables" ) is not None
0 commit comments