o
    ˷e,                     @   s@   d Z ddlmZ ddlmZ ddlmZmZ G dd deZdS )a  
The Automation Email Queue endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/queue/
Schema: https://api.mailchimp.com/schema/3.0/Automations/Emails/Queue/Instance.json
    )unicode_literals)BaseApi)check_emailcheck_subscriber_hashc                       s8   e Zd ZdZ fddZdd Zdd Zdd	 Z  ZS )
AutomationEmailQueuesz:
    Manage list member queues for Automation emails.
    c                    s2   t t| j|i | d| _d| _d| _d| _dS )z)
        Initialize the endpoint
        automationsN)superr   __init__endpointworkflow_idemail_idsubscriber_hash)selfargskwargs	__class__ `/var/www/ideatree/venv/lib/python3.10/site-packages/mailchimp3/entities/automationemailqueues.pyr	      s
   
zAutomationEmailQueues.__init__c                 C   sd   || _ || _d|vrtdt|d  | jj| |d|d|d}|dur-|d | _|S d| _|S )a  
        Manually add a subscriber to a workflow, bypassing the default trigger
        settings. You can also use this endpoint to trigger a series of
        automated emails in an API 3.0 workflow type or add subscribers to an
        automated email queue that uses the API request delay type.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "email_address": string*
        }
        email_addressz5The automation email queue must have an email_addressemailsqueue)urldataNid)r   r   KeyErrorr   
_mc_client_post_build_pathr   )r   r   r   r   responser   r   r   create   s   
zAutomationEmailQueues.createc                 C   s,   || _ || _d| _| jj| |d|ddS )a'  
        Get information about an Automation email queue.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        Nr   r   r   )r   r   r   r   _getr   )r   r   r   r   r   r   allA   s   	zAutomationEmailQueues.allc                 C   s6   t |}|| _|| _|| _| jj| |d|d|dS )u  
        Get information about a specific subscriber in an Automation email
        queue.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        r   r   r!   )r   r   r   r   r   r"   r   )r   r   r   r   r   r   r   getQ   s
   zAutomationEmailQueues.get)	__name__
__module____qualname____doc__r	   r    r#   r$   __classcell__r   r   r   r   r      s    "r   N)	r(   
__future__r   mailchimp3.baseapir   mailchimp3.helpersr   r   r   r   r   r   r   <module>   s
   