2020
2121from pydantic import BaseModel , ConfigDict , Field , StrictInt , StrictStr
2222from typing import Any , ClassVar , Dict , List , Optional
23- from bandwidth .models .error_source import ErrorSource
2423from bandwidth .models .telephone_number import TelephoneNumber
2524from typing import Optional , Set
2625from typing_extensions import Self
@@ -29,14 +28,11 @@ class Error(BaseModel):
2928 """
3029 Error
3130 """ # noqa: E501
32- id : Optional [StrictStr ] = Field (default = None , description = "A unique identifier for the error." )
33- type : Optional [StrictStr ] = Field (default = None , description = "The type of error." )
3431 code : Optional [StrictInt ] = None
3532 description : Optional [StrictStr ] = None
3633 telephone_numbers : Optional [List [TelephoneNumber ]] = Field (default = None , alias = "telephoneNumbers" )
37- source : Optional [ErrorSource ] = None
3834 additional_properties : Dict [str , Any ] = {}
39- __properties : ClassVar [List [str ]] = ["id" , "type" , " code" , "description" , "telephoneNumbers" , "source " ]
35+ __properties : ClassVar [List [str ]] = ["code" , "description" , "telephoneNumbers" ]
4036
4137 model_config = ConfigDict (
4238 populate_by_name = True ,
@@ -86,9 +82,6 @@ def to_dict(self) -> Dict[str, Any]:
8682 if _item_telephone_numbers :
8783 _items .append (_item_telephone_numbers .to_dict ())
8884 _dict ['telephoneNumbers' ] = _items
89- # override the default output from pydantic by calling `to_dict()` of source
90- if self .source :
91- _dict ['source' ] = self .source .to_dict ()
9285 # puts key-value pairs in additional_properties in the top level
9386 if self .additional_properties is not None :
9487 for _key , _value in self .additional_properties .items ():
@@ -106,12 +99,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
10699 return cls .model_validate (obj )
107100
108101 _obj = cls .model_validate ({
109- "id" : obj .get ("id" ),
110- "type" : obj .get ("type" ),
111102 "code" : obj .get ("code" ),
112103 "description" : obj .get ("description" ),
113- "telephoneNumbers" : [TelephoneNumber .from_dict (_item ) for _item in obj ["telephoneNumbers" ]] if obj .get ("telephoneNumbers" ) is not None else None ,
114- "source" : ErrorSource .from_dict (obj ["source" ]) if obj .get ("source" ) is not None else None
104+ "telephoneNumbers" : [TelephoneNumber .from_dict (_item ) for _item in obj ["telephoneNumbers" ]] if obj .get ("telephoneNumbers" ) is not None else None
115105 })
116106 # store additional fields in additional_properties
117107 for _key in obj .keys ():
0 commit comments