
    Pe~                     \    d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	 d dl
mZ  G d d      Zy)	    )DocumentStructure)ClientContextParamsDocumenterClientDocumenterClientExceptionsDocumenter)PaginatorDocumenter)WaiterDocumenter)DataNotFoundErrorc                   J    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
dd
Zd Zy	)ServiceDocumenterc                     || _         || _        || _        | j                   j                  |ddd      | _        | j                  j
                  j                  | _        g d| _        y )Nz	us-east-1foobar)region_nameaws_access_key_idaws_secret_access_key)title
client-apiclient-exceptionspaginator-api
waiter-apiclient-context-params)	_session_service_name_root_docs_pathcreate_client_clientmetaevents_event_emittersections)selfservice_namesessionroot_docs_paths       7/usr/lib/python3/dist-packages/botocore/docs/service.py__init__zServiceDocumenter.__init__   sc    )-}}22##"'	 3 
 #ll//66
    c                    t        | j                  | j                  d      }| j                  |j	                  d             | j                  |j	                  d             | j                  |j	                  d             | j                  |j	                  d             | j                  |j	                  d             |j	                  d      }| j                  |       |j                         S )	ziDocuments an entire service.

        :returns: The reStructured text of the documented service.
        html)section_namestargetr   r   r   r   r   r   )r   r   r    r   get_section
client_apiclient_exceptionspaginator_api
waiter_apiclient_context_paramsflush_structure)r!   doc_structurecontext_params_sections      r%   document_servicez"ServiceDocumenter.document_service/   s    
 *dmmF
 	

=,,W5611,?@}889LMN=44_EF11,?@!.!:!:#"
 	""#9:,,..r'   c                     |j                   j                  | j                  j                  j                         | j
                  j                  d| j                   |       y )Nzdocs.title.)section)styleh1r   	__class____name__r   emitr   r!   r7   s     r%   r   zServiceDocumenter.titleB   sP    //889  $,,-. 	! 	
r'   c                 >    |j                   j                  dd       y )NzTable of Contents   )r   depth)r8   table_of_contentsr=   s     r%   rA   z#ServiceDocumenter.table_of_contentsH   s    ''.A'Kr'   c                     d }	 | j                  | j                        }t        | j                  | j
                  |      j                  |       y # t        $ r Y <w xY wN)get_examplesr   r	   r   r   r   document_client)r!   r7   exampless      r%   r-   zServiceDocumenter.client_apiK   s[    	((););<H 	LL$..	

/'
" ! 		s   A 	AAc                 b    t        | j                  | j                        j                  |       y rC   )r   r   r   document_exceptionsr=   s     r%   r.   z#ServiceDocumenter.client_exceptionsV   s$    "LL$..	


g
&r'   c                     	 | j                   j                  | j                        }|j                  r3t        | j                  || j                        }|j                  |       y y # t        $ r Y y w xY wrC   )	r   get_paginator_modelr   r	   _paginator_configr   r   r   document_paginators)r!   r7   service_paginator_modelpaginator_documenters       r%   r/   zServiceDocumenter.paginator_api[   sv    	&*mm&G&G""'#
 #44#65t7K7K$  !44W=	 5 ! 		s   %A' '	A32A3c                     | j                   j                  rX| j                  j                  | j                        }t        | j                   || j                        }|j                  |       y y rC   )r   waiter_namesr   get_waiter_modelr   r   r   document_waiters)r!   r7   service_waiter_modelwaiter_documenters       r%   r0   zServiceDocumenter.waiter_apih   sa    <<$$#'==#A#A""$  !12D4H4H! ..w7 %r'   Nc                 h    | j                   j                  d      }|j                  |d|      }|d   S )Ndata_loaderz
examples-1rF   )r   get_componentload_service_model)r!   r"   api_versionloaderrF   s        r%   rD   zServiceDocumenter.get_examplesr   s:    ,,];,,,
 
##r'   c                 N   t         j                  }|j                  | j                  g       }| j                  j
                  j                  }|j                  }|D cg c]  }|j                  |vs| }}|r(t        | j                  |      }|j                  |       y y c c}w rC   )
r   OMITTED_CONTEXT_PARAMSgetr   r   r   service_modelclient_context_parametersnamedocument_context_params)	r!   r7   omitted_paramsparams_to_omitr^   raw_context_paramspcontext_paramscontext_param_documenters	            r%   r1   z'ServiceDocumenter.client_context_paramsy   s    6MM'++D,>,>C))77*DD)
QVV>-IA
 
 'D""N($ %<<WE	 
s   B"1B"rC   )r;   
__module____qualname__r&   r5   r   rA   r-   r.   r/   r0   rD   r1    r'   r%   r   r      s6    
,/&
L	#'
>8$Fr'   r   N)botocore.docs.bcdoc.restdocr   botocore.docs.clientr   r   r   botocore.docs.paginatorr   botocore.docs.waiterr   botocore.exceptionsr	   r   rj   r'   r%   <module>rp      s-    : 
 8 1 1mF mFr'   