o
    éË·eQ	  ã                   @   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 Sent To Report API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/reports/sent-to/
Schema: https://api.mailchimp.com/schema/3.0/Reports/SentTo/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 )
ÚReportSentToz0
    Get details about campaign recipients.
    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__© úW/var/www/ideatree/venv/lib/python3.10/site-packages/mailchimp3/entities/reportsentto.pyr      s   
zReportSentTo.__init__Fc                 K   sJ   || _ d| _|r| jdd|  |d¡i|¤ŽS | jjdd|  |d¡i|¤ŽS )aÚ  
        Get information about campaign recipients.

        :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úsent-tor   )r
   r   Ú_iterateÚ_build_pathÚ
_mc_clientÚ_get)r   r
   Úget_allÚqueryparamsr   r   r   Úall   s
   zReportSentTo.allc                 K   s4   t |ƒ}|| _|| _| jjdd|  |d|¡i|¤ŽS )uÙ  
        Get information about a specific campaign recipient.

        :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ReportSentTo.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
   