U
    ä«FcÝ	  ã                   @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é   )ÚGroupId)ÚGroupsToDisplayc                   @   sV   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dd„ Z	dS )ÚAsmz*An object specifying unsubscribe behavior.Nc                 C   s,   d| _ d| _|dk	r|| _|dk	r(|| _dS )a/  Create an ASM with the given group_id and groups_to_display.

        :param group_id: ID of an unsubscribe group
        :type group_id: GroupId, int, required
        :param groups_to_display: Unsubscribe groups to display
        :type groups_to_display: GroupsToDisplay, list(int), optional
        N)Ú	_group_idÚ_groups_to_displayÚgroup_idÚgroups_to_display)Úselfr   r   © r
   ú=/tmp/pip-unpacked-wheel-7j3043uk/sendgrid/helpers/mail/asm.pyÚ__init__   s    zAsm.__init__c                 C   s   | j S )zUThe unsubscribe group to associate with this email.

        :rtype: GroupId
        )r   ©r	   r
   r
   r   r      s    zAsm.group_idc                 C   s    t |tƒr|| _n
t|ƒ| _dS )zšThe unsubscribe group to associate with this email.

        :param value: ID of an unsubscribe group
        :type value: GroupId, int, required
        N)Ú
isinstancer   r   ©r	   Úvaluer
   r
   r   r   !   s    
c                 C   s   | j S )z£The unsubscribe groups that you would like to be displayed on the
        unsubscribe preferences page. Max of 25 groups.

        :rtype: GroupsToDisplay
        )r   r   r
   r
   r   r   -   s    zAsm.groups_to_displayc                 C   s    t |tƒr|| _n
t|ƒ| _dS )a  An array containing the unsubscribe groups that you would like to
        be displayed on the unsubscribe preferences page. Max of 25 groups.

        :param groups_to_display: Unsubscribe groups to display
        :type groups_to_display: GroupsToDisplay, list(int), optional
        N)r   r   r   r   r
   r
   r   r   6   s    
c                 C   s8   i }| j dk	r| j  ¡ |d< | jdk	r4| j ¡ |d< |S )zŸ
        Get a JSON-ready representation of this ASM object.

        :returns: This ASM object, ready for use in a request body.
        :rtype: dict
        Nr   r   )r   Úgetr   )r	   Zasmr
   r
   r   r   C   s    

zAsm.get)N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   Úsetterr   r   r
   r
   r
   r   r      s   




r   N)r   r   r   r   Úobjectr   r
   r
   r
   r   Ú<module>   s   