
    _j9                        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 d dlmZmZmZ er0d 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$ d dl%m&Z&  G d ded         ed                   Z'dS )    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)StripeObject)class_method_variantsanitize_id)ClassVarListOptionalcastoverload)LiteralUnpackTYPE_CHECKING)Customer)Meter)AlertActivateParams)AlertArchiveParams)AlertCreateParams)AlertDeactivateParams)AlertListParams)AlertRetrieveParamsc                   2   e Zd ZU dZdZeed                  ed<    G d de          Z	ed         ed<   	 e
ed<   	 eed	<   	 ed         ed
<   	 eed                  ed<   	 e
ed<   	 ee	         ed<   	 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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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d0                        Zeded)         dd fd1            Z ed2          ded)         dd fd3            Zeded4         de d          fd5            Z!eded4         de d          fd6            Z"ede
ded7         dd fd8            Z#ede
ded7         dd fd9            Z$de	iZ%d:S );Alertz
    A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
    zbilling.alertOBJECT_NAMEc                       e Zd ZU  G d de          Zeee                  ed<   	 eed<   	 e	d         ed<   	 e
d         ed<   	 deiZd	S )
Alert.UsageThresholdc                   J    e Zd ZU eed                  ed<   	 ed         ed<   dS )Alert.UsageThreshold.Filterr   customertypeN)__name__
__module____qualname__r   r   __annotations__r        Y/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/stripe/billing/_alert.pyFilterr    %   s@         z:;;;; *%%%%%%r(   r*   filtersgter   meterone_time
recurrenceN)r#   r$   r%   r   r*   r   r   r&   intr   r   _inner_class_typesr'   r(   r)   UsageThresholdr   $   s         	& 	& 	& 	& 	&\ 	& 	& 	& $v,''''	 	 w''''	 J''''	 (0r(   r2   usage_threshold
alert_typeidlivemodeobject)activearchivedinactivestatustitleparamsr   returnc                     t          d|                     dd                    t          |                    |                    S )G
        Reactivates this alert, allowing it to trigger again.
        r   post /v1/billing/alerts/{id}/activater5   r=   r   _static_requestformatr	   clsr5   r=   s      r)   _cls_activatezAlert._cls_activate[   sQ     299[__9MM    
 
 	
r(   c                     dS r@   Nr'   r5   r=   s     r)   activatezAlert.activatek   	     	r(   c                     dS rL   r'   selfr=   s     r)   rN   zAlert.activates   	    
 	r(   rJ   c                     t          d|                     dd                    t          |                     d                              |                    S )r@   r   rA   rB   r5   rC   rD   r   _requestrG   r	   getrQ   s     r)   rN   zAlert.activatez   sd     MM299"488D>>22 :      	
 	
 		
r(   c                    K   t          d|                     dd                    t          |                    |           d{V           S )r@   r   rA   rB   rC   rD   Nr   _static_request_asyncrG   r	   rH   s      r)   _cls_activate_asynczAlert._cls_activate_async   ss       ++299[__9MM ,        
 
 	
r(   c                 
   K   dS rL   r'   rM   s     r)   activate_asynczAlert.activate_async          	r(   c                 
   K   dS rL   r'   rQ   s     r)   r]   zAlert.activate_async          	r(   r[   c                    K   t          d|                     dd                    t          |                     d                              |           d{V           S )r@   r   rA   rB   r5   rC   rD   Nr   _request_asyncrG   r	   rW   rQ   s     r)   r]   zAlert.activate_async   s       %%299"488D>>22 :    &        	
 	
 		
r(   r   c                     t          d|                     dd                    t          |                    |                    S )g
        Archives this alert, removing it from the list view and APIs. This is non-reversible.
        r   rA   /v1/billing/alerts/{id}/archiverC   rD   rE   rH   s      r)   _cls_archivezAlert._cls_archive   sQ     188KOO8LL    
 
 	
r(   c                     dS re   Nr'   rM   s     r)   archivezAlert.archive   rO   r(   c                     dS ri   r'   rQ   s     r)   rj   zAlert.archive   rS   r(   rg   c                     t          d|                     dd                    t          |                     d                              |                    S )re   r   rA   rf   r5   rC   rD   rU   rQ   s     r)   rj   zAlert.archive   sd     MM188"488D>>22 9      	
 	
 		
r(   c                    K   t          d|                     dd                    t          |                    |           d{V           S )re   r   rA   rf   rC   rD   NrY   rH   s      r)   _cls_archive_asynczAlert._cls_archive_async   ss       ++188KOO8LL ,        
 
 	
r(   c                 
   K   dS ri   r'   rM   s     r)   archive_asynczAlert.archive_async  r^   r(   c                 
   K   dS ri   r'   rQ   s     r)   rp   zAlert.archive_async  r`   r(   rn   c                    K   t          d|                     dd                    t          |                     d                              |           d{V           S )re   r   rA   rf   r5   rC   rD   Nrb   rQ   s     r)   rp   zAlert.archive_async  s       %%188"488D>>22 9    &        	
 	
 		
r(   r   c                 r    t          d|                     d|                                 |                    S ))
        Creates a billing alert
        r   rA   rD   )r   rF   	class_urlrI   r=   s     r)   createzAlert.create'  sB    
     
 
 	
