
    PIi.                     6    d dl Z d dlZd dlmZ  G d de      Zy)    N)DeliveryCategoryc            	          e Zd ZdZdddddddd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
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d Zd Zd Zd Zd Zd Zy)Contentzu
    Content objects that contain the product IDs associated with the event plus information about the products.
    strfloat)
product_idquantity
item_pricetitledescriptionbrandcategorydelivery_categoryNc	                    d | _         d | _        d | _        d | _        d | _        d | _        d | _        d | _        ||| _        ||| _	        ||| _
        ||| _        ||| _        ||| _        ||| _        ||| _        y y )N)_product_id	_quantity_item_price_title_description_brand	_category_delivery_categoryr   r	   r
   r   r   r   r   r   )	selfr   r	   r
   r   r   r   r   r   s	            |/var/www/webhook.estador.de/web/meta/bot/venv/lib/python3.12/site-packages/facebook_business/adobjects/serverside/content.py__init__zContent.__init__)   s       "&!(DO$DM!(DODJ"*DDJ$DM(%6D" )    c                     | j                   S )z6
        Gets Product Id.
        :rtype: str
        r   r   s    r   r   zContent.product_idO        r   c                     || _         y)z"
        Sets Product Id.
        Nr   )r   r   s     r   r   zContent.product_idW       
 &r   c                     | j                   S )z=
        Gets number of product.
        :rtype: int
        r   r   s    r   r	   zContent.quantity^        ~~r   c                     || _         y)z(
        Set number of product.
        Nr$   )r   r	   s     r   r	   zContent.quantityf       
 "r   c                     | j                   S )z8
        Gets Item Price.
        :rtype: float
        r   r   s    r   r
   zContent.item_pricem   r    r   c                     || _         y)z"
        Sets Item Price.
        Nr)   )r   r
   s     r   r
   zContent.item_priceu   r"   r   c                     | j                   S )z3
        Gets title.
        :rtype: float
        r   r   s    r   r   zContent.title|        {{r   c                     || _         y)z
        Sets title.
        Nr,   )r   r   s     r   r   zContent.title       
 r   c                     | j                   S )z9
        Gets description.
        :rtype: float
        r   r   s    r   r   zContent.description   s        r   c                     || _         y)z#
        Sets description.
        Nr1   )r   r   s     r   r   zContent.description   s    
 (r   c                     | j                   S )z3
        Gets brand.
        :rtype: float
        r   r   s    r   r   zContent.brand   r-   r   c                     || _         y)z
        Sets brand.
        Nr4   )r   r   s     r   r   zContent.brand   r/   r   c                     | j                   S )z6
        Gets category.
        :rtype: float
        r   r   s    r   r   zContent.category   r%   r   c                     || _         y)z 
        Sets category.
        Nr7   )r   r   s     r   r   zContent.category   r'   r   c                     | j                   S )z{Gets the Type of Delivery Category.

        :return: The Delivery Category type.
        :rtype: DeliveryCategory
        )r   r   s    r   r   zContent.delivery_category   s     &&&r   c                 N    t        |t              st        d|z         || _        y)zSets the Type of Delivery Category.

        Use with Purchase events.

        :param delivery_category: The Delivery Category type.
        :type: DeliveryCategory
        zMdelivery_category must be of type DeliveryCategory. Passed invalid category: N)
isinstancer   	TypeErrorr   )r   r   s     r   r   zContent.delivery_category   s0     +-=>kn  A  A"3r   c                 H   | j                   | j                  | j                  | j                  | j                  | j
                  | j                  d}| j                  | j                  j                  |d<   |j                         D ci c]  \  }}|	|| }}}|S c c}}w )N)idr	   r
   r   r   r   r   r   )
r   r	   r
   r   r   r   r   r   valueitems)r   normalized_payloadkvs       r   	normalizezContent.normalize   s    ////ZZ++ZZ
 !!-6:6L6L6R6R23/A/G/G/I[tq!Q]ad[[!! \s   	
BB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hasattrrG   )xs    r   <lambda>z!Content.to_dict.<locals>.<lambda>   s    WQ	-Baiik  r   rG   c                 T    t        | d   d      r| d   | d   j                         fS | S )N   rG   r   rH   )items    r   rK   z!Content.to_dict.<locals>.<lambda>   s3    tAw	2 #'q'47??+<!= 8< r   )six	iteritemsparam_typesgetattrr;   listmaprI   rG   dictr@   
issubclassr   )r   resultattr_r?   keys         r   rG   zContent.to_dict   s    }}T%5%56 	%GD!D$'E%&#CI%  t 	*$}}tE4(#C=KKM%  t  %t!	%" gt$"jjl $
U#s$ r   c                 H    t        j                  | j                               S )z.Returns the string representation of the model)pprintpformatrG   r   s    r   to_strzContent.to_str   s    ~~dlln--r   c                 "    | j                         S )zFor `print` and `pprint`)r^   r   s    r   __repr__zContent.__repr__   s    {{}r   c                 V    t        |t              sy| j                  |j                  k(  S )z&Returns true if both objects are equalF)r;   r   __dict__r   others     r   __eq__zContent.__eq__  s"    %)}}..r   c                     | |k(   S )z*Returns true if both objects are not equal rc   s     r   __ne__zContent.__ne__
  s    5=  r   )NNNNNNNN)__name__
__module____qualname____doc__rQ   r   propertyr   setterr	   r
   r   r   r   r   r   rD   rG   r^   r`   re   rh   rg   r   r   r   r      s    "	K $7L     & &   __" "     & &   \\  ! ! ( (   \\    __" " ' ' 4 4""6./!r   r   )r\   rO   8facebook_business.adobjects.serverside.delivery_categoryr   objectr   rg   r   r   <module>rq      s   *  
 Ur!f r!r   