HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/botocore/__pycache__/waiter.cpython-38.pyc
U

KD�gz9�@s�ddlZddlZddlmZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZe�e�Zd
d�Zdd
�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�ZdS)�N)�partial)�with_current_context)�WaiterDocstring)�register_feature_id)�get_service_module_name�)�
xform_name)�ClientError�WaiterConfigError�WaiterErrorc	Cs~|�|�}t|j�}tt||��}dd�}t||jj|jj|dd�|_	t
t|jj��d|���}t|t
fd|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[stj|f|�dS�N)�Waiter�wait)�self�kwargs�r�</opt/cppython/lib/python3.8/site-packages/botocore/waiter.pyr9sz'create_waiter_with_client.<locals>.waitF)�waiter_nameZ
event_emitter�
service_modelZservice_waiter_modelZinclude_signaturez.Waiter.r)�
get_waiterr�	operation�NormalizedOperationMethod�getattrr�meta�eventsr�__doc__�strr�typer
)	rZwaiter_model�client�single_waiter_configZoperation_name�operation_methodrZwaiter_class_nameZdocumented_waiter_clsrrr�create_waiter_with_clients,

��	��r!cCs$|�d�}t|t�r d|kr dSdS)N�Error�CodeTF)�get�
isinstance�dict)�response�errorrrr�is_valid_waiter_errorRs
r)c@seZdZdd�Zdd�ZdS)rcCs
||_dSr)�_client_method)rZ
client_methodrrr�__init__Zsz"NormalizedOperationMethod.__init__c
Ks@z|jf|�WStk
r:}z|jWY�Sd}~XYnXdSr)r*r	r')rr�errr�__call__]sz"NormalizedOperationMethod.__call__N)�__name__�
__module__�__qualname__r+r-rrrrrYsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�WaiterModel�cCs@|d|_|�dd�}|�|�||_tt|d����|_dS)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.

        �waiters�version�unknownN)�_waiter_configr$�_verify_supported_versionr4�list�sorted�keysZwaiter_names)rZ
waiter_configr4rrrr+gs


zWaiterModel.__init__cCs&||jkr"td|j�d|��d��dS)Nz7Unsupported waiter version, supported version must be: z#, but version of waiter config is: ��	error_msg)�SUPPORTED_VERSIONr
)rr4rrrr7s
�z%WaiterModel._verify_supported_versioncCs:z|j|}Wn"tk
r0td|����YnXt|�S)NzWaiter does not exist: )r6�KeyError�
ValueError�SingleWaiterConfig)rrrrrrr�s
zWaiterModel.get_waiterN)r.r/r0r=r+r7rrrrrr1ds
r1c@s$eZdZdZdd�Zedd��ZdS)r@z�Represents 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).

    cCs6||_|�dd�|_|d|_|d|_|d|_dS)N�description�r�delayZmaxAttempts)�_configr$rArrC�max_attempts)rrrrrr+�s


zSingleWaiterConfig.__init__cCs*g}|jdD]}t|�}|�|�q|S)N�	acceptors)rD�AcceptorConfig�append)rrFZacceptor_config�acceptorrrrrF�s
zSingleWaiterConfig.acceptorsN)r.r/r0rr+�propertyrFrrrrr@�s
r@c@sPeZdZdd�Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)rGcCs8|d|_|d|_|d|_|�d�|_|��|_dS)N�state�matcher�expected�argument)rKrLrMr$rN�_create_matcher_func�matcher_func)r�configrrrr+�s



zAcceptorConfig.__init__cCs�|jdkr d|j�d|j�d�S|jdkr@d|j�d|j�d�S|jdkr`d|j�d|j�d�S|jd	krvd
|j��S|jdkr�d|j��Sd
|j�d�SdS)N�pathzFor expression "z" we matched expected path: "�"�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: ")rLrNrM�rrrr�explanation�s

�
�

zAcceptorConfig.explanationcCsp|jdkr|��S|jdkr$|��S|jdkr6|��S|jdkrH|��S|jdkrZ|��Std|j��d��dS)NrRrTrUrVr(zUnknown acceptor: r;)rL�_create_path_matcher�_create_path_all_matcher�_create_path_any_matcher�_create_status_matcher�_create_error_matcherr
rWrrrrO�s	





�z#AcceptorConfig._create_matcher_funccs$t�|j��|j���fdd�}|S)Ncst|�rdS��|��kSr)r)�search�r'�rM�
expressionrr�acceptor_matches�sz=AcceptorConfig._create_path_matcher.<locals>.acceptor_matches��jmespath�compilerNrM�rrbrr`rrY�sz#AcceptorConfig._create_path_matchercs$t�|j��|j���fdd�}|S)NcsDt|�rdS��|�}t|t�r$|s(dS|D]}|�kr,dSq,dS�NFT�r)r^r%r8�r'�result�elementr`rrrb�s
zAAcceptorConfig._create_path_all_matcher.<locals>.acceptor_matchesrcrfrr`rrZ�sz'AcceptorConfig._create_path_all_matchercs$t�|j��|j���fdd�}|S)NcsDt|�rdS��|�}t|t�r$|s(dS|D]}|�kr,dSq,dSrgrhrir`rrrbs
zAAcceptorConfig._create_path_any_matcher.<locals>.acceptor_matchesrcrfrr`rr[sz'AcceptorConfig._create_path_any_matchercs|j��fdd�}|S)Ncs|�di��d�}|�kS)NZResponseMetadataZHTTPStatusCode�r$)r'�status_code�rMrrrbs�z?AcceptorConfig._create_status_matcher.<locals>.acceptor_matchesrnrfrrnrr\s	z%AcceptorConfig._create_status_matchercs|j��fdd�}|S)NcsH�dkrd|kod|dkS�dkr,d|kS|�di��dd��kSdS)NTr"r#FrBrlr_rnrrrb's

z>AcceptorConfig._create_error_matcher.<locals>.acceptor_matchesrnrfrrnrr]$sz$AcceptorConfig._create_error_matcherN)r.r/r0r+rJrXrOrYrZr[r\r]rrrrrG�s
rGc@s*eZdZdd�Zeeed��dd��ZdS)r
cCs||_||_||_dS)a�

        :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�namerQ)rrprQr rrrr+<szWaiter.__init__ZWAITERc	Ks2t|jj�}d}|�di�}|�d|jj�}|�d|jj�}d}d}|jf|�}	|d7}|D]}
|
�|	�r\|
}|
j	}q�q\t
|	�r�t|jd�
|	d�d	d
�|	d�dd
��|	d��|d
kr�t�d�dS|dkr�d|
j��}t|j||	d��||k�r"|dk�rd}nd|
j��}t|j||	d��t�|�qDdS)NZwaitingZWaiterConfigZDelayZMaxAttemptsrrzAn error occurred ({}): {}r"r#�Unknown�Message)rp�reasonZ
last_response�successz3Waiting complete, waiter matched the success state.Zfailurez-Waiter encountered a terminal failure state: zMax attempts exceededz2Max attempts exceeded. Previously accepted state: )r8rQrF�popr$rCrErorPrKr)rrp�format�logger�debugrX�time�sleep)rrrFZ
current_staterQZsleep_amountrEZlast_matched_acceptorZnum_attemptsr'rIrsrrrrQs\
����


��zWaiter.waitN)r.r/r0r+rrrrrrrrr
;sr
)�loggingry�	functoolsrrdZbotocore.contextrZbotocore.docs.docstringrZbotocore.useragentrZbotocore.utilsrrBr�
exceptionsr	r
r�	getLoggerr.rwr!r)rr1r@rGr
rrrr�<module>
s$
4-