Add render_webhook_request method

This commit is contained in:
jrootjunior 2020-01-22 13:16:56 +02:00
parent 3a1a666aff
commit a5fb4ee296

View file

@ -21,6 +21,12 @@ class Request(BaseModel):
data: Dict[str, Optional[Any]]
files: Optional[Dict[str, InputFile]]
def render_webhook_request(self):
return {
"method": self.method,
**{key: value for key, value in self.data.items() if value is not None},
}
class Config(BaseConfig):
arbitrary_types_allowed = True