U
    ä«Fc		  ã                   @   s    d dl mZ G dd„ deƒZdS )é   )ÚValidateApiKeyc                   @   sT   e Zd ZdZ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 )ÚContentzvContent to be included in your email.

    You must specify at least one mime type in the Contents of your email.
    c                 C   s4   d| _ d| _tƒ | _|dk	r"|| _|dk	r0|| _dS )z÷Create a Content with the specified MIME type and content.

        :param mime_type: MIME type of this Content (e.g. "text/plain").
        :type mime_type: string
        :param content: The actual content.
        :type content: string
        N)Ú
_mime_typeÚ_contentr   Ú
_validatorÚ	mime_typeÚcontent)Úselfr   r   © r
   úA/tmp/pip-unpacked-wheel-7j3043uk/sendgrid/helpers/mail/content.pyÚ__init__   s    zContent.__init__c                 C   s   | j S )z¥The MIME type of the content you are including in your email.
        For example, "text/plain" or "text/html" or "text/x-amp-html".

        :rtype: string
        ©r   ©r	   r
   r
   r   r      s    zContent.mime_typec                 C   s
   || _ dS )a[  The MIME type of the content you are including in your email.
        For example, "text/plain" or "text/html" or "text/x-amp-html".

        :param value: The MIME type of the content you are including in your
                      email.
        For example, "text/plain" or "text/html" or "text/x-amp-html".
        :type value: string
        Nr   ©r	   Úvaluer
   r
   r   r   &   s    
c                 C   s   | j S )zQThe actual content (of the specified mime type).

        :rtype: string
        )r   r   r
   r
   r   r   2   s    zContent.contentc                 C   s   | j  |¡ || _dS )z�The actual content (of the specified mime type).

        :param value: The actual content (of the specified mime type).
        :type value: string
        N)r   Zvalidate_message_dictr   r   r
   r
   r   r   :   s    c                 C   s0   i }| j dk	r| j |d< | jdk	r,| j|d< |S )z™
        Get a JSON-ready representation of this Content.

        :returns: This Content, ready for use in a request body.
        :rtype: dict
        NÚtyper   )r   r   )r	   r   r
   r
   r   ÚgetD   s    



zContent.getN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   Úsetterr   r   r
   r
   r
   r   r      s   



	r   N)Z
validatorsr   Úobjectr   r
   r
   r
   r   Ú<module>   s   