
    +h&                         d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZmZmZmZmZ d dlmZmZmZmZ d dlmZ  G d	 d
ed
   ed
   ed
         Zy)    )util)CreateableAPIResourceDeletableAPIResourceListableAPIResource)
ListObject)RequestOptions)class_method_variant)ClassVarListOptionalcastoverload)LiteralNotRequiredUnpackTYPE_CHECKING)
quote_plusc                      e Zd ZU dZdZeed      ed<   er7 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eed<   	 eed<   	 eed<   	 eed<   	 eed<   	 ee   ed<   	 ed   ed<   	 ed   ed<   	 eed      ed<   	 e	 	 	 d4dedee   dee   dee   ded   d d fd!       Zee	 	 	 d4dedee   dee   dee   ded   d d fd"              Ze	 d5d#ee   ded   d d fd$       Z ed%      	 d5d#ee   ded   d d fd&       Ze	 	 	 	 d6dee   d#ee   dee   de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	 	 	 d4dee   dee   dee   ded0   d ed    f
d1       Zededed2   d d fd3       Zy)7	TestClocka  
    A test clock enables deterministic control over objects in testmode. With a test clock, you can create
    objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances,
    you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.
    ztest_helpers.test_clockOBJECT_NAMEc                   *    e Zd ZU ed   ed<   	 eed<   y)TestClock.AdvanceParams	List[str]expandfrozen_timeN__name__
__module____qualname__r   __annotations__int     _/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/test_helpers/test_clock.pyAdvanceParamsr   !   s    ,, r#   r%   c                   <    e Zd ZU ed   ed<   	 eed<   	 ed   ed<   y)TestClock.CreateParamsr   r   r   strnameNr   r"   r#   r$   CreateParamsr'   +   s1    ,,  e$$r#   r*   c                       e Zd Zy)TestClock.DeleteParamsN)r   r   r   r"   r#   r$   DeleteParamsr,   9   s    r#   r-   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)	TestClock.ListParamsr(   ending_beforer   r   r!   limitstarting_afterNr   r   r   r   r    r"   r#   r$   
ListParamsr/   <   sH    &u--  ,, u%% (..r#   r4   c                       e Zd ZU ed   ed<   y)TestClock.RetrieveParamsr   r   Nr3   r"   r#   r$   RetrieveParamsr6   N   s    ,,r#   r7   createddeletes_afterr   idlivemoder)   object)	advancinginternal_failurereadystatusTdeletedN
test_clockapi_keystripe_versionstripe_accountparamsr   returnc                     t        d| j                  ddj                  t        j                  |            ||||            S )
        Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
        r   post1/v1/test_helpers/test_clocks/{test_clock}/advancerB   rC   rD   rE   rF   )r   _static_requestformatr   sanitize_id)clsrB   rC   rD   rE   rF   s         r$   _cls_advancezTestClock._cls_advancey   sZ     CJJ#//
; K   --   	
 	
r#   c                      yrI   Nr"   )rB   rC   rD   rE   rF   s        r$   advancezTestClock.advance   s     	r#   idempotency_keyc                      yrT   r"   selfrV   rF   s      r$   rU   zTestClock.advance   s     	r#   rR   c                     t        d| j                  ddj                  t        j                  | j                  d                  ||            S )rI   r   rJ   rK   r:   rL   )rV   rF   )r   _requestrO   r   rP   getrX   s      r$   rU   zTestClock.advance   sZ     MMCJJ#//? K  !0  

 
	
r#   r'   c                 `    t        d| j                  d| j                         |||||            S )z\
        Creates a new test clock that can be attached to new customers and quotes.
        r   rJ   )r   rN   	class_url)rQ   rC   rV   rD   rE   rF   s         r$   createzTestClock.create   s=     
 	
r#   sidr,   c                 z    | j                         dt        |      }t        d| j                  d||            S )'
        Deletes a test clock.
        /r   deleterF   )r^   r   r   rN   )rQ   r`   rF   urls       r$   _cls_deletezTestClock._cls_delete   s=     *S/:#f=
 	
r#   c                      yrb   Nr"   )r`   rF   s     r$   rd   zTestClock.delete   s     	r#   c                      yri   r"   rY   rF   s     r$   rd   zTestClock.delete   s     	r#   rg   c                 F    | j                  d| j                         |      S )rb   rd   re   )_request_and_refreshinstance_urlrk   s     r$   rd   zTestClock.delete   s.     (( ) 
 	
r#   r/   c                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )z5
        Returns a list of your test clocks.
        r\   rM   z%Expected list object from API, got %s)rN   r^   
isinstancer   	TypeErrortyper   )rQ   rC   rD   rE   rF   results         r$   listzTestClock.list  sf     $$MMO)) % 
 &*-7<((* 
 r#   r6   c                 8     | |fi |}|j                          |S )z)
        Retrieves a test clock.
        )refresh)rQ   r:   rF   instances       r$   retrievezTestClock.retrieve#  s$     r$V$r#   )NNN)N)NNNN) r   r   r   __doc__r   r
   r   r    r   r   r%   r*   r-   r4   r7   r!   r(   boolr   classmethodr   rR   r   staticmethodrU   r	   r_   rg   rd   r   rt   rx   r"   r#   r$   r   r      s    
 	" )* " 	N 		> 		> 		 	$	^ 	 L   	G N 3- -.. <== gdm$$  "&(,(,

 #
 !	

 !
 23
 

 
2  "&(,(,	

#
 !
 !	

 23
 

  
  *.!# 23 
	  .) *.
!#
 23
 
	
 *
(  "&)-(,(,
#
 "#
 !	

 !
 12
 

 
0 



!'(@!A

	

 

 "#;<	   78	  -(

78

	

 )

  "&(,(,	# ! !	
 /0 
K	  6  &'A B	 r#   r   N)striper   stripe.api_resources.abstractr   r   r    stripe.api_resources.list_objectr   stripe.request_optionsr   stripe.utilr	   typingr
   r   r   r   r   typing_extensionsr   r   r   r   urllib.parser   r   r"   r#   r$   <module>r      sR     
 8 1 , ; ; I I #[+&%$[r#   