ó
š9^c           @   s   d  e  f d     YZ d S(   t   Headerc           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(
   sY  A header to specify specific handling instructions for your email.

    If the name or value contain Unicode characters, they must be properly
    encoded. You may not overwrite the following reserved headers:
    x-sg-id, x-sg-eid, received, dkim-signature, Content-Type,
    Content-Transfer-Encoding, To, From, Subject, Reply-To, CC, BCC
    c         C   sg   d |  _ d |  _ d |  _ | d k	 r3 | |  _ n  | d k	 rK | |  _ n  | d k	 rc | |  _ n  d S(   s  Create a Header.

        :param key: The name of the header (e.g. "Date")
        :type key: string, optional
        :param value: The header's value (e.g. "2013-02-27 1:23:45 PM PDT")
        :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(    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/header.pyt   __init__
   s    			c         C   s   |  j  S(   s8   The name of the header.

        :rtype: string
        (   R   (   R   (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/header.pyR       s    c         C   s   | |  _  d S(   sk   The name of the header.

        :param value: The name of the header.
        :type value: string
        N(   R   (   R   R   (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/header.pyR   (   s    c         C   s   |  j  S(   s9   The value of the header.

        :rtype: string
        (   R   (   R   (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/header.pyR   1   s    c         C   s   | |  _  d S(   sm   The value of the header.

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

        :rtype: Personalization, integer
        (   R   (   R   (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/header.pyR   B   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   (    (    s>   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/header.pyR   J   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 Header.

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