
    PIi7                         d Z ddlmZ  G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Z G d de      Zy)z/
mixins contains attributes that objects share
    )FacebookBadObjectErrorc                       e Zd ZdZddZy)CanValidatez
    An instance of CanValidate will allow the ad objects
    to call remote_validate() to verify if its parameters are valid
    Nc                     |xs i }t        | j                        }t        | j                        }dg|d<   | j                  |       || _        || _        | S )Nvalidate_onlyexecution_optionsparams)dict_data_changessave)selfr
   
data_cachechanges_caches       f/var/www/webhook.estador.de/web/meta/bot/venv/lib/python3.12/site-packages/facebook_business/mixins.pyremote_validatezCanValidate.remote_validate   sV    2$**%
T]]+'6&7"#			 
%    N)__name__
__module____qualname____doc__r    r   r   r   r      s    r   r   c                   .    e Zd ZdZ	 	 	 ddZ	 	 	 	 ddZy)
CanArchivez
    An instance of CanArchive will allow the ad objects
    to call remote_delete() to be deleted using a POST request against
    the object's status field.
    Nc                 X    | j                  d| j                  j                  i|||      S Nstatus)r
   batchfailuresuccess)remote_updateStatusdeletedr   r    r!   r"   s       r   remote_deletezCanArchive.remote_delete&   s;     !!$++--  " 
 	
r   c                 X    | j                  d| j                  j                  i|||      S r   )r#   r$   archivedr&   s       r   remote_archivezCanArchive.remote_archive9   s;     !!$++..  " 
 	
r   )NNN)r   r   r   r   r'   r*   r   r   r   r   r      s,     	
 	
r   r   c                        e Zd ZdZed        Zy)CannotCreatez^
    An instance of CannotCreate will raise a TypeError when calling
    remote_create().
    c                 2    t        d| j                  z        )Nz Cannot create object of type %s.	TypeErrorr   clsargskwargss      r   remote_createzCannotCreate.remote_createQ       :S\\IJJr   N)r   r   r   r   classmethodr4   r   r   r   r,   r,   J       
 K Kr   r,   c                        e Zd ZdZed        Zy)CannotDeletez^
    An instance of CannotDelete will raise a TypeError when calling
    remote_delete().
    c                 2    t        d| j                  z        )Nz Cannot delete object of type %s.r.   r0   s      r   r'   zCannotDelete.remote_delete]   r5   r   N)r   r   r   r   r6   r'   r   r   r   r9   r9   V   r7   r   r9   c                        e Zd ZdZed        Zy)CannotUpdatez^
    An instance of CannotUpdate will raise a TypeError when calling
    remote_update().
    c                 2    t        d| j                  z        )Nz Cannot update object of type %s.r.   r0   s      r   r#   zCannotUpdate.remote_updatei   r5   r   N)r   r   r   r   r6   r#   r   r   r   r<   r<   b   r7   r   r<   c                   &    e Zd ZdZ G d de      Zy)HasObjectivezL
    An instance of HasObjective will have an enum attribute Objective.
    c                   `    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZy)HasObjective.ObjectiveAPP_INSTALLSBRAND_AWARENESSCONVERSIONSEVENT_RESPONSESLEAD_GENERATIONLINK_CLICKSLOCAL_AWARENESSMESSAGESOFFER_CLAIMSOUTCOME_APP_PROMOTIONOUTCOME_AWARENESSOUTCOME_ENGAGEMENTOUTCOME_LEADSOUTCOME_SALESOUTCOME_TRAFFIC
PAGE_LIKESPOST_ENGAGEMENTPRODUCT_CATALOG_SALESREACHSTORE_VISITSVIDEO_VIEWSN)r   r   r   app_installsbrand_awarenessconversionsevent_responseslead_generationlink_clickslocal_awarenessmessagesoffer_claimsoutcome_app_promotionoutcome_awarenessoutcome_engagementoutcome_leadsoutcome_salesoutcome_traffic
page_likespost_engagementproduct_catalog_salesreachstore_visitsvideo_viewsr   r   r   	ObjectiverA   t   so    %+#++#+% 7/1''+!
+ 7%#r   rl   N)r   r   r   r   objectrl   r   r   r   r?   r?   n   s    $F $r   r?   c                   &    e Zd ZdZ G d de      Zy)	HasStatuszF
    An instance of HasStatus will have an enum attribute Status.
    c                       e Zd ZdZdZdZdZy)HasStatus.StatusACTIVEARCHIVEDDELETEDPAUSEDN)r   r   r   activer)   r%   pausedr   r   r   r$   rq      s    r   r$   N)r   r   r   r   rm   r$   r   r   r   ro   ro      s     r   ro   c                   &    e Zd ZdZ G d de      Zy)
HasBidInfozH
    An instance of HasBidInfo will have an enum attribute BidInfo.
    c                        e Zd ZdZdZdZdZdZy)HasBidInfo.BidInfoACTIONSCLICKSIMPRESSIONSrT   SOCIALN)r   r   r   actionsclicksimpressionsri   socialr   r   r   BidInfor{      s    #r   r   N)r   r   r   r   rm   r   r   r   r   ry   ry      s    & r   ry   c                       e Zd ZddZddZy)HasAdLabelsNc           
          | j                         j                  d| j                         dfd|D cg c]  }d|i c}i      S c c}w )zAdds labels to an ad object.
        Args:
            labels: A list of ad label IDs
        Returns:
            The FacebookResponse object.
        POSTadlabelsidr	   get_api_assuredcallget_id_assuredr   labelslabels      r   
add_labelszHasAdLabels.add_labels   sV     ##%**  "J/F C5$ CD + 
 	
 !D   Ac           
          | j                         j                  d| j                         dfd|D cg c]  }d|i c}i      S c c}w )zRemove labels to an ad object.
        Args:
            labels: A list of ad label IDs
        Returns:
            The FacebookResponse object.
        DELETEr   r   r	   r   r   s      r   remove_labelszHasAdLabels.remove_labels   sV     ##%**  "J/F C5$ CD + 
 	
 !Dr   r   )r   r   r   r   r   r   r   r   r   r      s    

r   r   c                        e Zd Z fdZ xZS )ValidatesFieldsc                     || j                   j                  vr%t        d|d| j                  j                        t
        t        |   ||       y )N"z" is not a valid field of )Field__dict__r   	__class__r   superr   __setitem__)r   keyvaluer   s      r   r   zValidatesFields.__setitem__   sI    djj)))(//1 
 /44S%@r   )r   r   r   r   __classcell__)r   s   @r   r   r      s    A Ar   r   N)r   facebook_business.exceptionsr   rm   r   r   r,   r9   r<   r?   ro   ry   r   r   r   r   r   <module>r      s    @& "'
 '
V	K6 	K	K6 	K	K6 	K$6 $<
 
 
& 
8Af Ar   