B
    è?F[»  ã               @   s(   d Z G dd„ deƒZG dd„ deƒZdS )z0
A set of results returned by SendMessageBatch.
c               @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚResultEntrya  
    The result (successful or unsuccessful) of a single
    message within a send_message_batch request.

    In the case of a successful result, this dict-like
    object will contain the following items:

    :ivar id: A string containing the user-supplied ID of the message.
    :ivar message_id: A string containing the SQS ID of the new message.
    :ivar message_md5: A string containing the MD5 hash of the message body.

    In the case of an error, this object will contain the following
    items:

    :ivar id: A string containing the user-supplied ID of the message.
    :ivar sender_fault: A boolean value.
    :ivar error_code: A string containing a short description of the error.
    :ivar error_message: A string containing a description of the error.
    c             C   s   d S )N© )ÚselfÚnameÚattrsÚ
connectionr   r   ú4lib/python3.7/site-packages/boto/sqs/batchresults.pyÚstartElement0   s    zResultEntry.startElementc             C   sn   |dkr|| d< nX|dkr$|| d< nF|dkr6|| d< n4|dkrH|| d< n"|d	krZ|| d
< n|dkrj|| d< d S )NZIdÚidZ	MessageIdZ
message_idZMD5OfMessageBodyZmessage_md5ZSenderFaultZsender_faultZCodeZ
error_codeZMessageZerror_messager   )r   r   Úvaluer   r   r   r   Ú
endElement3   s    




zResultEntry.endElementN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   c               @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚBatchResultsaC  
    A container for the results of a send_message_batch request.

    :ivar results: A list of successful results.  Each item in the
        list will be an instance of :class:`ResultEntry`.

    :ivar errors: A list of unsuccessful results.  Each item in the
        list will be an instance of :class:`ResultEntry`.
    c             C   s   || _ g | _g | _d S )N)ÚparentÚresultsÚerrors)r   r   r   r   r   Ú__init__L   s    zBatchResults.__init__c             C   sB   |  d¡r tƒ }| j |¡ |S |dkr>tƒ }| j |¡ |S d S )NZMessageBatchResultEntryZBatchResultErrorEntry)Úendswithr   r   Úappendr   )r   r   r   r   Úentryr   r   r   r   Q   s    
zBatchResults.startElementc             C   s   t | ||ƒ d S )N)Úsetattr)r   r   r
   r   r   r   r   r   \   s    zBatchResults.endElementN)r   r   r   r   r   r   r   r   r   r   r   r   A   s   	r   N)r   Údictr   Úobjectr   r   r   r   r   Ú<module>   s   &