U
    42‹i8
  ã                   @   s   G d d„ de ƒZdS )c                   @   sV   e Zd ZdZddd„Zedd„ ƒZejdd„ ƒZedd	„ ƒZejd
d	„ ƒZdd„ Z	dS )ÚOpenTrackingzÄ
    Allows you to track whether the email was opened or not, by including a
    single pixel image in the body of the content. When the pixel is loaded,
    we log that the email was opened.
    Nc                 C   s,   d| _ d| _|dk	r|| _|dk	r(|| _dS )a3  Create an OpenTracking to track when your email is opened.

        :param enable: If open tracking is enabled.
        :type enable: boolean, optional
        :param substitution_tag: Tag in body to be replaced by tracking pixel.
        :type substitution_tag: OpenTrackingSubstitionTag, optional
        N)Ú_enableÚ_substitution_tagÚenableÚsubstitution_tag)Úselfr   r   © r   úG/tmp/pip-unpacked-wheel-clku7wca/sendgrid/helpers/mail/open_tracking.pyÚ__init__   s    zOpenTracking.__init__c                 C   s   | j S )zGIndicates if this setting is enabled.

        :rtype: boolean
        ©r   ©r   r   r   r   r      s    zOpenTracking.enablec                 C   s
   || _ dS )zˆIndicates if this setting is enabled.

        :param value: Indicates if this setting is enabled.
        :type value: boolean
        Nr
   ©r   Úvaluer   r   r   r   !   s    c                 C   s   | j S )zÜAllows you to specify a substitution tag that you can insert in the
        body of your email at a location that you desire. This tag will be
        replaced by the open tracking pixel.

        :rtype: string
        ©r   r   r   r   r   r   *   s    zOpenTracking.substitution_tagc                 C   s
   || _ dS )aæ  Allows you to specify a substitution tag that you can insert in the
        body of your email at a location that you desire. This tag will be
        replaced by the open tracking pixel.

        :param value: Allows you to specify a substitution tag that you can
                      insert in the body of your email at a location that you
                      desire. This tag will be replaced by the open tracking
                      pixel.

        :type value: string
        Nr   r   r   r   r   r   4   s    c                 C   s4   i }| j dk	r| j |d< | jdk	r0| j ¡ |d< |S )z£
        Get a JSON-ready representation of this OpenTracking.

        :returns: This OpenTracking, ready for use in a request body.
        :rtype: dict
        Nr   r   )r   r   Úget)r   Zopen_trackingr   r   r   r   C   s    


zOpenTracking.get)NN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   Úpropertyr   Úsetterr   r   r   r   r   r   r      s   



	
r   N)Úobjectr   r   r   r   r   Ú<module>   ó    