U
    42‹i  ã                   @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é   )ÚSpamThreshold)ÚSpamUrlc                   @   sp   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edd„ ƒZ	e	jdd„ ƒZ	dd„ Z
dS )Ú	SpamCheckz;This allows you to test the content of your email for spam.Nc                 C   s@   d| _ d| _d| _|dk	r || _|dk	r.|| _|dk	r<|| _dS )a‘  Create a SpamCheck to test the content of your email for spam.

        :param enable: If this setting is applied.
        :type enable: boolean, optional
        :param threshold: Spam qualification threshold, from 1 to 10 (strict).
        :type threshold: int, optional
        :param post_to_url: Inbound Parse URL to send a copy of your email.
        :type post_to_url: string, optional
        N)Ú_enableÚ
_thresholdÚ_post_to_urlÚenableÚ	thresholdÚpost_to_url)Úselfr   r	   r
   © r   úD/tmp/pip-unpacked-wheel-clku7wca/sendgrid/helpers/mail/spam_check.pyÚ__init__   s    
zSpamCheck.__init__c                 C   s   | j S )zGIndicates if this setting is enabled.

        :rtype: boolean
        ©r   ©r   r   r   r   r      s    zSpamCheck.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ÉThreshold used to determine if your content qualifies as spam.
        On a scale from 1 to 10, with 10 being most strict, or most likely to
        be considered as spam.

        :rtype: int
        )r   r   r   r   r   r	   .   s    zSpamCheck.thresholdc                 C   s    t |tƒr|| _n
t|ƒ| _dS )aÂ  Threshold used to determine if your content qualifies as spam.
        On a scale from 1 to 10, with 10 being most strict, or most likely to
        be considered as spam.

        :param value: Threshold used to determine if your content qualifies as
                      spam.
                      On a scale from 1 to 10, with 10 being most strict, or
                      most likely to be considered as spam.
        :type value: int
        N)Ú
isinstancer   r   r   r   r   r   r	   8   s    
c                 C   s   | j S )z£An Inbound Parse URL to send a copy of your email.
        If defined, a copy of your email and its spam report will be sent here.

        :rtype: string
        )r   r   r   r   r   r
   I   s    zSpamCheck.post_to_urlc                 C   s    t |tƒr|| _n
t|ƒ| _dS )aA  An Inbound Parse URL to send a copy of your email.
        If defined, a copy of your email and its spam report will be sent here.

        :param value: An Inbound Parse URL to send a copy of your email.
        If defined, a copy of your email and its spam report will be sent here.
        :type value: string
        N)r   r   r   r   r   r   r   r
   R   s    	
c                 C   sL   i }| j dk	r| j |d< | jdk	r0| j ¡ |d< | jdk	rH| j ¡ |d< |S )z
        Get a JSON-ready representation of this SpamCheck.

        :returns: This SpamCheck, ready for use in a request body.
        :rtype: dict
        Nr   r	   r
   )r   r	   Úgetr
   )r   Z
spam_checkr   r   r   r   `   s    



zSpamCheck.get)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   Úsetterr	   r
   r   r   r   r   r   r      s   



	


r   N)Zspam_thresholdr   Zspam_urlr   Úobjectr   r   r   r   r   Ú<module>   s   