r(   c                    K   t          d|                     d|                                 |           d{V           S )rt   r   rA   rD   N)r   rZ   ru   rv   s     r)   create_asynczAlert.create_async5  sd       ++ ,        
 
 	
r(   r   c                     t          d|                     dd                    t          |                    |                    S )H
        Deactivates this alert, preventing it from triggering.
        r   rA   "/v1/billing/alerts/{id}/deactivaterC   rD   rE   rH   s      r)   _cls_deactivatezAlert._cls_deactivateE  sZ     4;;"2 <       	
 	
 		
r(   c                     dS r{   Nr'   rM   s     r)   
deactivatezAlert.deactivateW  s	     	r(   c                     dS r   r'   rQ   s     r)   r   zAlert.deactivatea  rS   r(   r}   c                     t          d|                     dd                    t          |                     d                              |                    S )r{   r   rA   r|   r5   rC   rD   rU   rQ   s     r)   r   zAlert.deactivateh  sd     MM4;;"488D>>22 <      	
 	
 		
r(   c                    K   t          d|                     dd                    t          |                    |           d{V           S )r{   r   rA   r|   rC   rD   NrY   rH   s      r)   _cls_deactivate_asynczAlert._cls_deactivate_asyncz  s|       ++4;;"2 <    ,        	
 	
 		
r(   c                 
   K   dS r   r'   rM   s     r)   deactivate_asynczAlert.deactivate_async  r^   r(   c                 
   K   dS r   r'   rQ   s     r)   r   zAlert.deactivate_async  r`   r(   r   c                    K   t          d|                     dd                    t          |                     d                              |           d{V           S )r{   r   rA   r|   r5   rC   rD   Nrb   rQ   s     r)   r   zAlert.deactivate_async  s       %%4;;"488D>>22 <    &        	
 	
 		
r(   r   c                     |                      d|                                 |          }t          |t                    s$t	          dt          |          j        z            |S ):
        Lists billing active and inactive alerts
        rW   rD   %Expected list object from API, got %s)rF   ru   
isinstancer   	TypeErrorr"   r#   rI   r=   results      r)   listz
Alert.list  sp    
 $$MMOO % 
 

 &*-- 	7<<(*  
 r(   c                    K   |                      d|                                 |           d{V }t          |t                    s$t	          dt          |          j        z            |S )r   rW   rD   Nr   )rZ   ru   r   r   r   r"   r#   r   s      r)   
list_asynczAlert.list_async  s       00MMOO 1 
 
 
 
 
 
 
 

 &*-- 	7<<(*  
 r(   r   c                 @     | |fi |}|                                  |S )7
        Retrieves a billing alert given an ID
        )refreshrI   r5   r=   instances       r)   retrievezAlert.retrieve  s2     3r$$V$$r(   c                 P   K    | |fi |}|                                  d{V  |S )r   N)refresh_asyncr   s       r)   retrieve_asynczAlert.retrieve_async  sH       3r$$V$$$$&&&&&&&&&r(   N)&r#   r$   r%   __doc__r   r
   r   r&   r   r2   strboolr   classmethodr   rJ   r   staticmethodrN   r   r[   r]   rg   rj   rn   rp   rw   ry   r}   r   r   r   r   r   r   r   r   r1   r'   r(   r)   r   r      sM          7FK'/23EEE1 1 1 1 1 1 1 14 )**** 	GGG NNN O$$$$ W=>???? JJJ n---- 

 &'< =
	
 
 
 [
 S F+@$A g    \ X (=!> 7    X /**
45
	
 
 
 +*
" 

 &'< =
	
 
 
 [
 !"78	   \ X 45	   X /00
45
	
 
 
 10
" 

 &'; <
	
 
 
 [
 C 6*>#? G    \ X '; <     X .))
34
	
 
 
 *)
" 

 &'; <
	
 
 
 [
 !"67	   \ X 34	   X .//
34
	
 
 
 0/
" 
f%89 
g 
 
 
 [
 
12
	
 
 
 [
 

 &'> ?
	
 
 
 [
" !"9:	   \ X 6*A#B w    X +,,
67
	
 
 
 -,
" 

 &'> ?
	
 
 
 [
" !"9:	   \ X 67	   X 122
67
	
 
 
 32
" F#45 *W:M    [" /0	G	   [&  &'< =	   [  &'< =	   [ ,^<r(   r   N)(stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._stripe_objectr   stripe._utilr   r	   typingr
   r   r   r   r   typing_extensionsr   r   r   stripe._customerr   stripe.billing._meterr   ,stripe.params.billing._alert_activate_paramsr   +stripe.params.billing._alert_archive_paramsr   *stripe.params.billing._alert_create_paramsr   .stripe.params.billing._alert_deactivate_paramsr   (stripe.params.billing._alert_list_paramsr   ,stripe.params.billing._alert_retrieve_paramsr   r   r'   r(   r)   <module>r      s   B A A A A A 4 4 4 4 4 4 * * * * * * = = = = = = . . . . . . : : : : : : : : ; ; ; ; ; ; ; ; ; ; ; ; ; ; < < < < < < < < < < ))))))++++++      ONNNNNLLLLLL      IHHHHH     
P= P= P= P= P=!'*,?,H P= P= P= P= P=r(   