
    PIi?N                     ~    d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ  G d	 d
e      Zy)    N)ActionSource)
CustomData)UserData)AppData)MessagingChannel)OriginalEventData)AttributionDatac                      e Zd Zi ddddddddddd	d
ddddddddddddddddddddZ	 	 	 	 	 dFdZed        Zej                  d        Zed         Zej                  d!        Zed"        Z	e	j                  d#        Z	ed$        Z
e
j                  d%        Z
ed&        Zej                  d'        Zed(        Zej                  d)        Zed*        Zej                  d+        Zed,        Zej                  d-        Zed.        Zej                  d/        Zed0        Zej                  d1        Zed2        Zej                  d3        Zed4        Zej                  d5        Zed6        Zej                  d7        Zed8        Zej                  d9        Zed:        Zej                  d;        Zed<        Zej                  d=        Zd> Zd? Zd@ ZdA ZdB ZdC ZdD ZdE Zy)GEvent
event_namestr
event_timeintevent_source_urlopt_outboolevent_id	user_datar   custom_datar   app_datar   data_processing_optionsz	list[str]data_processing_options_countrydata_processing_options_stateaction_sourcer   advanced_measurement_tablemessaging_channelr   original_event_datar   attribution_datar	   Nc                    d| _         d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        || _        || _        d| _        d| _        d| _        ||| _        ||| _        ||| _        ||| _        ||| _        ||| _        |	|	| _        |
|
| _        ||| _        ||| _        ||| _        ||| _        ||| _        ||| _        yy)zConversions API EventN) _event_name_event_time_event_source_url_opt_out	_event_id
_user_data_custom_data	_app_data_data_processing_options _data_processing_options_country_data_processing_options_state_action_source_advanced_measurement_tabler   r   _messaging_channel_original_event_data_attribution_datar   r   r   r   r   r   r   r   r   r   r   r   r   r   )selfr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s                    z/var/www/webhook.estador.de/web/meta/bot/venv/lib/python3.12/site-packages/facebook_business/adobjects/serverside/event.py__init__zEvent.__init__5   sS     !% (,%04-.2+"+/($$"&$(!!%'$4D!"DL$DM &DN"*D$DM".+BD(*63RD0(41ND.$!.D%1.HD+(%6D"*':D$'$4D! (    c                     | j                   S )zGets the event_name of this Event.

        A Facebook pixel Standard Event or Custom Event name.

        :return: The event_name of this Event.
        :rtype: str
        )r    r0   s    r1   r   zEvent.event_namel        r3   c                 ,    |t        d      || _        y)zSets the event_name of this Event.

        A Facebook pixel Standard Event or Custom Event name.

        :param event_name: The event_name of this Event.
        :type: str
        :return self
        Nz2Invalid value for `event_name`, must not be `None`)
ValueErrorr    )r0   r   s     r1   r   zEvent.event_namew   s     QRR%r3   c                     | j                   S )zGets the event_time of this Event.

        A Unix timestamp in seconds indicating when the actual event occurred.

        :return: The event_time of this Event.
        :rtype: int
        )r!   r5   s    r1   r   zEvent.event_time   r6   r3   c                 b    |t        d      t        |t              st        d      || _        y)zSets the event_time of this Event.

        A Unix timestamp in seconds indicating when the actual event occurred.

        :param event_time: The event_time of this Event.
        :type: int
        Nz2Invalid value for `event_time`, must not be `None`zEvent.event_time must be an int)r8   
