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 Unsubscribes Report API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/reports/unsubscribed/
Schema: https://api.mailchimp.com/schema/3.0/Reports/Unsubs/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 )
ÚReportUnsubscribeszW
    Get information about list members who unsubscribed from a specific campaign.
    c                    s,   t t| ƒj|i |¤Ž d| _d | _d | _d S )NÚreports)Úsuperr   Ú__init__ÚendpointÚcampaign_idÚsubscriber_hash)ÚselfÚargsÚkwargs©Ú	__class__© ú]/var/www/ideatree/venv/lib/python3.10/site-packages/mailchimp3/entities/reportunsubscribes.pyr      s   
zReportUnsubscribes.__init__Fc                 K   sJ   || _ d| _|r| jdd|  |d¡i|¤ŽS | jjdd|  |d¡i|¤ŽS )a  
        Get information about members who have unsubscribed from 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Úunsubscribedr   )r
   r   Ú_iterateÚ_build_pathÚ
_mc_clientÚ_get)r   r
   Úget_allÚqueryparamsr   r   r   Úall   s
   zReportUnsubscribes.allc                 K   s4   t |ƒ}|| _|| _| jjdd|  |d|¡i|¤ŽS )uû  
        Get information about a specific list member who unsubscribed from a
        campaign.

        :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   Úget0   s    zReportUnsubscribes.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
   