File: //opt/alt/python311/lib/python3.11/site-packages/botocore/__pycache__/waiter.cpython-311.pyc
�
/�;f�7 � � � d dl Z d dlZd dlZd dlmZ d dlmZ ddlmZ ddl m
Z
mZmZ e j
e� � Zd� Zd� Z G d � d
� � Z G d� d� � Z G d
� d� � Z G d� d� � Z G d� d� � ZdS )� N)�WaiterDocstring)�get_service_module_name� )�
xform_name)�ClientError�WaiterConfigError�WaiterErrorc � � |� | � � }t |j � � }t t ||� � � � }d� }t | |j j |j j |d�� � |_ t t |j j � � �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 �* � t j | fi |�� d S �N)�Waiter�wait)�self�kwargss �B/opt/alt/python311/lib/python3.11/site-packages/botocore/waiter.pyr z'create_waiter_with_client.<locals>.wait6 s � ���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�/�)��� � �D�L� �"�6�;�#<�=�=�=�=�{�{� L�� �� !�!2�V�I���~�N�N�� !� ��)�+;�� � r c �f � | � d� � }t |t � � rd|v rdS dS )N�Error�CodeTF)�get�
isinstance�dict)�response�errors r �is_valid_waiter_errorr1 P s7 � ��L�L��!�!�E��%���� �6�U�?�?��t��5r c � � e Zd Zd� Zd� ZdS )r c � � || _ d S r )�_client_method)r �
client_methods r �__init__z"NormalizedOperationMethod.__init__X s � �+����r c �Z � | j di |��S # t $ r}|j cY d }~S d }~ww xY w)N� )r4 r r/ )r r �es r �__call__z"NormalizedOperationMethod.__call__[ sV � � �&�4�&�0�0��0�0�0��� � � ��:����������� ���s � �
*�%�*�*N)�__name__�
__module__�__qualname__r6 r: r8 r r r r W s2 � � � � � �,� ,� ,�� � � � r r c �$ � e Zd ZdZd� Zd� Zd� ZdS )�WaiterModel� c � � |d | _ |� dd� � }| � |� � || _ t t |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_versionrC �list�sorted�keys�waiter_names)r �
waiter_configrC s r r6 zWaiterModel.__init__e sr � � ,�I�6���
�#�#�I�y�9�9���&�&�w�/�/�/���� ��
�i�(@�(E�(E�(G�(G�!H�!H�I�I����r c �R � || j k rt d| j �d|���� � �d S )Nz7Unsupported waiter version, supported version must be: z#, but version of waiter config is: �� error_msg)�SUPPORTED_VERSIONr )r rC s r rF z%WaiterModel._verify_supported_version} sJ � ��d�,�,�,�#�#� !%� 6� 6� 6���A�� � �
� -�,r c �~ � | j | }n # t $ r t d|z � � �w xY wt |� � S )NzWaiter does not exist: %s)rE �KeyError�
ValueError�SingleWaiterConfig)r r r# s r r zWaiterModel.get_waiter� s[ � � H�#'�#6�{�#C� � ��� H� H� H��8�;�F�G�G�G� H����!�"6�7�7�7s �
�-N)r; r<