U
    ä«FcÆ  ã                   @   s   G d d„ de ƒZdS )c                   @   sÆ   e Zd ZdZddd„Z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
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 )Ú
Ganalyticsz;Allows you to enable tracking provided by Google Analytics.Nc                 C   sp   d| _ d| _d| _d| _d| _d| _|  d|¡ |  d|¡ |  d|¡ |  d|¡ |  d|¡ |  d|¡ dS )aº  Create a GAnalytics to enable, customize Google Analytics tracking.

        :param enable: If this setting is enabled.
        :type enable: boolean, optional
        :param utm_source: Name of the referrer source.
        :type utm_source: string, optional
        :param utm_medium: Name of the marketing medium (e.g. "Email").
        :type utm_medium: string, optional
        :param utm_term: Used to identify paid keywords.
        :type utm_term: string, optional
        :param utm_content: Used to differentiate your campaign from ads.
        :type utm_content: string, optional
        :param utm_campaign: The name of the campaign.
        :type utm_campaign: string, optional
        NÚenableÚ
utm_sourceÚ
utm_mediumÚutm_termÚutm_contentÚutm_campaign)Ú_enableÚ_utm_sourceÚ_utm_mediumÚ	_utm_termÚ_utm_contentÚ_utm_campaignÚ_Ganalytics__set_field)Úselfr   r   r   r   r   r   © r   úD/tmp/pip-unpacked-wheel-7j3043uk/sendgrid/helpers/mail/ganalytics.pyÚ__init__   s    zGanalytics.__init__c                 C   s   |dk	rt | ||ƒ dS )zÖ Sets a field to the provided value if value is not None

        :param field: Name of the field
        :type field: string
        :param value: Value to be set, ignored if None
        :type value: Any
        N)Úsetattr)r   ÚfieldÚvaluer   r   r   Z__set_field(   s    zGanalytics.__set_fieldc                 C   s   | j S )zGIndicates if this setting is enabled.

        :rtype: boolean
        ©r   ©r   r   r   r   r   3   s    zGanalytics.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   r   r   r   r   r   ;   s    c                 C   s   | j S )zuName of the referrer source.
        e.g. Google, SomeDomain.com, or Marketing Email

        :rtype: string
        ©r	   r   r   r   r   r   D   s    zGanalytics.utm_sourcec                 C   s
   || _ dS )zåName of the referrer source.
        e.g. Google, SomeDomain.com, or Marketing Email

        :param value: Name of the referrer source.
        e.g. Google, SomeDomain.com, or Marketing Email
        :type value: string
        Nr   r   r   r   r   r   M   s    	c                 C   s   | j S )zKName of the marketing medium (e.g. Email).

        :rtype: string
        ©r
   r   r   r   r   r   X   s    zGanalytics.utm_mediumc                 C   s
   || _ dS )z‘Name of the marketing medium (e.g. Email).

        :param value: Name of the marketing medium (e.g. Email).
        :type value: string
        Nr   r   r   r   r   r   `   s    c                 C   s   | j S )zDUsed to identify any paid keywords.

        :rtype: string
        ©r   r   r   r   r   r   i   s    zGanalytics.utm_termc                 C   s
   || _ dS )zƒUsed to identify any paid keywords.

        :param value: Used to identify any paid keywords.
        :type value: string
        Nr   r   r   r   r   r   q   s    c                 C   s   | j S )zYUsed to differentiate your campaign from advertisements.

        :rtype: string
        ©r   r   r   r   r   r   z   s    zGanalytics.utm_contentc                 C   s
   || _ dS )z­Used to differentiate your campaign from advertisements.

        :param value: Used to differentiate your campaign from advertisements.
        :type value: string
        Nr   r   r   r   r   r   ‚   s    c                 C   s   | j S )z:The name of the campaign.

        :rtype: string
        ©r   r   r   r   r   r   ‹   s    zGanalytics.utm_campaignc                 C   s
   || _ dS )zoThe name of the campaign.

        :param value: The name of the campaign.
        :type value: string
        Nr   r   r   r   r   r   “   s    c                 C   s`   ddddddg}i }|D ]B}t | |dƒ}|dk	rt|tƒsDt|tƒrN|||< q| ¡ ||< q|S )zŸ
        Get a JSON-ready representation of this Ganalytics.

        :returns: This Ganalytics, ready for use in a request body.
        :rtype: dict
        r   r   r   r   r   r   N)ÚgetattrÚ
isinstanceÚboolÚstrÚget)r   ÚkeysZ
ganalyticsÚkeyr   r   r   r   r"   œ   s     ÿ
zGanalytics.get)NNNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úpropertyr   Úsetterr   r   r   r   r   r"   r   r   r   r   r      sD         ú
$












r   N)Úobjectr   r   r   r   r   Ú<module>   ó    