� K�g;����ddlZddlmZddlmZddlmZddlmZddl m Z m Z m Z ddl mZddlmZdd lmZdd lmZmZmZmZdd lmZGd �d e��ZGd�de��ZdS)�N)� xform_name)�DocumentStructure)�get_official_service_name)�ActionDocumenter)�document_attribute�document_identifier�document_reference)�BaseDocumenter)�CollectionDocumenter)�SubResourceDocumenter)�add_resource_type_overview�!get_identifier_args_for_signature�get_identifier_description�!get_identifier_values_for_example)�WaiterResourceDocumenterc�x��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z d �Z d �Z d �Z d �Zd �Zd�Zd�Zd�Z�xZS)�ResourceDocumenterc����t���|��||_||_|j���|_|j|jkr d|_dSdS)Nzservice-resource)�super�__init__�_botocore_session�_root_docs_path�_resource_name�lower�_resource_sub_path� _service_name)�self�resource�botocore_session�root_docs_path� __class__s ��c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/boto3/docs/resource.pyrzResourceDocumenter.__init__&si��� ������"�"�"�!1���-���"&�"5�";�";�"=�"=��� � �$�"4� 4� 4�&8�D� #� #� #� 5� 4�c��|�|��|�|��|�|��|�|��|�|��|�|��|�|��|�|��|�|��|� |��dS)N) � _add_title�_add_resource_note� _add_intro�_add_identifiers�_add_attributes�_add_references� _add_actions�_add_sub_resources�_add_collections� _add_waiters�r�sections r"�document_resourcez$ResourceDocumenter.document_resource.s��� ���� � � � ����(�(�(� ���� � � � ���g�&�&�&� ���W�%�%�%� ���W�%�%�%� ���'�"�"�"� ����(�(�(� ���g�&�&�&� ���'�"�"�"�"�"r#c�n�|�d��}|j�|j��dS)N�title)�add_new_section�style�h2r�rr0� title_sections r"r%zResourceDocumenter._add_title:s5���/�/��8�8� �����t�2�3�3�3�3�3r#c�d�g}|jjr)|jjD]}|�|j���t |��}|�d��}|j�|j�d|�d����|�d��}|� |��|�d��}|� ||��|�d��}|� ||��|�d��} | j� ��dS) N� start_class�(�))� class_name� description�example�params� end_class) �_resource_model� identifiers�append�namerr4r5�start_sphinx_py_classr=�_add_description� _add_example�_add_params_description�end_sphinx_py_class) rr0�identifier_names� identifier� class_argsr:�description_section�example_section� param_sectionrAs r"r'zResourceDocumenter._add_intro>sM���� � � +� 9�"�2�>� 9� 9� � �'�'� ��8�8�8�8�7�7G�H�H� ��-�-�m�<�<� ���/�/��/�9�9�J�9�9�9� 0� � � � *�9�9�-�H�H�� ���1�2�2�2�&�5�5�i�@�@�� ���/�+;�<�<�<�$�3�3�H�=�=� � �$�$�]�4D�E�E�E��+�+�K�8�8� ���+�+�-�-�-�-�-r#c�n�t|j��}|�d|�d|j����dS)NzA resource representing an � )r�_service_model�writer�rr0�official_service_names r"rGz#ResourceDocumenter._add_description[sJ�� 9�$�:M� N� N��� � � W�*?� W� W�$�BU� W� W� � � � � r#c �>�|j���|j���|�d��|j���|j���|�|j�d|j�d���|j���t |��}|�t |j���d|j�d|j�d|�d���|j���dS)N� import boto3� = boto3.resource('�')z = �.r;r<) r5�start_codeblock�new_linerTrrrr� end_codeblock)rr0rK�example_valuess r"rHzResourceDocumenter._add_exampleas ��� �%�%�'�'�'�� ��� � � �� � �n�%�%�%�� ��� � � �� ��� � � �� � ��!� N� N�t�7I� N� N� N� � � � � ��� � � �:�;K�L�L��� � ��$�-�.�.� o� o�4�3E� o� o��H[� o� o�^l� o� o� o� � � � � �#�#�%�%�%�%�%r#c��|D]}}t|j|��}|�d|�d���|j���|�d|�d|����|j����~dS)Nz:type z: stringz:param z: )rrrTr5r])rr0rK�identifier_namer>s r"rIz*ResourceDocumenter._add_params_descriptionqs���/� %� %�O�4��#�_���K� �M�M�<�?�<�<�<� =� =� =� �M� "� "� $� $� $� �M�M�D�O�D�D�{�D�D� E� E� E� �M� "� "� $� $� $� $� %� %r#c�$�|j���|�d|�d���|j���|j���|j|D]}|j�|����dS)Nz#These are the resource's available �:)r5r]rT�toctree� member_map�tocitem)rr0�resource_member_type�members r"�_add_overview_of_member_typez/ResourceDocumenter._add_overview_of_member_type{s���� ��� � � �� � � J�3G� J� J� J� � � � � ��� � � �� �������o�&:�;� /� /�F� �M� !� !�V�+� .� .� .� .� /� /r#c�,�|jjjj}|�d��}g}|r||jd<t |ddd���|D�])}|�|j��t|jd���}|�d��}|j � |j d ��|� d |j����|�|j��|�|jd |j�d �i� ��}t!||j|���t$j�|j|j�|j���}|�||j����+|r|�|d��dSdS)NrC� IdentifierszYIdentifiers are properties of a resource that are set upon instantiation of the resource.�identifiers_attributes_intro�r0� resource_typer>� intro_link�html��target� breadcrumb�indexz / Identifier / � qualifierr[��context)r0� resource_name�identifier_model)� _resource�meta�resource_modelrCr4rer rDrErr5�ref�_resource_class_namerT�add_title_sectionr=rr�os�path�joinrrr� write_to_fileri) rr0rC� member_listrL�identifier_doc�breadcrumb_section�identifier_section�identifiers_dir_paths r"r(z#ResourceDocumenter._add_identifiers�s����n�)�8�D� ��)�)�-�8�8��� � � �-8�D�O�M� *� &��+�>�:� � � � �&� P� P�J� � � �z�� /� /� /�.�z��v�N�N�N�N�!/�!?�!?� �!M�!M� � � $� (� (��)B�G� L� L� L� � $� $�%I� ��%I�%I� J� J� J� � ,� ,�Z�_� =� =� =�!/�!?�!?���$���&;�&;�&;�<�"@�"�"� � �*�"�1�!+� � � � �$&�7�<�<��$��%�'��*�,�$�$� � � (� (�)=�z�� O� O� O� O� � F� � -� -�g�}� E� E� E� E� E� F� Fr#c �6�|jjjjj}i}|jjjjrM|�|jjjj��}|jjj�|��}|�d��}g}|rt|ddd���||j d<t|��D�]7}||\}}|� |��t|d���} | �d��} | j�|jd ��| �d |����| �|��| �|d |j�d �i� ��} t)| |j|j||jjjjj|���t0j�|j|j�|j���} | �| |����9|r|�|d��dSdS)N� attributes� Attributesz�Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the :py:meth:`load` method.rlrmrprqrsrtz / Attribute / rur[rv)r0� service_namerx� attr_name� event_emitter� attr_model)rzr{�client� service_modelr|�shape� shape_for�get_attributesr4r re�sortedrDrr5r}r~rTrr=rrr�eventsr�r�r�rrr�ri) rr0r�r�r��attribute_listr��_� attr_shape� attribute_docr��attribute_section�attributes_dir_paths r"r)z"ResourceDocumenter._add_attributes�sd����+�2�7�E� �� � �>� � -� 3� �!�+�+���#�2�8���E���,�;�J�J����J��)�)�,�7�7���� � ;� &��*�/� :� � � � �-;�D�O�L� )�� �+�+� H� H�I�&�y�1�M�A�z� � !� !�)� ,� ,� ,�-�i��G�G�G�M�!.�!>�!>�|�!L�!L� � � $� (� (��)B�G� L� L� L� � $� $�%B�y�%B�%B� C� C� C� � +� +�I� 6� 6� 6� -� =� =��$���&;�&;�&;�<�!>�!�!� � �)�!�/�"�1�#�"�n�1�8�=�D�%�  � � � �#%�'�,�,��$��%�'��*�,�#�#� � � '� '�(;�Y� G� G� G� G� � E� � -� -�g�|� D� D� D� D� D� E� Er#c� �|�d��}|jjjj}g}|rt |ddd���||jd<|D�]#}|�|j��t|jd���}|�d��}|j � |j d ��|� d |j����|�|j��|�|jd |j�d �i� ��}t!||���t"j�|j|j�|j���}|�||j����%|r|�|d��dSdS)N� references� ReferenceszNReferences are related resource instances that have a belongs-to relationship.�references_intrormrprqrsrtz / Reference / rur[rv)r0�reference_model)r4rzr{r|r�r rerDrErr5r}r~rTrr=r r�r�r�rrrr�ri) rr0r��reference_list� reference� reference_docr��reference_section�references_dir_paths r"r*z"ResourceDocumenter._add_references�s����)�)�,�7�7���^�(�7�B� ��� � ;� &��*�1�.� � � � �-;�D�O�L� )�#� M� M�I� � !� !�)�.� 1� 1� 1�-�i�n�V�L�L�L�M�!.�!>�!>�|�!L�!L� � � $� (� (��)B�G� L� L� L� � $� $�%G�y�~�%G�%G� H� H� H� � +� +�I�N� ;� ;� ;� -� =� =���$���&;�&;�&;�<�!>�!�!� � �)� )� � � � � #%�'�,�,��$��%�'��*�,�#�#� � � '� '�(;�Y�^� L� L� L� L� � E� � -� -�g�|� D� D� D� D� D� E� Er#c��|�d��}|jjjj}|rSt |j|j��}|j|_|�|��|� |d��dSdS)N�actions) r4rzr{r|r�rrre�document_actionsri)rr0r�� documenters r"r+zResourceDocumenter._add_actionss����)�)�)�4�4���.�%�4�<�� � B�)�$�.�$�:N�O�O�J�$(�O�J� !� � '� '�� 0� 0� 0� � -� -�g�y� A� A� A� A� A�  B� Br#c��|�d��}|jjjj}|rSt |j|j��}|j|_|�|��|� |d��dSdS)Nz sub-resources) r4rzr{r|� subresourcesr rre�document_sub_resourcesri)rr0� sub_resourcesr�s r"r,z%ResourceDocumenter._add_sub_resourcess����)�)�/�:�:����+�:�G� � � H�.���� 4���J�%)�O�J� !� � -� -�g� 6� 6� 6� � -� -�g�� G� G� G� G� G�  H� Hr#c��|�d��}|jjjj}|rSt |j|j��}|j|_|�|��|� |d��dSdS)N� collections) r4rzr{r|r�r rre�document_collectionsri)rr0r�r�s r"r-z#ResourceDocumenter._add_collections(s����)�)�-�8�8���n�)�8�D� � � F�-���� 4���J�%)�O�J� !� � +� +�G� 4� 4� 4� � -� -�g�}� E� E� E� E� E�  F� Fr#c�F�|�d��}|jjjj}|rs|j�|j��}t|j||j ��}|j |_ |� |��|� |d��dSdS)N�waiters) r4rzr{r|r�r�get_waiter_modelrrrre�document_resource_waitersri)rr0r��service_waiter_modelr�s r"r.zResourceDocumenter._add_waiters3s����)�)�)�4�4���.�%�4�<�� � B�#'�#9�#J�#J��"�$�$� �2��� 4�d�6J���J�%)�O�J� !� � 0� 0�� 9� 9� 9� � -� -�g�y� A� A� A� A� A� B� Br#c��|�d��}|j���|�d��|j���dS)Nzfeature-freezez�Before using anything on this page, please refer to the resources :doc:`user guide <../../../../guide/resources>` for the most recent guidance on using resources.)r4r5� start_noterT�end_noter/s r"r&z%ResourceDocumenter._add_resource_noteAsa���)�)�*:�;�;��� � � �"�"�"�� � � +� � � � � ��� � � � � r#)�__name__� __module__� __qualname__rr1r%r'rGrHrIrir(r)r*r+r,r-r.r&� __classcell__)r!s@r"rr%s1�������9�9�9�9�9� #� #� #�4�4�4�.�.�.�: � � � &�&�&� %�%�%�/�/�/�*F�*F�*F�X7E�7E�7E�r(E�(E�(E�TB�B�B� H� H� H� F� F� F� B� B� B�!�!�!�!�!�!�!r#rc�6�eZdZed���Zd�Zd�Zd�ZdS)�ServiceResourceDocumenterc��|j�d�S)Nz.ServiceResource)�_service_docs_name)rs r"r=z$ServiceResourceDocumenter.class_nameMs���)�;�;�;�;r#c�d�|�d��}|j�d��dS)Nr3zService Resource)r4r5r6r7s r"r%z$ServiceResourceDocumenter._add_titleQs3���/�/��8�8� �����1�2�2�2�2�2r#c�^�t|j��}|�d|����dS)NzA resource representing )rrSrTrUs r"rGz*ServiceResourceDocumenter._add_descriptionUs5�� 9�$�:M� N� N��� � �H�1F�H�H�I�I�I�I�Ir#c�t�|j���|j���|�d��|j���|j���|�|j�d|j�d���|j���dS)NrXrYrZ)r5r\r]rTrr^)rr0rKs r"rHz&ServiceResourceDocumenter._add_exampleYs���� �%�%�'�'�'�� ��� � � �� � �n�%�%�%�� ��� � � �� ��� � � �� � ��!� N� N�t�7I� N� N� N� � � � � �#�#�%�%�%�%�%r#N)r�r�r��propertyr=r%rGrH�r#r"r�r�Ls]������ �<�<��X�<�3�3�3�J�J�J� &� &� &� &� &r#r�)r��botocorer�botocore.docs.bcdoc.restdocr�botocore.docs.utilsr�boto3.docs.actionr�boto3.docs.attrrrr �boto3.docs.baser �boto3.docs.collectionr �boto3.docs.subresourcer �boto3.docs.utilsr rrr�boto3.docs.waiterrrr�r�r#r"�<module>r�sz�� � � � �������9�9�9�9�9�9�9�9�9�9�9�9�.�.�.�.�.�.����������� +�*�*�*�*�*�6�6�6�6�6�6�8�8�8�8�8�8������������� 7�6�6�6�6�6�d!�d!�d!�d!�d!��d!�d!�d!�N &�&�&�&�&� 2�&�&�&�&�&r#
Memory