ó
š9^c           @   s   d  e  f d     YZ d S(   t   Substitutionc           B   s   e  Z d  Z d	 d	 d	 d  Z e d    Z e j d    Z e d    Z e j d    Z e d    Z	 e	 j d    Z	 d   Z
 RS(
   s   A string substitution to be applied to the text and HTML contents of
    the body of your email, as well as in the Subject and Reply-To parameters.
    c         C   sg   d |  _ d |  _ d |  _ | d k	 r3 | |  _ n  | d k	 rK | |  _ n  | d k	 rc | |  _ n  d S(   s  Create a Substitution with the given key and value.

        :param key: Text to be replaced with "value" param
        :type key: string, optional
        :param value: Value to substitute into email
        :type value: string, optional
        :param name: p is the Personalization object or Personalization object
                     index
        :type name: Personalization, integer, optional
        N(   t   Nonet   _keyt   _valuet   _personalizationt   keyt   valuet   personalization(   t   selfR   R   t   p(    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyt   __init__   s    			c         C   s   |  j  S(   s:   The substitution key.

        :rtype key: string
        (   R   (   R   (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR      s    c         C   s   | |  _  d S(   sc   The substitution key.

        :param key: The substitution key.
        :type key: string
        N(   R   (   R   R   (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR   $   s    c         C   s   |  j  S(   s>   The substitution value.

        :rtype value: string
        (   R   (   R   (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR   -   s    c         C   s   | |  _  d S(   sk   The substitution value.

        :param value: The substitution value.
        :type value: string
        N(   R   (   R   R   (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR   5   s    c         C   s   |  j  S(   sm   The Personalization object or Personalization object index

        :rtype: Personalization, integer
        (   R   (   R   (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR   >   s    c         C   s   | |  _  d S(   sŲ   The Personalization object or Personalization object index

        :param value: The Personalization object or Personalization object
                      index
        :type value: Personalization, integer
        N(   R   (   R   R   (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR   F   s    c         C   s;   i  } |  j  d k	 r7 |  j d k	 r7 |  j | |  j  <n  | S(   sĢ   
        Get a JSON-ready representation of this Substitution.

        :returns: This Substitution, ready for use in a request body.
        :rtype: dict
        N(   R   R   R   (   R   t   substitution(    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyt   getP   s    N(   t   __name__t
   __module__t   __doc__R   R
   t   propertyR   t   setterR   R   R   (    (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyR       s   		
N(   t   objectR    (    (    (    sD   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/substitution.pyt   <module>   t    