Current File : //usr/lib/python3/dist-packages/landscape/message_schemas/__pycache__/message.cpython-312.pyc
�

�~�eX��V�ddlmZddlmZddlmZddlmZddlmZGd�de�Zy)	�)�Any)�Bytes)�Constant)�Float)�KeyDictc�.��eZdZdZd�fd�	Z�fd�Z�xZS)�Messagea

    Like L{KeyDict}, but with three predefined keys: C{type}, C{api},
    and C{timestamp}. Of these, C{api} and C{timestamp} are optional.


    @param type: The type of the message. The C{type} key will need to
        match this as a constant.
    @param schema: A dict of additional schema in a format L{KeyDict}
        will accept.
    @param optional: An optional list of keys that should be optional.
    @param api: The server API version needed to send this message,
        if C{None} any version is fine.
    c����||_||_t�|d<tt	�td��|d<t|�|d<|�|j
ddg�nddg}t�|�!||��y)N�	timestamp�api�type)�optional)	r
rrrrr�extend�super�__init__)�selfr
�schemarr�	__class__s     ��C/usr/lib/python3/dist-packages/landscape/message_schemas/message.pyrzMessage.__init__ss�����	����#�g��{���E�G�X�d�^�4��u�
�!�$���v�����O�O�[�%�0�1�#�U�+�H�
����(��3�c���t|j��D]"}||jvs�|j|��$t�|�|�S)N)�list�keysr�popr�coerce)r�value�krs   �rrzMessage.coerce#sG����e�j�j�l�#�	�A�����#�
�	�	�!��
	��w�~�e�$�$r)NN)�__name__�
__module__�__qualname__�__doc__rr�
__classcell__)rs@rr	r	s����
4�%�%rr	N)�landscape.lib.schemarrrrrr	�rr�<module>r%s ��$�&�)�&�(�#%�g�#%r