HEX
Server: nginx/1.24.0
System: Linux webserver 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: wpuser (1002)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/botocore/__pycache__/waiter.cpython-312.pyc
�

P��e�7����ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZeje�Zd�Zd�ZGd	�d
�ZGd�d�ZGd
�d�ZGd�d�ZGd�d�Zy)�N)�WaiterDocstring)�get_service_module_name�)�
xform_name)�ClientError�WaiterConfigError�WaiterErrorc��|j|�}t|j�}tt	||��}d�}t||jj|jj|d��|_	tt|jj��d|���}t|tfd|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�0�tj|fi|��y�N)�Waiter�wait)�self�kwargss  �1/usr/lib/python3/dist-packages/botocore/waiter.pyrz'create_waiter_with_client.<locals>.wait6s�����D�#�F�#�F)�waiter_name�
event_emitter�
service_model�service_waiter_model�include_signaturez.Waiter.r)�
get_waiterr�	operation�NormalizedOperationMethod�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����'���$�#���k�k�(�(��k�k�/�/�)���D�L��"�6�;�;�#<�#<�=�{�	L���!�!2�V�I���~�N��!��)�+;��rc�P�|jd�}t|t�rd|vryy)N�Error�CodeTF)�get�
isinstance�dict)�response�errors  r�is_valid_waiter_errorr1Ps&���L�L��!�E��%���6�U�?��rc��eZdZd�Zd�Zy)rc��||_yr)�_client_method)r�
client_methods  r�__init__z"NormalizedOperationMethod.__init__Xs
��+��rc�l�	|jdi|��S#t$r}|jcYd}~Sd}~wwxYw)N�)r4rr/)rr�es   r�__call__z"NormalizedOperationMethod.__call__[s7��	�&�4�&�&�0��0�0���	��:�:���	�s��	3�.�3�3N)�__name__�
__module__�__qualname__r6r:r8rrrrWs��,�rrc�"�eZdZdZd�Zd�Zd�Zy)�WaiterModel�c��|d|_|jdd�}|j|�||_t	t|dj
���|_y)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_versionrC�list�sorted�keys�waiter_names)r�
waiter_configrCs   rr6zWaiterModel.__init__esZ��,�I�6���
 �#�#�I�y�9���&�&�w�/���� ��
�i�(@�(E�(E�(G�!H�I��rc�Z�||jk7rtd|j�d|�����y)Nz7Unsupported waiter version, supported version must be: z#, but version of waiter config is: ��	error_msg)�SUPPORTED_VERSIONr)rrCs  rrFz%WaiterModel._verify_supported_version}s5���d�,�,�,�#�!%� 6� 6��A��
�-rc�n�	|j|}t|�S#t$rtd|z��wxYw)NzWaiter does not exist: %s)rE�KeyError�
ValueError�SingleWaiterConfig)rrr#s   rrzWaiterModel.get_waiter�sK��	H�#'�#6�#6�{�#C� �"�"6�7�7���	H��8�;�F�G�G�	H�s��4N)r;r<r=rOr6rFrr8rrr?r?bs����J�0�8rr?c�&�eZdZdZd�Zed��Zy)rSz�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).

    c�|�||_|jdd�|_|d|_|d|_|d|_y)N�description�r�delay�maxAttempts)�_configr,rVrrX�max_attempts)rr#s  rr6zSingleWaiterConfig.__init__�sE��+���0�3�3�M�2�F���-�k�:���)�'�2��
�0��?��rc�j�g}|jdD]}t|�}|j|�� |S)N�	acceptors)rZ�AcceptorConfig�append)rr]�acceptor_config�acceptors    rr]zSingleWaiterConfig.acceptors�s?���	�#�|�|�K�8�	'�O�%�o�6�H����X�&�	'��rN)r;r<r=rr6�propertyr]r8rrrSrS�s!���@����rrSc�F�eZdZd�Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zy	)
r^c��|d|_|d|_|d|_|jd�|_|j�|_y)N�state�matcher�expected�argument)rerfrgr,rh�_create_matcher_func�matcher_func)r�configs  rr6zAcceptorConfig.__init__�sF���G�_��
��i�(����z�*��
��
�
�:�.��
� �5�5�7��rc��|jdk(r&dj|j|j�S|jdk(rd|j�d|j�d�S|jdk(rd|j�d|j�d	�S|jd
k(rd|jzS|jdk(rd
|jzSd|jzS)N�pathz2For expression "{}" we matched expected path: "{}"�pathAllzFor expression "z&" all members matched excepted path: "�"�pathAnyz" we matched expected path: "z" at least once�statusz%Matched expected HTTP status code: %sr0z'Matched expected service error code: %sz,No explanation for unknown waiter type: "%s")rf�formatrhrg�rs r�explanationzAcceptorConfig.explanation�s����<�<�6�!�G�N�N��
�
��
�
��
��\�\�Y�
&��=�=�$�-�-�1�
��\�\�Y�
&��=�=�$�-�-�1�
��\�\�X�
%�:�T�]�]�J�J�
�\�\�W�
$�<�t�}�}�L�L�?����M�
rc�j�|jdk(r|j�S|jdk(r|j�S|jdk(r|j�S|jdk(r|j	�S|jdk(r|j�St
d|jz���)Nrmrnrprqr0zUnknown acceptor: %srM)rf�_create_path_matcher�_create_path_all_matcher�_create_path_any_matcher�_create_status_matcher�_create_error_matcherrrss rriz#AcceptorConfig._create_matcher_func�s����<�<�6�!��,�,�.�.�
�\�\�Y�
&��0�0�2�2�
�\�\�Y�
&��0�0�2�2�
�\�\�X�
%��.�.�0�0�
�\�\�W�
$��-�-�/�/�#�0�4�<�<�?��
rc�l���tj|j��|j���fd�}|S)Nc�D��t|�ry�j|��k(Sr)r1�search)r/rg�
expressions ��r�acceptor_matchesz=AcceptorConfig._create_path_matcher.<locals>.acceptor_matches�s$���$�X�.���$�$�X�.�(�:�:r��jmespath�compilerhrg�rrrgr~s  @@rrvz#AcceptorConfig._create_path_matcher�s-����%�%�d�m�m�4�
��=�=��	;�
 �rc�l���tj|j��|j���fd�}|S)Nc���t|�ry�j|�}t|t�r|sy|D]	}|�k7s�	yy�NFT�r1r}r-rG�r/�result�elementrgr~s   ��rrzAAcceptorConfig._create_path_all_matcher.<locals>.acceptor_matches�sN���$�X�.���&�&�x�0�F��f�d�+�6�
