File: //proc/722141/root/lib/python3.6/site-packages/botocore/__pycache__/waiter.cpython-36.pyc
3
�T_�0 � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ ddlmZm Z m
Z
ddlmZ ej
e�Zdd� ZG d d
� d
e�ZG dd� de�ZG d
d� de�ZG dd� de�ZG dd� de�ZdS )� N)�get_service_module_name)�WaiterDocstring� )�WaiterError�ClientError�WaiterConfigError)�
xform_namec C s| |j | �}t|j�}tt||��}dd� }t| |jj|jj|dd�|_ t
dt|jj�| f �}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
�/usr/lib/python3.6/waiter.pyr
4 s z'create_waiter_with_client.<locals>.waitF)�waiter_nameZ
event_emitter�
service_modelZservice_waiter_modelZinclude_signaturez%s.Waiter.%sr
)�
get_waiterr � operation�NormalizedOperationMethod�getattrr �metaZeventsr �__doc__�strr �typer ) r Zwaiter_modelZclient�single_waiter_configZoperation_name�operation_methodr
Zwaiter_class_nameZdocumented_waiter_clsr
r
r �create_waiter_with_client s$
r c @ s e Zd Zdd� Zdd� ZdS )r c C s
|| _ d S )N)�_client_method)r Z
client_methodr
r
r �__init__O s z"NormalizedOperationMethod.__init__c K s4 y| j f |�S tk
r. } z|jS d }~X nX d S )N)r r �response)r r �er
r
r �__call__R s z"NormalizedOperationMethod.__call__N)�__name__�
__module__�__qualname__r r r
r
r
r r N s r c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �WaiterModel� c C s@ |d | _ |jdd�}| j|� || _tt|d j� ��| _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_config�get�_verify_supported_versionr'