+
     Iiw9  c                   s   ^ RI t ^ RIt^ RIHt ^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^RIHt ^RIHtHtHt ] P&                  ! ]4      tR	 tR
 t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      tR# )i    N)partial)with_current_context)WaiterDocstring)register_feature_id)get_service_module_name)
xform_name)ClientErrorWaiterConfigErrorWaiterErrorc                s   VP                  V 4      p\        VP                  4      p\        \	        W$4      4      pR p\        V VP                  P                  VP                  P                  VRR7      Vn	        \        \        VP                  P                  4       RV  24      p\        V\        3RV/4      pV! WV4      # )a  

:type waiter_name: str
:param waiter_name: The name of the waiter.  The name should match
    the name (including the casing) of the key name in the waiter
    model file (typically this is CamelCasing).

:type waiter_model: botocore.waiter.WaiterModel
:param waiter_model: The model for the waiter configuration.

:type client: botocore.client.BaseClient
:param client: The botocore client associated with the service.

:rtype: botocore.waiter.Waiter
:return: The waiter object.

c                 s4    \         P                  ! V 3/ VB  R # N)Waiterwait)selfkwargss   &,4/usr/lib/python3.14/site-packages/botocore/waiter.pyr   Z'create_waiter_with_client.<locals>.wait9   s    D#F#    F)waiter_nameZevent_emitterservice_modelZservice_waiter_modelZinclude_signaturez.Waiter.r   )
get_waiterr   	operationNormalizedOperationMethodZgetattrr   ZmetaZeventsr   __doc__Zstrr   Ztyper
   )	r   Zwaiter_modelZclientsingle_waiter_configZoperation_nameoperation_methodr   Zwaiter_class_nameZdocumented_waiter_clss	   &&&      r   create_waiter_with_clientr      s    $ (22;? 4 > >?N0'$ #kk((kk//)DL "6;;#<#<=
>h{mT
 !!2VI~N !+; r   c                 sf    V P                  R 4      p\        V\        4      '       d
   RV9   d   R# R# )ErrorCodeTF)get
isinstanceZdict)responseerrors   & r   is_valid_waiter_errorr   R   s)    LL!E%6U?r   c                   s,   a  ] tR t^Yt o R tR tRtV tR# )r   c                s    Wn         R # r	   _client_method)r   Zclient_method   &&r   __init__Z"NormalizedOperationMethod.__init__Z   s    +r   c                sp     V P                   ! R/ VB #   \         d   pTP                  u R p?# R p?ii ; i)N )r!   r   r   )r   r   Zes   &, r   __call__Z"NormalizedOperationMethod.__call__]   s5    	&&000 	::	s    5055r    N)__name__
__module____qualname____firstlineno__r#   r%   __static_attributes____classdictcell__Z__classdict__   @r   r   r   Y   s     , r   r   c                   s6   a  ] tR t^dt o ^tR tR tR tRtV t	R# )WaiterModelc                s    VR,          V n         VP                  RR4      pV P                  V4       W n        \	        \        VR,          P                  4       4      4      V n        R# )a  

Note that the WaiterModel takes ownership of the waiter_config.
It may or may not mutate the waiter_config.  If this is a concern,
it is best to make a copy of the waiter config before passing it to
the WaiterModel.

:type waiter_config: dict
:param waiter_config: The loaded waiter config
    from the <service>*.waiters.json file.  This can be
    obtained from a botocore Loader object as well.

ZwaitersversionZunknownN)_waiter_configr   _verify_supported_versionr/   listZsortedZkeyswaiter_names)r   Zwaiter_configr/      && r   r#   ZWaiterModel.__init__g   sX     ,I6
  ##Iy9&&w/ i(@(E(E(G!HIr   c                s^    WP                   8w  d   \        R V P                    RV 2R7      hR# )z7Unsupported waiter version, supported version must be: z#, but version of waiter config is: Z	error_msgN)SUPPORTED_VERSIONr   )r   r/   r"   r   r1   Z%WaiterModel._verify_supported_version   s@    ,,,#  $ 6 67 8,,396  -r   c                sz     V P                   V,          p\        T4      #   \         d    \        R T 24      hi ; i)zWaiter does not exist: )r0   ZKeyErrorZ
