Module genshin.models.hoyolab.web_event
HoYoLAB web event models.
Classes
class WebEvent (**data: Any)-
Expand source code
class WebEvent(APIModel): """Hoyolab web event model.""" id: int name: str description: str = Aliased("desc") start_time: datetime.datetime = Aliased("start") end_time: datetime.datetime = Aliased("end") create_time: datetime.datetime = Aliased("create_at") web_path: str app_path: str banner: str = Aliased("banner_url") status: int @property def url(self) -> str: if "https" in self.web_path: return self.web_path return f"https://www.hoyolab.com{self.web_path}"Hoyolab web event model.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- APIModel
- pydantic.main.BaseModel
Class variables
var app_path : strvar create_time : datetime.datetimevar description : strvar end_time : datetime.datetimevar id : intvar model_config : pydantic.config.ConfigDictvar name : strvar start_time : datetime.datetimevar status : intvar web_path : str
Instance variables
prop url : str-
Expand source code
@property def url(self) -> str: if "https" in self.web_path: return self.web_path return f"https://www.hoyolab.com{self.web_path}"