o
    wÔ+fô	  ã                   @   s   G d d„ de ƒZdS )c                   @   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 )ÚSubstitutionz˜A string substitution to be applied to the text and HTML contents of
    the body of your email, as well as in the Subject and Reply-To parameters.
    Nc                 C   sD   d| _ d| _d| _|dur|| _|dur|| _|dur || _dS dS )a˜  Create a Substitution with the given key and value.

        :param key: Text to be replaced with "value" param
        :type key: string, optional
        :param value: Value to substitute into email
        :type value: string, optional
        :param name: p is the Personalization object or Personalization object
                     index
        :type name: Personalization, integer, optional
        N)Ú_keyÚ_valueÚ_personalizationÚkeyÚvalueÚpersonalization)Úselfr   r   Úp© r
   úU/var/www/html/venv/lib/python3.10/site-packages/sendgrid/helpers/mail/substitution.pyÚ__init__   s   
ÿzSubstitution.__init__c                 C   ó   | j S )z:The substitution key.

        :rtype key: string
        ©r   ©r   r
   r
   r   r      ó   zSubstitution.keyc                 C   ó
   || _ dS )zcThe substitution key.

        :param key: The substitution key.
        :type key: string
        Nr   ©r   r   r
   r
   r   r   $   ó   
c                 C   s   t | jtƒrt| jƒS | jS )z>The substitution value.

        :rtype value: string
        )Ú
isinstancer   ÚintÚstrr   r
   r
   r   r   -   s   zSubstitution.valuec                 C   r   )zkThe substitution value.

        :param value: The substitution value.
        :type value: string
        N)r   r   r
   r
   r   r   5   r   c                 C   r   )zmThe Personalization object or Personalization object index

        :rtype: Personalization, integer
        ©r   r   r
   r
   r   r   >   r   zSubstitution.personalizationc                 C   r   )zÙThe Personalization object or Personalization object index

        :param value: The Personalization object or Personalization object
                      index
        :type value: Personalization, integer
        Nr   r   r
   r
   r   r   F   s   
c                 C   s(   i }| j dur| jdur| j|| j < |S )z£
        Get a JSON-ready representation of this Substitution.

        :returns: This Substitution, ready for use in a request body.
        :rtype: dict
        N)r   r   )r   Úsubstitutionr
   r
   r   ÚgetP   s   zSubstitution.get)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   Úsetterr   r   r   r
   r
   r
   r   r      s     






	r   N)Úobjectr   r
   r
   r
   r   Ú<module>   s    