Current File : //usr/lib/python3/dist-packages/boto3/docs/__pycache__/service.cpython-312.pyc
�

��e`!��v�ddlZddlmZddlmZddlmZddlZddl	m
Z
ddlmZm
Z
ddlmZGd�d	e�Zy)
�N)�DocumentStructure)�ServiceDocumenter)�DataNotFoundError)�Boto3ClientDocumenter)�ResourceDocumenter�ServiceResourceDocumenter)�ServiceContextc����eZdZejjejj
ej�d�Z	�fd�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd	�Z�xZS)
r�examplesc�T��t�|�||j|��||_|jj	|�|_d|_|j|jj�vr |jj|�|_gd�|_
||_d|_y)N)�service_name�session�root_docs_path)�title�client�
paginators�waiters�	resourcesr�context-paramszLhttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html)
�super�__init__�_session�_boto3_sessionr�_client�_service_resource�
_service_name�get_available_resources�resource�sections�_root_docs_path�_USER_GUIDE_LINK)�selfr
rr�	__class__s    ��4/usr/lib/python3/dist-packages/boto3/docs/service.pyrzServiceDocumenter.__init__s����
���%��$�$�)�	�	
�&����*�*�1�1�,�?���!%�������!4�!4�!L�!L�!N�N�%)�%8�%8�%A�%A�,�%O�D�"�
��
� .���
?�	
��c�B�t|j|jd��}|j|j	d��|j|j	d��|j
|j	d��|j|j	d��|jr |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�targetrrrrrrr)
rrrr�get_section�
client_api�
paginator_api�
waiter_apir�resource_section�_document_examples�client_context_params�flush_structure)r"�
doc_structure�context_params_sections   r$�document_servicez"ServiceDocumenter.document_service9s���
*����d�m�m�F�
�
�	
�
�
�=�,�,�W�5�6����
�1�1�(�;�<����=�4�4�\�B�C����
�1�1�)�<�=��!�!��!�!�-�";�";�K�"H�I����
� 9� 9�*� E�F�!.�!:�!:�;K�!L���"�"�#9�:��,�,�.�.r%c��d}	|j|j�}t|j|j
|�j
|�y#t$rY�<wxYw)N)�get_examplesrrrrr �document_client)r"�sectionrs   r$r+zServiceDocumenter.client_apiMs[����	��(�(��);�);�<�H�	��L�L�$�.�.��	
�
�/�'�
"��!�	��	�s�A�	A�Ac�6�|jjd�|jj�|jd�|jj	d|j
��|jd�|jj�|jj�|jd�|jj�|jj
�|j|�|j|�y)N�	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�write�
external_linkr!�toctree�_document_service_resource�_document_resources)r"r8s  r$r.z"ServiceDocumenter.resource_sectionXs����
�
����%��
�
��� ��
�
�
�	
�	�
�
�#�#���&�&�	$�	
�	�
�
�c���
�
��� ��
�
��� ��
�
�4�5��
�
��� ��
�
�����'�'��0�� � ��)r%c���tdd��}|jd�}|jj|jj
jd|j���|jd�t|j|j|j�j|�|jjjj }||jk(rd}t"j$j'|j|j�|j)���}|j+|d�|jj-|j�d|�d	��y)
Nzservice-resourcer'�r)�
breadcrumb�../../z / Resource / ServiceResource�index�/�/index)r�add_new_sectionr=�refrr#�__name__rr@rrrr �document_resource�meta�resource_model�name�os�path�join�lower�
write_to_file�tocitem)r"r8�service_resource_doc�breadcrumb_section�
resource_name�service_resource_dir_paths      r$rCz,ServiceDocumenter._document_service_resourcens:��0��v� 
��2�A�A�,�O��� � �$�$��L�L�"�"�+�+�v�d�6H�6H�5I�-J�	
�	� � �!@�A�!��"�"�D�M�M�4�3G�3G�	
�
�
�0�
1��.�.�3�3�B�B�G�G�
��D�.�.�.�.�M�$&�G�G�L�L�� � ��!�!�"��"�"�$�%�%
�!�
	�*�*�+D�g�N��
�
����!3�!3� 4�A�m�_�F�K�Lr%c�N�d}|jjd�}|j|jd�}|jj
jj
j}|dD�]/}|d|}|jjj||t|j|d|d����}|j
jj}	g}
|	D]}|
j|��||
d|ji�}|j
jj j#�}t%|d�	�}
|
j'd
�}|j(j+|jj,j.d|j���|j1d|j
jj ���t3||j|j4�j7|
j'|j
jj ��t8j:j=|j4|j�|��}|
j?|d
�|j(jA|j�d|�d����2y)N�foo�data_loaderzresources-1r)r
�resource_json_definitions�
service_model�service_waiter_model)r[�single_resource_json_definition�service_contextrr'rFrGrHz / Resource / rIrJrK)!r�
get_component�load_service_modelrrrPrrar�resource_factory�load_from_definitionr	rQ�identifiers�appendrrRrVrrLr=rMr#rNr@rr rOrSrTrUrWrX)r"r8�temp_identifier_value�loader�json_resource_modelrar[rQ�resource_clsri�args�_r�resource_docrZr\s                r$rDz%ServiceDocumenter._document_resources�si�� %�����,�,�]�;��$�7�7����
�
���.�.�3�3�:�:�?�?�M�M�
�0��=�.	�M�0��=�m�L�N��#�#�4�4�I�I�"/�4B�$2�%)�%7�%7�2E�'�3�'4�-1�
%�J��
�'�+�+�:�:�F�F�K��D� �
3�����1�2�
3�#�T�?�$�,�,�?�H�$�M�M�8�8�=�=�C�C�E�M�,�]�6�J�L�!-�!=�!=�l�!K���$�$�(�(����&�&�/�/�6�$�:L�:L�9M�1N�
�
�$�$� ����!=�!=�!B�!B� C�D�
�
��$�-�-��)=�)=�
����,�,�X�]�]�-I�-I�-N�-N�O��
)+������$�$��%�%�&� �/�)�%�

�&�&�'@�'�J��M�M�!�!��%�%�&�a�
��f�=�
�Y.	r%c��tjjtjj|j|j
dz��S)Nz.rst)rSrT�realpathrU�EXAMPLE_PATHr)r"s r$�_get_example_filez#ServiceDocumenter._get_example_file�s<���w�w����G�G�L�L��*�*�D�,>�,>��,G�H�
�	
r%c�L�|j�}tjj|�ri|jjd�|jj
�t|�5}|j|j��ddd�yy#1swYyxYw)N�Examples)
rurSrT�isfiler=r>r?�openr@�read)r"r8�
examples_file�fs    r$r/z$ServiceDocumenter._document_examples�s}���.�.�0�
�
�7�7�>�>�-�(��M�M���Z�(��M�M�"�"�$��m�$�
(���
�
�a�f�f�h�'�
(�
(�)�
(�
(�s�0 B�B#)rN�
__module__�__qualname__rSrTrU�dirname�boto3�__file__rtrr4r+r.rCrDrur/�
__classcell__)r#s@r$rrsR����7�7�<�<��������� ?��L�L�
�8/�(	#�*�,M�45�n
�
(r%r)rS�botocore.docs.bcdoc.restdocr�botocore.docs.servicer�BaseServiceDocumenter�botocore.exceptionsrr��boto3.docs.clientr�boto3.docs.resourcerr�boto3.utilsr	�r%r$�<module>r�s.��
�9�L�1��3�M�&�q(�-�q(r%