o
    éË·eÿ	  ã                   @   s<   d 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 Email Activity Report API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/reports/email-activity/
Schema: https://api.mailchimp.com/schema/3.0/Reports/EmailActivity/Instance.json
é    )Úunicode_literals)ÚBaseApi)Úcheck_subscriber_hashc                       s2   e Zd ZdZ‡ fdd„Zd	dd„Zdd„ Z‡  ZS )
ÚReportEmailActivityz;
    Get list member activity for a specific campaign.
    c                    s,   t t| ƒj|i |¤Ž d| _d| _d| _dS )z)
        Initialize the endpoint
        ÚreportsN)Úsuperr   Ú__init__ÚendpointÚcampaign_idÚsubscriber_hash)ÚselfÚargsÚkwargs©Ú	__class__© ú^/var/www/ideatree/venv/lib/python3.10/site-packages/mailchimp3/entities/reportemailactivity.pyr      s   
zReportEmailActivity.__init__Fc                 K   sJ   || _ d| _|r| jdd|  |d¡i|¤ŽS | jjdd|  |d¡i|¤ŽS )uô  
        Get a list of memberâ€™s subscriber activity in a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :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'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        NÚurlúemail-activityr   )r
   r   Ú_iterateÚ_build_pathÚ
_mc_clientÚ_get)r   r
   Úget_allÚqueryparamsr   r   r   Úall   s
   zReportEmailActivity.allc                 K   s4   t |ƒ}|| _|| _| jjdd|  |d|¡i|¤ŽS )u  
        Get a specific list memberâ€™s activity in a campaign including opens,
        clicks, and bounces.

        :param campaign_id: The unique id for the campaign.
        :type campaign_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`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        r   r   Nr   )r   r
   r   r   r   r   )r   r
   r   r   r   r   r   Úget2   s   
ÿþzReportEmailActivity.get)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__classcell__r   r   r   r   r      s
    

r   N)r    Ú
__future__r   Úmailchimp3.baseapir   Úmailchimp3.helpersr   r   r   r   r   r   Ú<module>   s
   