File: //opt/cppython/lib/python3.8/site-packages/botocore/__pycache__/waiter.cpython-38.pyc
U
KD�gz9 � @ s� d dl Z d dlZd dlmZ d dlZd dlmZ d dlmZ d dl m
Z
d dlmZ ddl
mZ dd lmZmZmZ e �e�Zd
d� Zdd
� ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�ZdS )� N)�partial)�with_current_context)�WaiterDocstring)�register_feature_id)�get_service_module_name� )�
xform_name)�ClientError�WaiterConfigError�WaiterErrorc C s~ |� | �}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 [ s t j| f|� d S �N)�Waiter�wait)�self�kwargs� r �</opt/cppython/lib/python3.8/site-packages/botocore/waiter.pyr 9 s z'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
) r Zwaiter_model�client�single_waiter_configZoperation_name�operation_methodr Zwaiter_class_nameZdocumented_waiter_clsr r r �create_waiter_with_client s,
�� � �r! c C s$ | � d�}t|t�r d|kr dS dS )N�Error�CodeTF)�get�
isinstance�dict)�response�errorr r r �is_valid_waiter_errorR s
r) c @ s e Zd Zdd� Zdd� ZdS )r c C s
|| _ d S r )�_client_method)r Z
client_methodr r r �__init__Z s z"NormalizedOperationMethod.__init__c
K s@ z| j f |�W S tk
r: } z|j W Y �S d }~X Y nX d S r )r* r r'