ó
ş9^c           @   s   d  e  f d     YZ d S(   t   OpenTrackingc           B   sh   e  Z d  Z d d d  Z e d    Z e j d    Z e d    Z e j d    Z d   Z	 RS(   sÄ   
    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.
    c         C   sF   d |  _ d |  _ | d k	 r* | |  _ n  | d k	 rB | |  _ n  d S(   s3  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(   t   Nonet   _enablet   _substitution_tagt   enablet   substitution_tag(   t   selfR   R   (    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyt   __init__   s    		c         C   s   |  j  S(   sG   Indicates if this setting is enabled.

        :rtype: boolean
        (   R   (   R   (    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyR      s    c         C   s   | |  _  d S(   s   Indicates if this setting is enabled.

        :param value: Indicates if this setting is enabled.
        :type value: boolean
        N(   R   (   R   t   value(    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyR   !   s    c         C   s   |  j  S(   sÜ   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   (    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyR   *   s    c         C   s   | |  _  d S(   sć  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
        N(   R   (   R   R   (    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyR   4   s    c         C   sN   i  } |  j  d k	 r% |  j  | d <n  |  j d k	 rJ |  j j   | d <n  | S(   sŁ   
        Get a JSON-ready representation of this OpenTracking.

        :returns: This OpenTracking, ready for use in a request body.
        :rtype: dict
        R   R   N(   R   R   R   t   get(   R   t   open_tracking(    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyR	   C   s    N(
   t   __name__t
   __module__t   __doc__R   R   t   propertyR   t   setterR   R	   (    (    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyR       s   	
N(   t   objectR    (    (    (    sE   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/open_tracking.pyt   <module>   t    