
                         t    S SK r S SKJr  S SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr   " S S	5      r SS
 jrg)    N)
xform_name)OrderedDict)DocumentStructure)document_model_driven_method)DocumentedShape)get_service_module_namec                   ,    \ rS rSrS rS rS rS rSrg)WaiterDocumenter   c                     Xl         U R                   R                  R                  U l        U R                   R                  R
                  R                  U l        X l        X0l	        SU l
        g )NzRhttps://boto3.amazonaws.com/v1/documentation/api/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_paths       'lib/third_party/botocore/docs/waiter.py__init__WaiterDocumenter.__init__   sW    "&,,"8"8"A"A!\\..<<II%9"-E 	    c                 6   UR                   R                  S5        U R                  U5        UR                   R                  5         UR	                  S5        UR                   R                  5         U R                  R                   H  nUR                   R                  U R                   SU 35        [        USS9nU R                  X25        [        R                  R                  U R                  U R                  S5      nUR!                  XB5        M     g)zWDocuments 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_paths        r   document_waiters!WaiterDocumenter.document_waiters#   s    
 	#7# 4555BBKMM!!T%7%7$8"NO#4F$  ##$8F !ggll$$d&8&8(O !..L Cr   c                    UR                  S5      nUR                  R                  U R                  SU R                   35        UR                  SU 35        UR                  U5        UR                  U5      nUR                  R                  U R                   SU 3S9  UR                  R                  5         UR                  R                  5         UR                  S[        U5      -  5        UR                  R                  5         UR                  R                  5         [        UUU R                  R                  R                  U R                  R                  R                   U R"                  S9  g )N
breadcrumbz../../z / Waiter / z.Waiter.)
class_namez waiter = client.get_waiter('%s'))r2   r3   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   r2   r3   breadcrumb_sectionwaiter_sections        r   r-   #WaiterDocumenter._add_single_waiter;   sI   $44\B  $$##vd.@.@-A%B	
 	  <}!=>!!+. 00=22112(;-H 	3 	

 	,,.%%'0:k3JJ	
 	**, 	%%'"#,,++22,,++99!%!;!;	
r   c                     UR                   R                  5         UR                  S5        UR                   R                  SU R                  S9  UR                  S5        UR                   R                  5         g )NzWaiters 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(   r>   external_linkr   )r   r2   s     r   r'   WaiterDocumenter._add_overviewY   sf     	
 	##&& 	$ 	
 	c r   )r   r   r   r   r   r   N)	r   
__module____qualname____firstlineno__r   r6   r-   r'   __static_attributes__ r   r   r
   r
      s    	
M0
<!r   r
   c                    UR                  U5      nUR                  UR                  5      n[        5       n[	        SSSR                  UR                  5      S9US'   [	        SSSR                  UR                  5      S9US'   [	        SSS	US
9/n	SR                  [        U5      [        UR                  5      UR                  UR                  5      n
[        U SUUU
SU	SUS9	  g)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integerzJ<p>The amount of time in seconds to wait between attempts. Default: {}</p>)name	type_namedocumentationMaxAttemptsz=<p>The maximum number of attempts to be made. Default: {}</p>WaiterConfig	structurezI<p>A dictionary that provides parameters to control waiting behavior.</p>)rV   rW   rX   memberszPolls :py:meth:`{}.Client.{}` every {} seconds until a successful state is reached. An error is returned after {} 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   )r2   r3   r;   r   r   rb   waiter_modelrd   waiter_config_membersbotocore_waiter_paramswait_descriptions              r   rC   rC   i   s   . (22;?L#33L4J4JKO'M%4((.|/A/A(B&'" ,;$f\%>%>?,-( 	!( *	

	++16#M2|--.%%	,
  !#+$,+
r   )T)r.   botocorer   botocore.compatr   botocore.docs.bcdoc.restdocr   botocore.docs.methodr   botocore.docs.utilsr   botocore.utilsr   r
   rC   rR   r   r   <module>rs      s4    
  ' 9 = / 2O! O!p Or   