private_xml – Private XML Storage support (XEP-0049)

This module provides support for storing and retrieving private XML data on the server as per Private XML Storage.

class aioxmpp.private_xml.PrivateXMLService(client, **kwargs)

Service for handling server side private XML storage.

coroutine get_private_xml(query_xso)

Get the private XML data for the element query_xso from the server.

Parameters:query_xso – the object to retrieve.
Returns:the stored private XML data.

query_xso must serialize to an empty XML node of the wanted namespace and type and must be registered as private XML Query payload.

coroutine set_private_xml(xso)

Store the serialization of xso on the server as the private XML data for the namespace of xso.

Parameters:xso – the XSO whose serialization is send as private XML data.

To register payload XSOs for private storage Query is exposed:

class aioxmpp.private_xml.Query(payload)

The XSO for queries to private XML storage.

classmethod as_payload_class(mycls, xso_class)

Register the given class xso_class as possible payload for private XML storage.

Return xso_class, to allow this to be used as a decorator.