o
    .&ßa×  ã                   @   s\   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 G dd„ de
ƒZ	dd	d
„ZdS )é    )Ú
xform_name)ÚOrderedDict)ÚDocumentedShape)Úget_service_module_name)Údocument_model_driven_methodc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚWaiterDocumenterc                 C   s   || _ | j jjj| _|| _d S )N)Ú_clientÚmetaÚservice_modelÚservice_nameÚ_service_nameÚ_service_waiter_model)ÚselfÚclientÚservice_waiter_model© r   ú6/usr/lib/python3/dist-packages/botocore/docs/waiter.pyÚ__init__   s   
zWaiterDocumenter.__init__c                 C   sX   |j  d¡ |j  ¡  | d¡ | jjD ]}|j  d| jjj	|f ¡ |  
||¡ qdS )zgDocuments the various waiters for a service.

        :param section: The section to write to.
        ÚWaiterszThe available waiters are:z:py:class:`%s.Waiter.%s`N)ÚstyleÚh2Únew_lineÚwritelnr   Úwaiter_namesÚlir   Ú	__class__Ú__name__Ú_add_single_waiter©r   ÚsectionÚwaiter_namer   r   r   Údocument_waiters   s   


ÿÿüz!WaiterDocumenter.document_waitersc                 C   s„   |  |¡}|jjd| jjj|f d� |j ¡  |j ¡  | dt	|ƒ ¡ |j 
¡  |j ¡  t||| jjj| jjj| jd� d S )Nz%s.Waiter.%s)Ú
class_namez waiter = client.get_waiter('%s'))r   r    Úevent_emitterr
   r   )Úadd_new_sectionr   Ústart_sphinx_py_classr   r   r   Ústart_codeblockr   Úwriter   Úend_codeblockÚdocument_wait_methodr	   Úeventsr
   r   r   r   r   r   r   (   s(   

ÿÿ


ÿ


ûz#WaiterDocumenter._add_single_waiterN)r   Ú
__module__Ú__qualname__r   r!   r   r   r   r   r   r      s    r   Tc                 C   sž   |  |¡}| |j¡}tƒ }tddd |j¡d�|d< tddd |j¡d�|d< tddd	|d
�g}	d t|ƒt	|jƒ|j|j¡}
t
| d|||
d|	d|d�	 dS )a¾  Documents a the wait method of a waiter

    :param section: The section to write to

    :param waiter_name: The name of the waiter

    :param event_emitter: The event emitter to use to emit events

    :param service_model: The service model

    :param service_waiter_model: The waiter model associated to the service

    :param include_signature: Whether or not to include the signature.
        It is useful for generating docstrings.
    ÚDelayÚintegerzK<p>The amount of time in seconds to wait between attempts. Default: {0}</p>)ÚnameÚ	type_nameÚdocumentationÚMaxAttemptsz><p>The maximum number of attempts to be made. Default: {0}</p>ÚWaiterConfigÚ	structurezI<p>A dictionary that provides parameters to control waiting behavior.</p>)r/   r0   r1   Úmembersz„Polls :py:meth:`{0}.Client.{1}` every {2} seconds until a successful state is reached. An error is returned after {3} failed checks.Úwaitzwaiter.waitF)r#   Úmethod_descriptionÚexample_prefixÚinclude_inputÚdocument_outputÚinclude_signatureN)Ú
get_waiterÚoperation_modelÚ	operationr   r   ÚformatÚdelayÚmax_attemptsr   r   r   )r   r    r#   r
   r   r;   Úwaiter_modelr=   Úwaiter_config_membersÚbotocore_waiter_paramsÚwait_descriptionr   r   r   r)   A   sJ   
ÿ
ü
üûÿ
ýý	
ùr)   N)T)Úbotocorer   Úbotocore.compatr   Úbotocore.docs.utilsr   Úbotocore.utilsr   Úbotocore.docs.methodr   Úobjectr   r)   r   r   r   r   Ú<module>   s   /þ