ValueErrorSingleWaiterConfig)r   r   r   r4   r   r   ZWaiterModel.get_waiter   sM    	F#'#6#6{#C  ""677  	F6{mDEE	Fs     :)r0   r/   r3   N)
r&   r'   r(   r)   r6   r#   r1   r   r*   r+   r,   r-   r   r.   r.   d   s      J08 8r   r.   c                   s:   a  ] tR t^t o RtR t]R 4       tRtV t	R# )r7   zRepresents the waiter configuration for a single waiter.

A single waiter is considered the configuration for a single
value associated with a named waiter (i.e TableExists).

c                s    Wn         VP                  R R4      V n        VR,          V n        VR,          V n        VR,          V n        R# )description r   delayZmaxAttemptsN)_configr   r8   r   r:   max_attempts)r   r   r"   r   r#   ZSingleWaiterConfig.__init__   sC    + 033M2F-k:)'2
0?r   c                sv    . pV P                   R ,           F  p\        V4      pVP                  V4       K!  	  V# )	acceptors)r;   AcceptorConfigZappend)r   r=   Zacceptor_configacceptors   &   r   r=   ZSingleWaiterConfig.acceptors   s=    	#||K88O%o6HX&  9 r   )r;   r:   r8   r<   r   N)
r&   r'   r(   r)   r   r#   propertyr=   r*   r+   r,   r-   r   r7   r7      s$     @  r   r7   c                   sZ   a  ] tR t^t o R t]R 4       tR tR tR t	R t
R tR tR	tV tR
# )r>   c                s    VR ,          V n         VR,          V n        VR,          V n        VP                  R4      V n        V P                  4       V n        R# )statematcherexpectedargumentN)rA   rB   rC   r   rD   _create_matcher_funcmatcher_func)r   configr"   r   r#   ZAcceptorConfig.__init__   sF    G_
i(z*

:. 557r   c                s   V P                   R 8X  d   RV P                   RV P                   R2# V P                   R8X  d   RV P                   RV P                   R2# V P                   R8X  d   RV P                   RV P                   R2# V P                   R8X  d   R	V P                   2# V P                   R
8X  d   RV P                   2# RV P                    R2# )pathzFor expression "z" we matched expected path: "Z"pathAllz&" all members matched expected path: "pathAnyz" at least oncestatusz#Matched expected HTTP status code: r   z%Matched expected service error code: z)No explanation for unknown waiter type: ")rB   rD   rC   r      &r   explanationZAcceptorConfig.explanation   s    <<6!%dmm_4QRVR_R_Q``abb\\Y&"4==/ 2##'==/4 \\Y&"4==/ 2--9 \\X%8HH\\W$:4==/JJ>t||nANNr   c                s~   V P                   R 8X  d   V P                  4       # V P                   R8X  d   V P                  4       # V P                   R8X  d   V P                  4       # V P                   R8X  d   V P	                  4       # V P                   R8X  d   V P                  4       # \        RV P                    2R7      h)rH   rI   rJ   rK   r   zUnknown acceptor: r5   )rB   _create_path_matcher_create_path_all_matcher_create_path_any_matcher_create_status_matcher_create_error_matcherr   rL   rM   r   rE   Z#AcceptorConfig._create_matcher_func   s     <<6!,,..\\Y&0022\\Y&0022\\X%..00\\W$--//#.t||n= r   c                p   aa \         P                  ! V P                  4      oV P                  oVV3R  lpV# )c                 sR   < \        V 4      '       d   R # SP                  V 4      S8H  # r	   )r   search)r   rC   
expressions   &r   acceptor_matchesZ=AcceptorConfig._create_path_matcher.<locals>.acceptor_matches   s'    $X..$$X.(::r   jmespathZcompilerD   rC   r   rW   rC   rV      & @@r   rO   Z#AcceptorConfig._create_path_matcher   s-    %%dmm4
==	;
  r   c                rT   )c                 s   < \        V 4      '       d   R # SP                  V 4      p\        V\        4      '       d	   V'       g   R# V F  pVS8w  g   K   R# 	  R# NFTr   rU   r   r2   r   ZresultZelementrC   rV      &  r   rW   ZAAcceptorConfig._create_path_all_matcher.<locals>.acceptor_matches   sO    $X..&&x0Ffd++6
 !h&  " r   rX   rZ   r[   r   rP   Z'AcceptorConfig._create_path_all_matcher   s-    %%dmm4
==	  r   c                rT   )c                 s   < \        V 4      '       d   R # SP                  V 4      p\        V\        4      '       d	   V'       g   R# V F  pVS8X  g   K   R# 	  R# r\   r]   r^   r_   r   rW   ZAAcceptorConfig._create_path_any_matcher.<locals>.acceptor_matches  sO    $X..&&x0Ffd++6
 !h& " r   rX   rZ   r[   r   rQ   Z'AcceptorConfig._create_path_any_matcher  s-    %%dmm4