isinstancer   	TypeErrorr!   )r0   r   s     r1   r   zEvent.event_time   s4     QRR*c*=>>%r3   c                     | j                   S )zGets the event_source_url of this Event.

        The browser URL where the event happened.

        :return: The event_source_url of this Event.
        :rtype: str
        r"   r5   s    r1   r   zEvent.event_source_url        %%%r3   c                     || _         y)zSets the event_source_url of this Event.

        The browser URL where the event happened.

        :param event_source_url: The event_source_url of this Event.
        :type: str
        Nr>   )r0   r   s     r1   r   zEvent.event_source_url   s     "2r3   c                     | j                   S )a  Gets the opt_out of this Event.

        A flag that indicates we should not use this event for ads delivery optimization.
        If set to true, we only use the event for attribution.

        :return: The opt_out of this Event.
        :rtype: bool
        )r#   r5   s    r1   r   zEvent.opt_out   s     }}r3   c                 H    t        |t              st        d      || _        y)a
  Sets the opt_out of this Event.

        A flag that indicates we should not use this event for ads delivery optimization.
        If set to true, we only use the event for attribution.

        :param opt_out: The opt_out of this Event.
        :type: bool
        zEvent.opt_out must be a boolN)r;   r   r<   r#   )r0   r   s     r1   r   zEvent.opt_out   s!     '4(:;;r3   c                     | j                   S )a  Gets the event_id of this Event.

        This ID can be any string chosen by the advertiser.
        This is used with event_name to determine if events sent from
        both server and browser are identical.

        :return: The event_id of this Event.
        :rtype: str
        r$   r5   s    r1   r   zEvent.event_id   s     ~~r3   c                     || _         y)a$  Sets the event_id of this Event.

        This ID can be any string chosen by the advertiser.
        This is used with event_name to determine if events sent from
        both server and browser are identical.

        :param event_id: The event_id of this Event.
        :type: str
        NrD   )r0   r   s     r1   r   zEvent.event_id   s     "r3   c                     | j                   S )zsGets the user_data of this Event.


        :return: The user_data of this Event.
        :rtype: UserData
        )r%   r5   s    r1   r   zEvent.user_data   s     r3   c                 b    |t        d      t        |t              st        d      || _        y)z{Sets the user_data of this Event.


        :param user_data: The user_data of this Event.
        :type: UserData
        Nz1Invalid value for `user_data`, must not be `None`z(Event.user_Data must be of type UserData)r8   r;   r   r<   r%   )r0   r   s     r1   r   zEvent.user_data   s3     PQQ)X.FGG#r3   c                     | j                   S )zyGets the custom_data of this Event.


        :return: The custom_data of this Event.
        :rtype: CustomData
        )r&   r5   s    r1   r   zEvent.custom_data	  s        r3   c                 H    t        |t              st        d      || _        y)zSets the custom_data of this Event.


        :param custom_data: The custom_data of this Event.
        :type: CustomData
        z,Event.custom_data must be of type CustomDataN)r;   r   r<   r&   )r0   r   s     r1   r   zEvent.custom_data  s"     +z2JKK'r3   c                     | j                   S )zoGets the app_data of this Event.

        :return: The app_data of this Event.
        :rtype: AppData
        )r'   r5   s    r1   r   zEvent.app_data!  s     ~~r3   c                 H    t        |t              st        d      || _        y)zvSets the app_data of this Event.

        :param app_data: The app_data of this Event.
        :type: AppData
        z&Event.app_data must be of type AppDataN)r;   r   r<   r'   )r0   r   s     r1   r   zEvent.app_data*  s!     (G,DEE!r3   c                     | j                   S )zGets the data_processing_options of this Event.

        :return: The data_processing_options of this Event.
        :rtype: list[str]
        r(   r5   s    r1   r   zEvent.data_processing_options6  s     ,,,r3   c                     || _         y)aX  Sets the data_processing_options of this Event.
        Processing options you would like to enable for a specific event.
        For more details see https://developers.facebook.com/docs/marketing-apis/data-processing-options

        :param data_processing_options: The data_processing_options of this Event.
        :type: list[str]
        NrM   )r0   r   s     r1   r   zEvent.data_processing_options?  s     )@%r3   c                     | j                   S )zGets the data_processing_options_country of this Event.

        :return: The data_processing_options_country of this Event.
        :rtype: int
        )r)   r5   s    r1   r   z%Event.data_processing_options_countryK  s     444r3   c                 H    t        |t              st        d      || _        y)aq  Sets the data_processing_options_country of this Event.
        A country that you want to associate to this data processing option.
        For more details: https://developers.intern.facebook.com/docs/marketing-apis/data-processing-options

        :param data_processing_options_country: The data_processing_options_country of this Event.
        :type: int
        z4Event.data_processing_options_country must be an intN)r;   r   r<   r)   )r0   r   s     r1   r   z%Event.data_processing_options_countryT  s#     93?RSS0O-r3   c                     | j                   S )zGets the data_processing_options_state of this Event.

        :return: The data_processing_options_state of this Event.
        :rtype: int
        r*   r5   s    r1   r   z#Event.data_processing_options_statec  s     222r3   c                     || _         y)aX  Sets the data_processing_options_state of this Event.
        A state that you want to associate with this data processing option.
        For more details: https://developers.facebook.com/docs/marketing-apis/data-processing-options

        :param data_processing_options: The data_processing_options of this Event.
        :type: int
        NrR   )r0   r   s     r1   r   z#Event.data_processing_options_statel  s     /L+r3   c                     | j                   S )zGets the action_source.

        Allows you to specify where the conversion occurred.

        :return: The action_source.
        :rtype: ActionSource
        r+   r5   s    r1   r   zEvent.action_sourcex  s     """r3   c                     || _         y)zSets the action_source.

        Allows you to specify where the conversion occurred.

        :param action_source: The action_source.
        :type: ActionSource
        NrU   r0   r   s     r1   r   zEvent.action_source  s     ,r3   c                     | j                   S )zGets the advanced_measurement_table.

        Only used for the Advanced Measurement API in the Advanced Analytics product.

        :return: The advanced_measurement_table.
        :rtype: str
        r,   r5   s    r1   r   z Event.advanced_measurement_table  s     ///r3   c                     || _         y)zSets the advanced_measurement_table.

        Only used for the Advanced Measurement API in the Advanced Analytics product.

        :param advanced_measurement_table: The advanced_measurement_table.
        :type: str
        NrY   )r0   r   s     r1   r   z Event.advanced_measurement_table  s     ,F(r3   c                     | j                   S )zGets the messaging_channel.

        Return the messaging channel of the event.

        :return: The messaging_channel.
        :rtype: str
        r-   r5   s    r1   r   zEvent.messaging_channel  s     &&&r3   c                     || _         y)zSets the advanced_measurement_table.

        Allow you to specify the messaging channel of the event.

        :param messaging_channel: The messaging_channel.
        :type: str
        Nr\   r0   r   s     r1   r   zEvent.messaging_channel  s     #4r3   c                     | j                   S )zGets the original_event_data.

        Return the original_event_data of the event.

        :return: The original_event_data.
        :rtype: OriginalEventData
        r.   r5   s    r1   r   zEvent.original_event_data  s     (((r3   c                     || _         y)zSets the original_event_data.

        Allow you to specify the original_event_data of the event.

        :param original_event_data: The original_event_data.
        :type: OriginalEventData
        Nr`   )r0   r   s     r1   r   zEvent.original_event_data  s     %8!r3   c                     | j                   S )zGets the attribution_data.

        Return the attribution_data of the event.

        :return: The attribution_data.
        :rtype: AttributionData
        r/   r5   s    r1   r   zEvent.attribution_data  r?   r3   c                     || _         y)zSets the attribution_data.

        Allow you to specify the attribution_data of the event.

        :param attribution_data: The attribution_data.
        :type: AttributionData
        Nrc   )r0   r   s     r1   r   zEvent.attribution_data  s     "2r3   c           
         | j                   | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  d	}| j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  4| j                  | j                         | j                  j                  |d<   | j                   4| j#                  | j                          | j                   j                  |d<   | j$                  | j$                  j                         |d<   | j&                  | j&                  j                         |d<   |j)                         D ci c]  \  }}|	|| }}}|S c c}}w )	N)	r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   	normalizer   r   r   validate_action_sourcevaluer   validate_messaging_channelr   r   items)r0   normalized_payloadkvs       r1   rf   zEvent.normalize  s   ,0OO4??262G2GTXT`T`*.--TXTpTpBFBfBf?C?a?a<@<[<[^ >>%.2nn.F.F.H{+'040@0@0J0J0L}-==$-1]]-D-D-Fz*)''(:(:;262D2D2J2J/!!-++D,B,BC6:6L6L6R6R23##/8<8P8P8Z8Z8\45  ,595J5J5T5T5V12 0B/G/G/I[tq!Q]ad[[!! \s   
GGc                 D    t        |      t        k(  st        d|z        y )Nz=action_source must be an ActionSource. TypeError on value: %s)typer   r<   rW   s     r1   rg   zEvent.validate_action_source
  s*    M"l2OR__  3r3   c                 D    t        |      t        k(  st        d|z        y )NzFmessaging_channel must be an messaging_channel. TypeError on value: %s)ro   r   r<   r^   s     r1   ri   z Event.validate_messaging_channel  s,    %&*::X[ll  ;r3   c                    i }t        j                  | j                        D ]  \  }}t        | |      }t	        |t
              rt        t        d |            ||<   <t        |d      r|j                         ||<   \t	        |t              r(t        t        d |j                                     ||<   |||<    t        t        t              r| j                         D ]
  \  }}|||<    |S )z&Returns the model properties as a dictc                 >    t        | d      r| j                         S | S )Nto_dicthasattrrs   )xs    r1   <lambda>zEvent.to_dict.<locals>.<lambda>  s    WQ	-Baiik  r3   rs   c                 T    t        | d   d      r| d   | d   j                         fS | S )N   rs   r   rt   )items    r1   rw   zEvent.to_dict.<locals>.<lambda>&  s3    tAw	2 #'q'47??+<!= 8< r3   )six	iteritemsparam_typesgetattrr;   listmapru   rs   dictrj   
issubclassr   )r0   resultattr_rh   keys         r1   rs   zEvent.to_dict  s    }}T%5%56 	%GD!D$'E%&#CI%  t 	*$}}tE4(#C=KKM%  t  %t!	%" eT""jjl $
U#s$ r3   c                 H    t        j                  | j                               S )z.Returns the string representation of the model)pprintpformatrs   r5   s    r1   to_strzEvent.to_str2  s    ~~dlln--r3   c                 "    | j                         S )zFor `print` and `pprint`)r   r5   s    r1   __repr__zEvent.__repr__6  s    {{}r3   c                 V    t        |t              sy| j                  |j                  k(  S )z&Returns true if both objects are equalF)r;   r   __dict__r0   others     r1   __eq__zEvent.__eq__:  s"    %'}}..r3   c                     | |k(   S )z*Returns true if both objects are not equal r   s     r1   __ne__zEvent.__ne__A  s    5=  r3   )NNNNNNNNNNNNNNNN)__name__
__module____qualname__r}   r2   propertyr   setterr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rf   rg   ri   rs   r   r   r   r   r   r3   r1   r   r   !   s   ee 	E 	6	
 	E 	Z 	| 	I 	"; 	*5 	( 	 	%e 	/ 	2  	-!K& QURVdh EI@D	55n     & &     & &  & & 	2 	2 	 	 ^^    
 
 __" "   $ $ ! ! ( (   __	" 	" - - ##	@ $	@ 5 5 %++P ,P 3 3 #))	L *	L # # 	, 	, 0 0  &&F 'F ' ' 4 4 ) ) 8  8 & & 2 2!"F6./!r3   r   )r   r{   4facebook_business.adobjects.serverside.action_sourcer   2facebook_business.adobjects.serverside.custom_datar   0facebook_business.adobjects.serverside.user_datar   /facebook_business.adobjects.serverside.app_datar   8facebook_business.adobjects.serverside.messaging_channelr   :facebook_business.adobjects.serverside.original_event_datar   7facebook_business.adobjects.serverside.attribution_datar	   objectr   r   r3   r1   <module>r      s0   *  
 M I E C U X Sb!F b!r3   