o
    Vf~                     @   sV   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 dZdS )	    )DocumentStructure)ClientContextParamsDocumenterClientDocumenterClientExceptionsDocumenter)PaginatorDocumenter)WaiterDocumenter)DataNotFoundErrorc                   @   s^   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d ZdS )ServiceDocumenterc                 C   sB   || _ || _|| _| 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
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_path r"   V/home/ubuntu/oakencloud.com/venv/lib/python3.10/site-packages/botocore/docs/service.py__init__   s   zServiceDocumenter.__init__c                 C   s~   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
client_apiclient_exceptionspaginator_api
waiter_apiclient_context_paramsflush_structure)r   doc_structurecontext_params_sectionr"   r"   r#   document_service/   s   

z"ServiceDocumenter.document_servicec                 C   s.   |j | jjj | jjd| j |d d S )Nzdocs.title.)section)styleh1r   	__class____name__r   emitr   r   r2   r"   r"   r#   r   B   s   
zServiceDocumenter.titlec                 C   s   |j jddd d S )NzTable of Contents   )r   depth)r3   table_of_contentsr8   r"   r"   r#   r;   H   s   z#ServiceDocumenter.table_of_contentsc                 C   sB   d }z|  | j}W n	 ty   Y nw t| j| j|| d S N)get_examplesr   r   r   r   r   document_client)r   r2   examplesr"   r"   r#   r)   K   s   
zServiceDocumenter.client_apic                 C   s   t | j| j| d S r<   )r   r   r   document_exceptionsr8   r"   r"   r#   r*   V   s   z#ServiceDocumenter.client_exceptionsc                 C   sP   z	| j | j}W n
 ty   Y d S w |jr&t| j|| j}|| d S d S r<   )	r   get_paginator_modelr   r   _paginator_configr   r   r   document_paginators)r   r2   service_paginator_modelpaginator_documenterr"   r"   r#   r+   [   s   
zServiceDocumenter.paginator_apic                 C   s8   | j jr| j| j}t| j || j}|| d S d S r<   )r   waiter_namesr   get_waiter_modelr   r   r   document_waiters)r   r2   service_waiter_modelwaiter_documenterr"   r"   r#   r,   h   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#   r=   r   s
   zServiceDocumenter.get_examplesc                    sX   t j}|| jg  | jjj}|j} fdd|D }|r*t | j|}|| d S d S )Nc                    s   g | ]	}|j  vr|qS r"   )name).0pparams_to_omitr"   r#   
<listcomp>~   s    z;ServiceDocumenter.client_context_params.<locals>.<listcomp>)	r   OMITTED_CONTEXT_PARAMSgetr   r   r   service_modelclient_context_parametersdocument_context_params)r   r2   omitted_paramsrX   raw_context_paramscontext_paramscontext_param_documenterr"   rS   r#   r-   y   s   

z'ServiceDocumenter.client_context_paramsr<   )r6   
__module____qualname__r$   r1   r   r;   r)   r*   r+   r,   r=   r-   r"   r"   r"   r#   r	      s    

r	   N)botocore.docs.bcdoc.restdocr   botocore.docs.clientr   r   r   botocore.docs.paginatorr   botocore.docs.waiterr   botocore.exceptionsr   r	   r"   r"   r"   r#   <module>   s   