[docs]classEncodeResult(BaseModel,frozen=True,validate_types=False):"""Represents the result of an encoding."""_type:Literal["ENCODE","DECODE"]name:Literal["BASE64","BINARY"]"""The name of the encoding."""input:str"""The input text."""text:str"""The encoded/decoded text."""def__str__(self)->str:returnself.text@propertydeftype(self)->ResultType:"""The type of the result."""returnResultType(self._type)defto_dict(self)->dict[Literal["encode","decode"],str]:"""Converts this model to a dictionary."""return{self._type.lower():self.input}# pyright: ignore[reportReturnType]@classmethoddeffrom_dict(cls,_input:str,_type:Literal["ENCODE","DECODE"],name:Literal["BASE64","BINARY"],text:str)->Self:"""Converts a dictionary to this model."""returncls(_type=_type,name=name,input=_input,text=text,)