File: //opt/alt/python37/lib/python3.7/site-packages/boto3/docs/__pycache__/service.cpython-37.pyc
B
�P�e`! � @ sp d dl Z d dlmZ d dlmZ d dlmZ d dlZd dl m
Z
d dlmZm
Z
d dlmZ G dd � d e�ZdS )
� N)�DocumentStructure)�ServiceDocumenter)�DataNotFoundError)�Boto3ClientDocumenter)�ResourceDocumenter�ServiceResourceDocumenter)�ServiceContextc sl e Zd Zej�ej�ej�d�Z � fdd�Z
dd� Zdd� Zdd � Z
d
d� Zdd
� Zdd� Zdd� Z� ZS )r �examplesc sp t � j||j|d� || _| j�|�| _d | _| j| j�� krL| j� |�| _dddddddg| _
|| _d | _d S )
N)�service_name�session�root_docs_path�title�client�
paginators�waiters� resourcesr zcontext-paramszLhttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html)
�super�__init__�_session�_boto3_sessionr �_client�_service_resource�
_service_nameZget_available_resources�resource�sections�_root_docs_path�_USER_GUIDE_LINK)�selfr
r r )� __class__� �C/opt/alt/python37/lib/python3.7/site-packages/boto3/docs/service.pyr s$ zServiceDocumenter.__init__c C s� t | j| jdd�}| �|�d�� | �|�d�� | �|�d�� | �|�d�� | jrh| � |�d�� | �
|�d�� |�d �}| �|� |�� S )
ziDocuments an entire service.
:returns: The reStructured text of the documented service.
�html)Z
section_names�targetr
r r r r r zcontext-params)
r r r r
Zget_section�
client_apiZ
paginator_apiZ
waiter_apir �resource_section�_document_examplesZclient_context_paramsZflush_structure)r Z
doc_structureZcontext_params_sectionr r r �document_service9 s
z"ServiceDocumenter.document_servicec C sD d }y| � | j�}W n tk
r( Y nX t| j| j|��|� d S )N)Zget_examplesr r r r r Zdocument_client)r �sectionr r r r r# M s zServiceDocumenter.client_apic C s� |j �d� |j �� |�d� |j jd| jd� |�d� |j �� |j �� |�d� |j �� |j �� | �|� | �|� d S )NZ Resourcesz�Resources are available in boto3 via the ``resource`` method. For more detailed instructions and examples on the usage of resources, see the resources z
user guide)r
�link�.zThe available resources are:) �style�h2�new_line�writeZ
external_linkr Ztoctree�_document_service_resource�_document_resources)r r'