�!�
!���h�&� �
!�rr�r�s  @@rrwz'AcceptorConfig._create_path_all_matcher�s-����%�%�d�m�m�4�
��=�=��
	� �rc�l���tj|j��|j���fd�}|S)Nc���t|�ry�j|�}t|t�r|sy|D]	}|�k(s�	yyr�r�r�s   ��rrzAAcceptorConfig._create_path_any_matcher.<locals>.acceptor_matchessN���$�X�.���&�&�x�0�F��f�d�+�6�
�!�
 ���h�&��
 �rr�r�s  @@rrxz'AcceptorConfig._create_path_any_matchers-����%�%�d�m�m�4�
��=�=��
	� �rc�*��|j��fd�}|S)Nc�P��|jdi�jd�}|�k(S)N�ResponseMetadata�HTTPStatusCode�r,)r/�status_codergs  �rrz?AcceptorConfig._create_status_matcher.<locals>.acceptor_matchess1���#�,�,�'9�2�>�B�B� ��K��(�*�*r�rg�rrrgs  @rryz%AcceptorConfig._create_status_matchers����=�=��	+� �rc�*��|j��fd�}|S)Nc�N��|jdi�jdd��k(S)Nr*r+rWr�)r/rgs �rrz>AcceptorConfig._create_error_matcher.<locals>.acceptor_matches*s(����<�<���,�0�0���<��H�Hrr�r�s  @rrzz$AcceptorConfig._create_error_matcher's����=�=��	I� �rN)r;r<r=r6rbrtrirvrwrxryrzr8rrr^r^�s9��8�����2�0	 � �* �* � rr^c��eZdZd�Zd�Zy)r
c�.�||_||_||_y)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�namerk)rr�rkr%s    rr6zWaiter.__init__7s��"2�����	���rc
�D�t|jj�}d}|jdi�}|j	d|jj
�}|j	d|jj�}d}d}	|jdi|��}	|dz
}|D]#}
|
j|	�s�|
}|
j}nPt|	�rDt|jd|	dj	d	d
��d|	dj	dd
���|	�
��|dk(rtjd�y|dk(r'd
jz}t|j||	�
��||k\r,|�d}nd
jz}t|j||	�
��t!j"|���)N�waiting�WaiterConfig�Delay�MaxAttemptsrrzAn error occurred (r*r+�Unknownz): �Message)r��reason�
last_response�successz3Waiting complete, waiter matched the success state.�failurez/Waiter encountered a terminal failure state: %szMax attempts exceededz4Max attempts exceeded. Previously accepted state: %sr8)rGrkr]�popr,rXr[r�rjrer1r	r��logger�debugrt�time�sleep)rrr]�
current_staterk�sleep_amountr[�last_matched_acceptor�num_attemptsr/rar�s            rrzWaiter.waitLs�������.�.�/�	�!�
����N�B�/���z�z�'�4�;�;�+<�+<�=���z�z�-����1I�1I�J�� $�����-�t�-�-�7��7�H��A��L�%�
���(�(��2�,4�)�$,�N�N�M��	
�)��2�&�!�Y�Y�%�W�-�1�1�&�)�D�$�W�-�1�1�)�Y�G� �
'/����	�)����L����	�)�J��(�(���"����!�"*���
�|�+�(�0�4�F�O�#�/�/�1��"����!�"*���

�J�J�|�$�grN)r;r<r=r6rr8rrr
r
6s���*=%rr
)�loggingr�r��botocore.docs.docstringr�botocore.utilsrrWr�
exceptionsrrr	�	getLoggerr;r�r(r1rr?rSr^r
r8rr�<module>r�st�����3�2��C�C�	��	�	�8�	$��2�j���*8�*8�Z��6I �I �XS%�S%r