
    Dh!                         d dl 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mZmZmZmZ d Z G d	 d
e	      Z G d de      Zy)    N)WaiterDocstring)ClientError)get_service_module_name)NormalizedOperationMethod)WaiterModel)WaiterWaiterErroris_valid_waiter_errorlogger
xform_namec                    |j                  |       }t        |j                        }t        t	        ||            }d }t        | |j                  j                  |j                  j                  |d      |_	        t        t        |j                  j                        d|       }t        |t        fd|i      } || ||      S )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                 L   K   t        j                  | fi | d {    y 7 w)N)	AIOWaiterwait)selfkwargss     t/var/www/fastuser/data/www/generator.snapmosaic.io/flask_app/venv/lib/python3.12/site-packages/aiobotocore/waiter.pyr   z'create_waiter_with_client.<locals>.wait0   s     nnT,V,,,s   $"$F)waiter_nameevent_emitterservice_modelservice_waiter_modelinclude_signaturez.Waiter.r   )
get_waiterr   	operationr   getattrr   metaeventsr   __doc__strr   typer   )	r   waiter_modelclientsingle_waiter_configoperation_nameoperation_methodr   waiter_class_namedocumented_waiter_clss	            r   create_waiter_with_clientr(      s    $ (22;? 4 > >?N0'- #kk((kk//)DL "6;;#<#<={	L !!2VI~N !)+;     c                       e Zd Zd Zy)r   c                    K   	  | j                   di | d {   S 7 # t        $ r}|j                  cY d }~S d }~ww xY ww)N )_client_methodr   response)r   r   es      r   __call__z"NormalizedOperationMethod.__call__K   s@     	,,,6v6666 	::	s4   A    A  	?:?A?AN)__name__
__module____qualname__r0   r,   r)   r   r   r   J   s    r)   r   c                       e Zd Zd Zy)r   c           
      v  K   t        | j                  j                        }d}|j                  di       }|j	                  d| j                  j
                        }|j	                  d| j                  j                        }d }d}	  | j                  di | d {   }	|dz  }|D ]#  }
|
j                  |	      s|
}|
j                  } nP t        |	      rDt        | j                  d|	d   j	                  d	d
      d|	d   j	                  dd
      |	      |dk(  rt        j                  d       y |dk(  r'd
j                  z  }t        | j                  ||	      ||k\  r,|d}nd
j                  z  }t        | j                  ||	      t!        j"                  |       d {    -7 7 	w)NwaitingWaiterConfigDelayMaxAttemptsr      zAn error occurred (ErrorCodeUnknownz): Message)namereasonlast_responsesuccessz3Waiting complete, waiter matched the success state.failurez/Waiter encountered a terminal failure state: %szMax attempts exceededz4Max attempts exceeded. Previously accepted state: %sr,   )listconfig	acceptorspopgetdelaymax_attempts_operation_methodmatcher_funcstater
   r	   r?   r   debugexplanationasynciosleep)r   r   rF   current_staterE   sleep_amountrJ   last_matched_acceptornum_attemptsr.   acceptorr@   s               r   r   zAIOWaiter.waitS   s    ../	!NB/zz'4;;+<+<=zz-1I1IJ $3T33=f==HAL% ((2,4)$,NNM	 )2 &!YY %W-11&)D$W-11)YG 
 '/  	)L 	)J(( "!"* 
 |+(04F O#//1  "!"* 
 -----g =d .s+   BF9F4F9=C0F9-F7.F97F9N)r1   r2   r3   r   r,   r)   r   r   r   R   s    =.r)   r   )rP   botocore.docs.docstringr   botocore.exceptionsr   botocore.utilsr   botocore.waiterr   _NormalizedOperationMethodr   r   r	   r
   r   r   r(   r   r,   r)   r   <module>r\      sF     3 , 2 ( 2j : >. >.r)   