
    pge1                         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dS )    N)WaiterDocstring)ClientError)get_service_module_name)NormalizedOperationMethod)WaiterModel)WaiterWaiterErroris_valid_waiter_errorlogger
xform_namec                    |                     |           }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                 6   K   t          j        | fi | d {V S )N)	AIOWaiterwait)selfkwargss     2lib/python3.11/site-packages/aiobotocore/waiter.pyr   z'create_waiter_with_client.<locals>.wait0   s0      ^D33F333333333    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'' 4 4 4 #k(k/)  DL "6;#<===={{	L  !!2VI~NN ! )+;  r   c                       e Zd Zd ZdS )r   c                 j   K   	  | j         di | d {V S # t          $ r}|j        cY d }~S d }~ww xY w)N )_client_methodr   response)r   r   es      r   __call__z"NormalizedOperationMethod.__call__K   sl      	,,66v666666666 	 	 	:	s    
2-22N)__name__
__module____qualname__r0   r,   r   r   r   r   J   s#            r   r   c                       e Zd Zd ZdS )r   c           
      B  K   t          | j        j                  }d}|                    di           }|                    d| j        j                  }|                    d| j        j                  }d }d}	  | j        di | d {V }	|dz  }|D ]"}
|
                    |	          r|
}|
j	        } na#t          |	          rQt          | j        d|	d	                             d
d          d|	d	                             dd          |	          |dk    rt          j        d           |	S |dk    r!d|
j        z  }t          | j        ||	          ||k    r&|d}n
d|
j        z  }t          | j        ||	          t!          j        |           d {V  ()NwaitingWaiterConfigDelayMaxAttemptsr   T   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-1IJJ $3	.3T3==f========HAL%  ((22 ,4)$,NME )22  &!YY %W-11&)DDDD$W-11)YGGG 
 '/    	))L    	))J( "!"*   
 |++(04FF O#/1  "!"*   
 ----------g3	.r   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\      s-    3 3 3 3 3 3 , + + + + + 2 2 2 2 2 2      ( ' ' ' ' '             2 2 2j     :   >. >. >. >. >. >. >. >. >. >.r   