
    xh	                     "     G d  de           ZdS )c                       e Zd ZdZddZed             Zej        d             Zed             Zej        d             Zed             Z	e	j        d	             Z	d
 Z
dS )SubstitutionzA 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                 j    d| _         d| _        d| _        ||| _        ||| _        |	|| _        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	   ps       U/var/www/html/what/lib/python3.11/site-packages/sendgrid/helpers/mail/substitution.py__init__zSubstitution.__init__   sM     	 $?DHDJ=#$D    =    c                     | j         S )z:The substitution key.

        :rtype key: string
        r   r   s    r   r   zSubstitution.key   s     yr   c                     || _         dS )zcThe substitution key.

        :param key: The substitution key.
        :type key: string
        Nr   r   r	   s     r   r   zSubstitution.key$   s     			r   c                 l    t          | j        t                    rt          | j                  n| j        S )z>The substitution value.

        :rtype value: string
        )
isinstancer   intstrr   s    r   r	   zSubstitution.value-   s,     $.dk3#?#?Ps4;T[Pr   c                     || _         dS )zkThe substitution value.

        :param value: The substitution value.
        :type value: string
        N)r   r   s     r   r	   zSubstitution.value5   s     r   c                     | j         S )zmThe Personalization object or Personalization object index

        :rtype: Personalization, integer
        r   r   s    r   r
   zSubstitution.personalization>   s     $$r   c                     || _         dS )zThe Personalization object or Personalization object index

        :param value: The Personalization object or Personalization object
                      index
        :type value: Personalization, integer
        Nr   r   s     r   r
   zSubstitution.personalizationF   s     !&r   c                 D    i }| j         | j        | j        || j         <   |S )z
        Get a JSON-ready representation of this Substitution.

        :returns: This Substitution, ready for use in a request body.
        :rtype: dict
        )r   r	   )r   substitutions     r   getzSubstitution.getP   s,     8DJ$:%)ZL"r   )NNN)__name__
__module____qualname____doc__r   propertyr   setterr	   r
   r    r   r   r   r      s         % % % %,   X 	Z  Z Q Q XQ \  \ % % X% & & &
 
 
 
 
r   r   N)objectr   r&   r   r   <module>r(      sC   Y Y Y Y Y6 Y Y Y Y Yr   