==	  r   c                ,   a V P                   oV3R  lpV# )c                 sP   < V P                  R / 4      P                  R4      pVS8H  # )ZResponseMetadataZHTTPStatusCoder   )r   Zstatus_coderC   s   & r   rW   Z?AcceptorConfig._create_status_matcher.<locals>.acceptor_matches  s1     #,,'92>BB K (**r   rC   r   rW   rC      & @r   rR   Z%AcceptorConfig._create_status_matcher  s    ==	+  r   c                r`   )c                 s   < SR J d   RV 9   ;'       d    RV R,          9   # SRJ d   RV 9  # V P                  R/ 4      P                  RR4      S8H  # )Tr   r   Fr9   ra   )r   rC   s   &r   rW   Z>AcceptorConfig._create_error_matcher.<locals>.acceptor_matches'  s`     4(*JJv'9J/JJU"h..||GR044VR@HLLr   rb   rc   rd   r   rS   Z$AcceptorConfig._create_error_matcher$  s    ==	M"  r   )rD   rC   rB   rF   rA   N)r&   r'   r(   r)   r#   r@   rN   rE   rO   rP   rQ   rR   rS   r*   r+   r,   r-   r   r>   r>      sC     8 O O(0	  * *    r   r>   c                   sP   a  ] tR tRt o R t]! ]! ]R4      4      R 4       tRt	V t
R# )r
   i;  c                s*    W0n         Wn        W n        R# )aT  

:type name: string
:param name: The name of the waiter

:type config: botocore.waiter.SingleWaiterConfig
:param config: The configuration for the waiter.

:type operation_method: callable
:param operation_method: A callable that accepts **kwargs
    and returns a response.  For example, this can be
    a method from a botocore client.

N)_operation_methodnamerG   )r   rf   rG   r   s   &&&&r   r#   ZWaiter.__init__<  s     "2 	r   ZWAITERc           
     s   \        V P                  P                  4      pR pVP                  R/ 4      pVP	                  RV P                  P
                  4      pVP	                  RV P                  P                  4      pRp^ p V P                  ! R/ VB p	V^,          pV F*  p
V
P                  V	4      '       g   K  T
pV
P                  p Mi	  \        V	4      '       dW   \        V P                  RP                  V	R,          P	                  RR4      V	R,          P	                  R	R4      4      V	R
7      hVR8X  d   \        P                  R4       R# VR8X  d(   RX
P                    2p\        V P                  VV	R
7      hW8  d/   Vf   RpMRX
P                    2p\        V P                  VV	R
7      h\"        P$                  ! V4       EKL  )ZwaitingZWaiterConfigZDelayZMaxAttemptsNzAn error occurred ({}): {}r   r   ZUnknownZMessage)rf   reasonZlast_responseZsuccessz3Waiting complete, waiter matched the success state.Zfailurez-Waiter encountered a terminal failure state: zMax attempts exceededz2Max attempts exceeded. Previously accepted state: r$   )r2   rG   r=   Zpopr   r:   r<   re   rF   rA   r   r   rf   ZformatloggerZdebugrN   timeZsleep)r   r   r=   Zcurrent_staterG   Zsleep_amountr<   Zlast_matched_acceptorZnum_attemptsr   r?   rg   s   &,          r   r   ZWaiter.waitQ  s   ../	!NB/zz'4;;+<+<=zz-1I1IJ $--77HAL%((22,4)$,NNM	 & )22 &!YY;BB$W-11&)D$W-11)YG  '/  	)I 	)HI]I]H^_!!"* 
 +(04F M#//02  "!"* 
 JJ|$r   )re   rG   rf   N)r&   r'   r(   r)   r#   r   r    r   r   r*   r+   r,   r-   r   r
   r
   ;  s,     * '"5x@A:% B:%r   r
   )Zloggingri   Z	functoolsr    rY   Zbotocore.contextr   Zbotocore.docs.docstringr   Zbotocore.useragentr   Zbotocore.utilsr   r9   r   Z
exceptionsr   r   r   Z	getLoggerr&   rh   r   r   r   r.   r7   r>   r
   r$   r   r   <module>rj      s{        1 3 2 2  C C			8	$1h *8 *8Z 6L  L ^Q% Q%r   