o
    .&ßaX  ã                   @   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 d dl	m
Z
 G dd„ deƒZd	S )
é    )ÚDataNotFoundError)ÚClientDocumenter)ÚClientExceptionsDocumenter)ÚWaiterDocumenter)ÚPaginatorDocumenter)ÚDocumentStructurec                   @   sV   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
ddd„ZdS )ÚServiceDocumenterc                 C   s<   || _ || _| j j|dddd�| _| jjj| _g d¢| _d S )Nz	us-east-1ÚfooÚbar)Úregion_nameÚaws_access_key_idÚaws_secret_access_key)Útitleútable-of-contentsú
client-apiúclient-exceptionsúpaginator-apiú
waiter-api)Ú_sessionÚ_service_nameÚcreate_clientÚ_clientÚmetaÚeventsÚ_event_emitterÚsections)ÚselfÚservice_nameÚsession© r   ú7/usr/lib/python3/dist-packages/botocore/docs/service.pyÚ__init__   s   þzServiceDocumenter.__init__c                 C   sz   t | j| jdd�}|  | d¡¡ |  | d¡¡ |  | d¡¡ |  | d¡¡ |  | d¡¡ |  	| d¡¡ | 
¡ 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Útable_of_contentsÚ
client_apiÚclient_exceptionsÚpaginator_apiÚ
waiter_apiÚflush_structure)r   Údoc_structurer   r   r    Údocument_service(   s   þz"ServiceDocumenter.document_servicec                 C   s0   |j  | jjj¡ | jjdd| jf |d� d S )Nz
docs.%s.%sr   )Úsection)ÚstyleÚh1r   Ú	__class__Ú__name__r   Úemitr   ©r   r.   r   r   r    r   8   s   ÿ
ýzServiceDocumenter.titlec                 C   s   |j jddd� d S )NzTable of Contentsé   )r   Údepth)r/   r&   r4   r   r   r    r&   @   ó   z#ServiceDocumenter.table_of_contentsc                 C   s>   d }z|   | j¡}W n	 ty   Y nw t| j|ƒ |¡ d S ©N)Úget_examplesr   r   r   r   Údocument_client)r   r.   Úexamplesr   r   r    r'   C   s   ÿzServiceDocumenter.client_apic                 C   s   t | jƒ |¡ d S r8   )r   r   Údocument_exceptionsr4   r   r   r    r(   L   r7   z#ServiceDocumenter.client_exceptionsc                 C   sB   z	| j  | j¡}W n
 ty   Y d S w t| j|ƒ}| |¡ d S r8   )r   Úget_paginator_modelr   r   r   r   Údocument_paginators)r   r.   Úservice_paginator_modelÚpaginator_documenterr   r   r    r)   O   s   ÿÿÿzServiceDocumenter.paginator_apic                 C   s4   | j jr| j | j¡}t| j |ƒ}| |¡ d S d S r8   )r   Úwaiter_namesr   Úget_waiter_modelr   r   Údocument_waiters)r   r.   Úservice_waiter_modelÚwaiter_documenterr   r   r    r*   Y   s   ÿÿûzServiceDocumenter.waiter_apiNc                 C   s"   | j  d¡}| |d|¡}|d S )NÚdata_loaderz
examples-1r;   )r   Úget_componentÚload_service_model)r   r   Úapi_versionÚloaderr;   r   r   r    r9   a   s
   ÿzServiceDocumenter.get_examplesr8   )r2   Ú
__module__Ú__qualname__r!   r-   r   r&   r'   r(   r)   r*   r9   r   r   r   r    r      s    	
r   N)Úbotocore.exceptionsr   Úbotocore.docs.clientr   r   Úbotocore.docs.waiterr   Úbotocore.docs.paginatorr   Úbotocore.docs.bcdoc.restdocr   Úobjectr   r   r   r   r    Ú<module>   s   