comparison libervia/backend/models/core.py @ 4296:ffc43219e0b2

core (models): add new models for `DiscoIdentity` and `JID`: `JIDType` `StrictJIDType` can be used when a Twisted JID is expected in a Pydantic model.
author Goffi <goffi@goffi.org>
date Fri, 06 Sep 2024 17:40:32 +0200
parents 0d7bb4df2343
children
comparison
equal deleted inserted replaced
4295:7d98d894933c 4296:ffc43219e0b2
42 """Data used to send a message edition""" 42 """Data used to send a message edition"""
43 43
44 message: dict[str, str] 44 message: dict[str, str]
45 subject: dict[str, str] = Field(default_factory=dict) 45 subject: dict[str, str] = Field(default_factory=dict)
46 extra: dict[str, str] = Field(default_factory=dict) 46 extra: dict[str, str] = Field(default_factory=dict)
47
48
49 class DiscoIdentity(BaseModel):
50 """A single disco identity
51
52 Note that an XMPP entity may have several disco identities.
53 """
54
55 name: str
56 category: str
57 type: str