U
    ‰d  ã                   @   s4   d Z ddlmZ ddlmZ dZG dd„ deƒZdS )zAMQP Messages.é   )ÚGenericContent)ÚBasic)ÚMessagec                       sd   e Zd ZdZejZdddddddd	d
dddddgZd‡ fdd„	ZdZe	dd„ ƒZ
e	dd„ ƒZ‡  ZS )r   a  A Message for use with the Channel.basic_* methods.

    Expected arg types

        body: string
        children: (not supported)

    Keyword properties may include:

        content_type: shortstr
            MIME content type

        content_encoding: shortstr
            MIME content encoding

        application_headers: table
            Message header field table, a dict with string keys,
            and string | int | Decimal | datetime | dict values.

        delivery_mode: octet
            Non-persistent (1) or persistent (2)

        priority: octet
            The message priority, 0 to 9

        correlation_id: shortstr
            The application correlation identifier

        reply_to: shortstr
            The destination to reply to

        expiration: shortstr
            Message expiration specification

        message_id: shortstr
            The application message identifier

        timestamp: unsigned long
            The message timestamp

        type: shortstr
            The message type name

        user_id: shortstr
            The creating user id

        app_id: shortstr
            The creating application id

        cluster_id: shortstr
            Intra-cluster routing identifier

        Unicode bodies are encoded according to the 'content_encoding'
        argument. If that's None, it's set to 'UTF-8' automatically.

        Example::

            msg = Message('hello world',
                            content_type='text/plain',
                            application_headers={'foo': 7})
    )Úcontent_typeÚs)Úcontent_encodingr   )Úapplication_headersÚF)Zdelivery_modeÚo)Úpriorityr
   )Zcorrelation_idr   )Zreply_tor   )Z
expirationr   )Z
message_idr   )Ú	timestampÚL)Útyper   )Zuser_idr   )Zapp_idr   )Z
cluster_idr   Ú Nc                    s$   t ƒ jf |Ž d | _|| _|| _d S )N)ÚsuperÚ__init__Údelivery_infoÚbodyÚchannel)Úselfr   Úchildrenr   Ú
properties©Ú	__class__© ú6/tmp/pip-unpacked-wheel-sfh45kzb/amqp/basic_message.pyr   g   s    zMessage.__init__)r   r   r   c                 C   s   | j  d¡S )Nr   )r   Úget©r   r   r   r   Úheaderst   s    zMessage.headersc                 C   s   | j  d¡S )NÚdelivery_tag)r   r   r   r   r   r   r   x   s    zMessage.delivery_tag)r   NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ZCLASS_IDZ
PROPERTIESr   Ú	__slots__Úpropertyr   r   Ú__classcell__r   r   r   r   r      s.   >ò
r   N)r#   Zserializationr   Úspecr   Ú__all__r   r   r   r   r   Ú<module>   s   
