
    Aix-              	           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mZ d dlmZmZmZmZmZmZ d dlmZmZmZ er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d   ed   ed   e	d         Z"y)    )CreateableAPIResource)DeletableAPIResource)
ListObject)ListableAPIResource)UpdateableAPIResource)class_method_variantsanitize_id)ClassVarDictListOptionalcastoverload)LiteralUnpackTYPE_CHECKING)WebhookEndpointCreateParams)WebhookEndpointDeleteParams)WebhookEndpointListParams)WebhookEndpointModifyParams)WebhookEndpointRetrieveParamsc                   Z   e Zd ZU dZdZeed      ed<   ee	   ed<   	 ee	   ed<   	 e
ed<   	 eed      ed<   	 ee	   ed	<   	 ee	   ed
<   	 e	ed<   	 eed<   	 ee	e	f   ed<   	 ed   ed<   	 ee	   ed<   	 e	ed<   	 e	ed<   	 eded   dd fd       Zeded   dd fd       Zede	ded   dd fd       Zeede	ded   dd fd              Zeded   dd fd       Z ed      ded   dd fd       Zede	ded   dd fd       Zeede	ded   dd fd              Zeded   dd fd        Z ed!      ded   dd fd"       Zeded#   ded    fd$       Zeded#   ded    fd%       Zede	ded&   dd fd'       Zede	ded&   dd fd(       Zede	ded)   dd fd*       Zede	ded)   dd fd+       Zy,)-WebhookEndpointa  
    You can configure [webhook endpoints](https://docs.stripe.com/webhooks/) via the API to be
    notified about events that happen in your Stripe account or connected
    accounts.

    Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints.

    Related guide: [Setting up webhooks](https://docs.stripe.com/webhooks/configure)
    webhook_endpointOBJECT_NAMEapi_versionapplicationcreatedTdeleteddescriptionenabled_eventsidlivemodemetadataobjectsecretstatusurlparamsr   returnc                 Z    t        d| j                  d| j                         |            S )  
        A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard.
        r   postr)   )r   _static_request	class_urlclsr)   s     K/var/www/html/immo/lib/python3.12/site-packages/stripe/_webhook_endpoint.pycreatezWebhookEndpoint.created   s6        
 	
    c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)r,   r   r-   r.   N)r   _static_request_asyncr0   r1   s     r3   create_asynczWebhookEndpoint.create_asynct   sD      ++ ,  
 	
s   ,97
	9sidr   c                 z    | j                         dt        |      }t        d| j                  d||            S )
        You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
        /r   deleter.   r0   r	   r   r/   r2   r9   r)   r(   s       r3   _cls_deletezWebhookEndpoint._cls_delete   sE     +c*:;   
 	
r5   c                      yr;   N r9   r)   s     r3   r=   zWebhookEndpoint.delete   s     	r5   c                      yrB   rC   selfr)   s     r3   r=   zWebhookEndpoint.delete   s     	r5   r@   c                 F    | j                  d| j                         |      S )r;   r=   r.   )_request_and_refreshinstance_urlrF   s     r3   r=   zWebhookEndpoint.delete   s.     (( ) 
 	
r5   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r;   r<   r   r=   r.   Nr0   r	   r   r7   r?   s       r3   _cls_delete_asyncz!WebhookEndpoint._cls_delete_async   sS      +c*:;++ ,  
 	
   <A	A
	A	c                    K   ywrB   rC   rD   s     r3   delete_asynczWebhookEndpoint.delete_async   s      	   c                    K   ywrB   rC   rF   s     r3   rP   zWebhookEndpoint.delete_async   s      	rQ   rM   c                 b   K   | j                  d| j                         |       d{   S 7 w)r;   r=   r.   N)_request_and_refresh_asyncrJ   rF   s     r3   rP   zWebhookEndpoint.delete_async   s<      44 5 
 
 	
 
s   &/-/r   c                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |S );
        Returns a list of your webhook endpoints.
        getr.   %Expected list object from API, got %s)r/   r0   
isinstancer   	TypeErrortype__name__r2   r)   results      r3   listzWebhookEndpoint.list   s]     $$MMO % 

 &*-7<((* 
 r5   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)rV   rW   r.   NrX   )r7   r0   rY   r   rZ   r[   r\   r]   s      r3   
list_asynczWebhookEndpoint.list_async   sk      00MMO 1 
 

 &*-7<((* 
 
s   &A"A 8A"r   c                 z    | j                         dt        |      }t        d| j                  d||            S )
        Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint.
        r<   r   r-   r.   r>   r2   r"   r)   r(   s       r3   modifyzWebhookEndpoint.modify  sD     +b/:   
 	
r5   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)rc   r<   r   r-   r.   NrL   rd   s       r3   modify_asynczWebhookEndpoint.modify_async  sR      +b/:++ ,  
 	
rN   r   c                 8     | |fi |}|j                          |S )C
        Retrieves the webhook endpoint with the given ID.
        )refreshr2   r"   r)   instances       r3   retrievezWebhookEndpoint.retrieve0  s$     r$V$r5   c                 T   K    | |fi |}|j                          d{    |S 7 w)ri   N)refresh_asyncrk   s       r3   retrieve_asynczWebhookEndpoint.retrieve_async;  s3      r$V$$$&&& 	's   (&(N) r\   
__module____qualname____doc__r   r
   r   __annotations__r   strintr   boolr   classmethodr   r4   r8   r@   r   staticmethodr=   r   rM   rP   r   r_   ra   re   rg   rm   rp   rC   r5   r3   r   r      s    :LK'"456K# # L gdm$$ # I 	G N 38n &'' SM K 
H 
;<
	
 
 
;<
	
 
 

!'(E!F
	
 
  "#@A	   <=	  -(

<=

	

 )

 

!'(E!F
	
 
  "#@A	   <=	  -.

<=

	

 /

 9:	%	& & 9:	%	& & 

 &'D E
	
 
  

 &'D E
	
 
   &'F G	   &'F G	 r5   r   N)#stripe._createable_api_resourcer   stripe._deletable_api_resourcer   stripe._list_objectr   stripe._listable_api_resourcer   stripe._updateable_api_resourcer   stripe._utilr   r	   typingr
   r   r   r   r   r   typing_extensionsr   r   r   -stripe.params._webhook_endpoint_create_paramsr   -stripe.params._webhook_endpoint_delete_paramsr   +stripe.params._webhook_endpoint_list_paramsr   -stripe.params._webhook_endpoint_modify_paramsr   /stripe.params._webhook_endpoint_retrieve_paramsr   r   rC   r5   r3   <module>r      sr    B ? * = A : A A < <
f+,*+)*+,	fr5   