o
    è’Ojƒ  ã                   @   sn   d dl Z 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
 d dlmZ G dd	„ d	ƒZ	
ddd„ZdS )é    N)Ú
xform_name)ÚOrderedDict)ÚDocumentStructure)Údocument_model_driven_method)ÚDocumentedShape)Úget_service_module_namec                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚWaiterDocumenterc                 C   s6   || _ | j jj| _| j jjj| _|| _|| _	d| _
d S )NzChttps://docs.aws.amazon.com/boto3/latest/guide/clients.html#waiters)Ú_clientÚ	__class__Ú__name__Ú_client_class_nameÚmetaÚservice_modelÚservice_nameÚ_service_nameÚ_service_waiter_modelÚ_root_docs_pathÚ_USER_GUIDE_LINK)ÚselfÚclientÚservice_waiter_modelÚroot_docs_path© r   úZ/var/www/html/pharmsmart-cdr-gen/venv/lib/python3.10/site-packages/botocore/docs/waiter.pyÚ__init__   s   ÿzWaiterDocumenter.__init__c                 C   s–   |j  d¡ |  |¡ |j  ¡  | d¡ |j  ¡  | jjD ]*}|j  | j	› d|› �¡ t
|dd�}|  ||¡ tj | j| j	d¡}| ||¡ qdS )zgDocuments the various waiters for a service.

        :param section: The section to write to.
        ÚWaiterszThe available waiters are:z/waiter/Úhtml)ÚtargetÚwaiterN)ÚstyleÚh2Ú_add_overviewÚnew_lineÚwritelnÚtoctreer   Úwaiter_namesÚtocitemr   r   Ú_add_single_waiterÚosÚpathÚjoinr   Úwrite_to_file)r   ÚsectionÚwaiter_nameÚwaiter_doc_structureÚwaiter_dir_pathr   r   r   Údocument_waiters#   s    



ÿ
ÿôz!WaiterDocumenter.document_waitersc                 C   sÂ   |  d¡}|j | jd| j› �¡ | d|› �¡ | |¡ |  |¡}|jj| j› d|› �d� |j ¡  |j 	¡  | dt
|ƒ› d�¡ |j ¡  |j 	¡  t||| jjj| jjj| jd� d S )	NÚ
breadcrumbz../../z / Waiter / z.Waiter.)Ú
class_namezwaiter = client.get_waiter('z'))r,   r-   Úevent_emitterr   r   )Úadd_new_sectionr   Úrefr   r   ÚwriteÚadd_title_sectionÚstart_sphinx_py_classÚstart_codeblockr"   r   Úend_codeblockÚdocument_wait_methodr	   r   Úeventsr   r   )r   r,   r-   Úbreadcrumb_sectionÚwaiter_sectionr   r   r   r'   ;   s0   
ÿ

ÿ

ÿ


ûz#WaiterDocumenter._add_single_waiterc                 C   s>   |j  ¡  | d¡ |j jd| jd� | d¡ |j  ¡  d S )NzŸWaiters are available on a client instance via the ``get_waiter`` method. For more detailed instructions and examples on the usage or waiters, see the waiters z
user guide)ÚtitleÚlinkÚ.)r   r"   r6   Úexternal_linkr   )r   r,   r   r   r   r!   Y   s   
ÿþ
zWaiterDocumenter._add_overviewN)r   Ú
__module__Ú__qualname__r   r0   r'   r!   r   r   r   r   r      s
    r   Tc                 C   s°   |  |¡}| |j¡}tƒ }tddd|j› d�d�|d< tddd|j› d�d�|d< tdd	d
|d�g}	dt|ƒ› dt|jƒ› d|j› d|j› d�	}
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ÚintegerzD<p>The amount of time in seconds to wait between attempts. Default: z</p>)ÚnameÚ	type_nameÚdocumentationÚMaxAttemptsz7<p>The maximum number of attempts to be made. Default: ÚWaiterConfigÚ	structurezI<p>A dictionary that provides parameters to control waiting behavior.</p>)rG   rH   rI   ÚmemberszPolls :py:meth:`z.Client.z` every zG seconds until a successful state is reached. An error is raised after z failed checks.Úwaitzwaiter.waitF)r3   Úmethod_descriptionÚexample_prefixÚinclude_inputÚdocument_outputÚinclude_signatureN)
Ú
get_waiterÚoperation_modelÚ	operationr   r   ÚdelayÚmax_attemptsr   r   r   )r,   r-   r3   r   r   rS   Úwaiter_modelrU   Úwaiter_config_membersÚbotocore_waiter_paramsÚwait_descriptionr   r   r   r;   i   sV   
ÿ
ü	ÿ
ü
ùÿÿÿýÿ
÷r;   )T)r(   Úbotocorer   Úbotocore.compatr   Úbotocore.docs.bcdoc.restdocr   Úbotocore.docs.methodr   Úbotocore.docs.utilsr   Úbotocore.utilsr   r   r;   r   r   r   r   Ú<module>   s   Xú