ó
ş9^c           @   s:   d  d l  m Z d  d l m Z d e f d     YZ d S(   i   (   t   GroupId(   t   GroupsToDisplayt   Asmc           B   se   e  Z d  Z d d  Z e d    Z e j d    Z e d    Z e j d    Z d   Z	 RS(   s*   An object specifying unsubscribe behavior.c         C   sF   d |  _ d |  _ | d k	 r* | |  _ n  | d k	 rB | |  _ n  d S(   s/  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(   t   Nonet	   _group_idt   _groups_to_displayt   group_idt   groups_to_display(   t   selfR   R   (    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyt   __init__   s    		c         C   s   |  j  S(   sU   The unsubscribe group to associate with this email.

        :rtype: GroupId
        (   R   (   R   (    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyR      s    c         C   s.   t  | t  r | |  _ n t |  |  _ d S(   s   The unsubscribe group to associate with this email.

        :param value: ID of an unsubscribe group
        :type value: GroupId, int, required
        N(   t
   isinstanceR    R   (   R   t   value(    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyR   !   s    c         C   s   |  j  S(   sŁ   The unsubscribe groups that you would like to be displayed on the
        unsubscribe preferences page. Max of 25 groups.

        :rtype: GroupsToDisplay
        (   R   (   R   (    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyR   -   s    c         C   s.   t  | t  r | |  _ n t |  |  _ d S(   s  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   (    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyR   6   s    c         C   sT   i  } |  j  d k	 r+ |  j  j   | d <n  |  j d k	 rP |  j j   | d <n  | S(   s   
        Get a JSON-ready representation of this ASM object.

        :returns: This ASM object, ready for use in a request body.
        :rtype: dict
        R   R   N(   R   R   t   getR   (   R   t   asm(    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyR   C   s    N(
   t   __name__t
   __module__t   __doc__R   R	   t   propertyR   t   setterR   R   (    (    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyR      s   	N(   R   R    R   R   t   objectR   (    (    (    s;   /tmp/pip-unpacked-wheel-v7av_c/sendgrid/helpers/mail/asm.pyt   <module>   s   