o
    éË·e›	  ã                   @   sT   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 G dd„ deƒZd	S )
zá
The Automations API endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/
Schema: https://api.mailchimp.com/schema/3.0/Automations/Instance.json
é    )Úunicode_literals)ÚBaseApi)ÚAutomationActions)ÚAutomationEmails)ÚAutomationRemovedSubscribersc                       s2   e Zd ZdZ‡ fdd„Zd	dd„Zdd„ Z‡  ZS )
ÚAutomationszè
    Automation is a paid feature that lets you build a series of triggered
    emails that are sent to subscribers over a set period of time. Use the
    Automation API calls to manage Automation workflows, emails, and queues.
    c                    sD   t t| ƒj|i |¤Ž d| _d| _t| ƒ| _t| ƒ| _t	| ƒ| _
dS )z)
        Initialize the endpoint
        ÚautomationsN)Úsuperr   Ú__init__ÚendpointÚworkflow_idr   Úactionsr   Úemailsr   Úremoved_subscribers)ÚselfÚargsÚkwargs©Ú	__class__© úV/var/www/ideatree/venv/lib/python3.10/site-packages/mailchimp3/entities/automations.pyr
      s   

zAutomations.__init__Fc                 K   s<   d| _ |r| jdd|  ¡ i|¤ŽS | jjdd|  ¡ i|¤ŽS )u&  
        Get a summary of an accountâ€™s Automations.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: the query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        NÚurlr   )r   Ú_iterateÚ_build_pathÚ
_mc_clientÚ_get)r   Úget_allÚqueryparamsr   r   r   Úall%   s   
zAutomations.allc                 K   s"   || _ | jjdd|  |¡i|¤ŽS )u»  
        Get a summary of an individual Automation workflowâ€™s settings and
        content. The trigger_settings object returns information for the first
        email in the workflow.

        :param workflow_id: The unique id for the Automation workflow
        :type workflow_id: :py:class:`str`
        :param queryparams: the query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        r   Nr   )r   r   r   r   )r   r   r   r   r   r   Úget7   s   zAutomations.get)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   Ú__classcell__r   r   r   r   r      s
    
r   N)r#   Ú
__future__r   Úmailchimp3.baseapir   Ú%mailchimp3.entities.automationactionsr   Ú$mailchimp3.entities.automationemailsr   Ú0mailchimp3.entities.automationremovedsubscribersr   r   r   r   r   r   Ú<module>   s   