� K�g`!��~�ddlZddlmZddlmZddlmZddlZddl m Z ddl m Z m Z ddlmZGd�d e��ZdS) �N)�DocumentStructure)�ServiceDocumenter)�DataNotFoundError)�Boto3ClientDocumenter)�ResourceDocumenter�ServiceResourceDocumenter)�ServiceContextc���eZdZej�ej�ej��d��Z �fd�Z d�Z d�Z d�Z d�Zd�Zd�Zd �Z�xZS) r�examplesc�`��t���||j|���||_|j�|��|_d|_|j|j���vr|j� |��|_gd�|_ ||_ d|_ dS)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 ��b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/boto3/docs/service.pyrzServiceDocumenter.__init__s���� �����%��$�)� � � � �&����*�1�1�,�?�?�� �!%��� � ��!4�!L�!L�!N�!N� N� N�%)�%8�%A�%A�,�%O�%O�D� "� � � �� � .��� ?� ����c��t|j|jd���}|�|�d����|�|�d����|�|�d����|�|�d����|jr(|� |�d����|� |�d����|�d ��}|� |��|� ��S) ziDocuments an entire service. :returns: The reStructured text of the documented service. �html)� section_names�targetrrrrrr r) 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_service9s4�� *� � �d�m�F� � � � � � � �=�,�,�W�5�5�6�6�6� ��� �1�1�(�;�;�<�<�<� ���=�4�4�\�B�B�C�C�C� ��� �1�1�)�<�<�=�=�=� � !� J� � !� !�-�";�";�K�"H�"H� I� I� I� ��� � 9� 9�*� E� E�F�F�F�!.�!:�!:�;K�!L�!L�� �"�"�#9�:�:�:��,�,�.�.�.r%c��d} |�|j��}n#t$rYnwxYwt|j|j|���|��dS)N)� get_examplesrrrrr �document_client)r"�sectionr s r$r+zServiceDocumenter.client_apiMsu���� ��(�(��);�<�<�H�H�� � � � � �D� ���� � �L�$�.�� � � �/�'� "� "� "� "� "s �� ,�,c�H�|j�d��|j���|�d��|j�d|j���|�d��|j���|j���|�d��|j���|j���|�|��|�|��dS)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�5�5�� ��� � � �� ������ �'�'��0�0�0� � � ��)�)�)�)�)r%c��tdd���}|�d��}|j�|jjjd|j����|�d��t|j |j |j ��� |��|j jjj}||jkrd}t"j�|j |j�|������}|�|d��|j�|j�d|�d ���dS) 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_resourcensQ��0� �v� � � ��2�A�A�,�O�O��� �$�$� �L� "� +�-J�d�6H�-J�-J� � � � � � �!@�A�A�A�!� � "�D�M�4�3G� � � � �0� 1� 1� 1��.�3�B�G� � �D�.� .� .�.�M�$&�G�L�L� � ��!� #��"�"�$�$� &�% �% �!� �*�*�+D�g�N�N�N�� ����!3�K�K�m�K�K�K�L�L�L�L�Lr%c ��d}|j�d��}|�|jd��}|jjjjj}|dD�]�}|d|}|jj � ||t|j|d|d������}|jj j } g} | D]} | �|���|| d|ji�} | jj j���}t%|d� ��} | �d ��}|j�|jjjd |j����|�d | jj j����t3| |j|j���| �| jj j����t8j�|j|j�|���}| �|d ��|j� |j�d|�d������dS)N�foo� data_loaderz resources-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�s��� %����,�,�]�;�;��$�7�7� � � � � ���.�3�:�?�M� �0��=�. �. �M�0��=�m�L�N��#�4�I�I�"/�4B�$2�%)�%7�2E�'�3�'4�-1� %�%�%�J� � � �'�+�:�F�K��D� � 3� 3��� � �1�2�2�2�2�#�|�T�?�$�,�?�?�H�$�M�8�=�C�C�E�E�M�,�]�6�J�J�J�L�!-�!=�!=�l�!K�!K� � � $� (� (�� �&�/�1N�$�:L�1N�1N� � � � � $� $�D���!=�!B�D�D� � � � ��$�-��)=� � ����,�,�X�]�-I�-N�O�O���� )+�� � ��$��%�'� �"�)�)� %� � &� &�'@�'� J� J� J� �M� !� !��%�=�=� �=�=�=� � � � �Y. �. r%c��tj�tj�|j|jdz����S)Nz.rst)rSrT�realpathrU� EXAMPLE_PATHr)r"s r$�_get_example_filez#ServiceDocumenter._get_example_file�s:���w��� �G�L�L��*�D�,>��,G� H� H� � � r%c�t�|���}tj�|��r�|j�d��|j���t|��5}|�|� ����ddd��dS#1swxYwYdSdS)N�Examples) rurSrT�isfiler=r>r?�openr@�read)r"r8� examples_file�fs r$r/z$ServiceDocumenter._document_examples�s����.�.�0�0� � �7�>�>�-� (� (� (� �M� � �Z� (� (� (� �M� "� "� $� $� $��m�$�$� (��� � �a�f�f�h�h�'�'�'� (� (� (� (� (� (� (� (� (� (� (� (���� (� (� (� (� (� (� (� (s�6(B+�+B/�2B/)rN� __module__� __qualname__rSrTrU�dirname�boto3�__file__rtrr4r+r.rCrDrur/� __classcell__)r#s@r$rrs���������7�<�<������� ?� ?��L�L�L� � � � � �8/�/�/�( #� #� #�*�*�*�,M�M�M�45�5�5�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�9�9�9�9�9�L�L�L�L�L�L�1�1�1�1�1�1� � � � �3�3�3�3�3�3�M�M�M�M�M�M�M�M�&�&�&�&�&�&�q(�q(�q(�q(�q(�-�q(�q(�q(�q(�q(r%
Memory