Ë
    rPêj+&  ã                   óì   — d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ dZ	 ej                  d«      ZdZ e j                  d«      Zd	d
dœdddœdd
dœdddœdœZddddœZ G d„ d«      Z G d„ de«      Zy)é    N)ÚOrderedDict)ÚDocStringParser)Ú	ReSTStylez&https://docs.aws.amazon.com/index.htmlzX`AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/[a-z0-9-.]*/[a-zA-Z]*>`_z�

    **{}**
    ::

        # This section is too large to render.
        # Please see the AWS API Documentation linked below.

    {}
    ÚbcdocszResponse SyntaxiÐ  )ÚnameÚ
line_limitzResponse Structureiˆ  zRequest SyntaxÚ
Parameters)zresponse-exampleÚdescriptionzrequest-examplezrequest-paramsé   é   )z
client-apizpaginator-apiz
waiter-apic                   óV   — e Zd Zdd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zy)ÚReSTDocumentc                 ó¦   — t        | «      | _        || _        t        | «      | _        d| _        d| _        i | _        i | _        g | _	        d | _
        y )NTF)r   ÚstyleÚtargetr   ÚparserÚ	keep_dataÚdo_translationÚtranslation_mapÚhrefsÚ_writesÚ_last_doc_string)Úselfr   s     ú`/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/botocore/docs/bcdoc/restdoc.pyÚ__init__zReSTDocument.__init__3   sM   € Ü˜t“_ˆŒ
ØˆŒÜ% dÓ+ˆŒØˆŒØ#ˆÔØ!ˆÔØˆŒ
ØˆŒØ $ˆÕó    c                 óZ   — | j                   r|�| j                  j                  |«       y y y ©N)r   r   Úappend©r   Úss     r   Ú_writezReSTDocument._write>   s&   € Ø�>Š>˜a˜mØ�L‰L×Ñ Õ"ð ,ˆ>r   c                 ó&   — | j                  |«       y)z2
        Write content into the document.
        N)r"   ©r   Úcontents     r   ÚwritezReSTDocument.writeB   s   € ð 	�‰�GÕr   c                 ó`   — | j                  | j                  j                  «       › |› d�«       y)z-
        Write content on a newline.
        ú
N)r"   r   Úspacesr$   s     r   ÚwritelnzReSTDocument.writelnH   s)   € ð 	�‰�t—z‘z×(Ñ(Ó*Ð+¨G¨9°BÐ7Õ8r   c                 ó    — | j                   d   S )zn
        Returns the last content written to the document without
        removing it from the stack.
        éÿÿÿÿ©r   ©r   s    r   Ú
peek_writezReSTDocument.peek_writeN   s   € ð
 �|‰|˜BÑÐr   c                 ój   — t        | j                  «      dkD  r| j                  j                  «       S dS )zL
        Removes and returns the last content written to the stack.
        r   N)Úlenr   Úpopr.   s    r   Ú	pop_writezReSTDocument.pop_writeU   s,   € ô &)¨¯©Ó%6¸Ò%:ˆt�|‰|×ÑÓ!ÐDÀÐDr   c                 ó:   — | j                   j                  |«       y)z2
        Places new content on the stack.
        N)r   r   r    s     r   Ú
push_writezReSTDocument.push_write[   s   € ð 	�‰×Ñ˜AÕr   c                 ó  — | j                   rX| j                  j                  «        | j                   j                  «       D ]!  \  }}| j                  j	                  ||«       Œ# dj                  | j                  «      j                  d«      S )zJ
        Returns the current content of the document as a string.
        Ú úutf-8)r   r   Únew_paragraphÚitemsÚlink_target_definitionÚjoinr   Úencode)r   ÚrefnameÚlinks      r   ÚgetvaluezReSTDocument.getvaluea   so   € ð �:Š:Ø�J‰J×$Ñ$Ô&Ø!%§¡×!1Ñ!1Ó!3ò A‘�˜Ø—
‘
×1Ñ1°'¸4Õ@ðAà�w‰w�t—|‘|Ó$×+Ñ+¨GÓ4Ð4r   c                 ó`   — |D �cg c]  }| j                   j                  ||«      ‘Œ  c}S c c}w r   )r   Úget)r   ÚwordsÚws      r   Útranslate_wordszReSTDocument.translate_wordsk   s)   € Ø8=Ö>°1�×$Ñ$×(Ñ(¨¨AÕ.Ò>Ð>ùÒ>s   …#+c                 óF   — |r| j                   r| j                  |«       y y y r   )r   r"   )r   Údatas     r   Úhandle_datazReSTDocument.handle_datan   s   € Ù�D—N’NØ�K‰K˜Õð #ˆ4r   c                 óR  — |rj	 t        | j                  «      }| j                  j                  |«       | j                  j	                  «        t        | j                  «      }||f| _        y y # t        $ r/ t        j                  dd¬«       t        j                  |«       Y y w xY w)NzError parsing doc stringT)Úexc_info)	r1   r   r   ÚfeedÚcloser   Ú	ExceptionÚLOGÚdebug)r   Ú
doc_stringÚstartÚends       r   Úinclude_doc_stringzReSTDocument.include_doc_stringr   s‡   € Ùð&Ü˜DŸL™LÓ)�Ø—‘× Ñ  Ô,Ø—‘×!Ñ!Ô#Ü˜$Ÿ,™,Ó'�Ø).°¨�Õ%ð øô ò &Ü—	‘	Ð4¸t�	ÔDÜ—	‘	˜*Ö%ð&ús   „A(A. Á.5B&Â%B&c                 óZ   — | j                   �| j                   \  }}| j                  ||…= y y r   )r   r   )r   rQ   rR   s      r   Úremove_last_doc_stringz#ReSTDocument.remove_last_doc_string~   s2   € à× Ñ Ð,Ø×.Ñ.‰JˆE�3Ø—‘˜U 3˜YÑ'ð -r   N)Úman)Ú__name__Ú
__module__Ú__qualname__r   r"   r&   r*   r/   r3   r5   r@   rE   rH   rS   rU   © r   r   r   r   2   s?   „ ó	%ò#òò9ò òEòò5ò?òò
&ó(r   r   c                   óÊ   ‡ — e Zd Zdˆ fd„	Zed„ «       Zed„ «       Zej                  d„ «       Zed„ «       Zed„ «       Z	d„ Z
dd„Zd	„ Zd
„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚDocumentStructurec                 ó¾   •— t         ‰| �  |¬«       || _        t        «       | _        | j                  g| _        i | _        |�|| _        |�| j                  |«       yy)a5  Provides a Hierarichial structure to a ReSTDocument

        You can write to it similiar to as you can to a ReSTDocument but
        has an innate structure for more orginaztion and abstraction.

        :param name: The name of the document
        :param section_names: A list of sections to be included
            in the document.
        :param target: The target documentation of the Document structure
        :param context: A dictionary of data to store with the strucuture. These
            are only stored per section not the entire structure.
        )r   N)Úsuperr   Ú_namer   Ú
_structureÚ_pathÚ_contextÚ_generate_structure)r   r   Úsection_namesr   ÚcontextÚ	__class__s        €r   r   zDocumentStructure.__init__†   s_   ø€ ô 	‰Ñ ÐÔ'ØˆŒ
Ü%›-ˆŒØ—j‘j�\ˆŒ
ØˆŒØÐØ#ˆDŒMØÐ$Ø×$Ñ$ ]Õ3ð %r   c                 ó   — | j                   S )z"The name of the document structure)r_   r.   s    r   r   zDocumentStructure.name�   s   € ð �z‰zÐr   c                 ó   — | j                   S )zv
        A list of where to find a particular document structure in the
        overlying document structure.
        ©ra   r.   s    r   ÚpathzDocumentStructure.path¢   s   € ð �z‰zÐr   c                 ó   — || _         y r   ri   )r   Úvalues     r   rj   zDocumentStructure.pathª   s	   € àˆ�
r   c                 ó,   — t        | j                  «      S r   )Úlistr`   r.   s    r   Úavailable_sectionsz$DocumentStructure.available_sections®   s   € ä�D—O‘OÓ$Ð$r   c                 ó   — | j                   S r   )rb   r.   s    r   re   zDocumentStructure.context²   s   € à�}‰}Ðr   c                 ó4   — |D ]  }| j                  |«       Œ y r   )Úadd_new_section)r   rd   Úsection_names      r   rc   z%DocumentStructure._generate_structure¶   s   € Ø)ò 	/ˆLØ× Ñ  Õ.ñ	/r   c                 ó  — | j                  || j                  |¬«      }| j                  |gz   |_        | j                  j                  |j                  _        | j
                  |_        | j                  |_        || j                  |<   |S )a�  Adds a new section to the current document structure

        This document structure will be considered a section to the
        current document structure but will in itself be an entirely
        new document structure that can be written to and have sections
        as well

        :param name: The name of the section.
        :param context: A dictionary of data to store with the strucuture. These
            are only stored per section not the entire structure.
        :rtype: DocumentStructure
        :returns: A new document structure to add to but lives as a section
            to the document structure it was instantiated from.
        )r   r   re   )rf   r   rj   r   Úindentationr   r   r`   )r   r   re   Úsections       r   rr   z!DocumentStructure.add_new_sectionº   sx   € ð  —.‘.Ø˜dŸk™k°7ð !ó 
ˆð —y‘y D 6Ñ)ˆŒà$(§J¡J×$:Ñ$:ˆ�‰Ô!Ø"&×"6Ñ"6ˆÔØŸ
™
ˆŒØ 'ˆ�‰˜ÑØˆr   c                 ó    — | j                   |   S )zRetrieve a section©r`   ©r   r   s     r   Úget_sectionzDocumentStructure.get_sectionÕ   s   € à�‰˜tÑ$Ð$r   c                 ó   — || j                   v S r   rx   ry   s     r   Úhas_sectionzDocumentStructure.has_sectionÙ   s   € Ø�t—‘Ð&Ð&r   c                 ó   — | j                   |= y)zDelete a sectionNrx   ry   s     r   Údelete_sectionz DocumentStructure.delete_sectionÜ   s   € à�O‰O˜DÑ!r   c                 ór  — t        | j                  «      }|dk(  re| j                  r€| j                  j	                  «        | j                  j                  «       D ]!  \  }}| j                  j                  ||«       Œ# n'|t        j                  | j                  d   «      k(  rd}| j                  «       }| j                  j                  «       D ]b  \  }}t        j                  |j                  «       «      }|r"|j                  d«      › d�j                  «       n|}||j!                  |«      z  }Œd t        |j#                  «       «      }	t$        j                  | j&                  «      }
|�|j                  «       nt(        }|
r/|	|
d   kD  r't*        j-                  |
d   |«      j                  «       }|S )zÍFlushes a doc structure to a ReSTructed string

        The document is flushed out in a DFS style where sections and their
        subsections' values are added to the string as they are visited.
        é   Nr   z

r   r   )r1   rj   r   r   r9   r:   r;   ÚSECTION_METHOD_PATH_DEPTHrB   r@   r`   ÚDOCUMENTATION_LINK_REGEXÚsearchÚdecodeÚgroupr=   Úflush_structureÚ
splitlinesÚSECTION_LINE_LIMIT_CONFIGr   ÚDEFAULT_AWS_DOCS_LINKÚLARGE_SECTION_MESSAGEÚformat)r   Ú	docs_linkÚpath_lengthr>   r?   rl   r   rv   ÚmatchÚ
line_countÚsection_configÚaws_docs_links               r   r†   z!DocumentStructure.flush_structureà   s‹  € ô ˜$Ÿ)™)“nˆØ˜!ÒØ�zŠzØ—
‘
×(Ñ(Ô*Ø%)§Z¡Z×%5Ñ%5Ó%7ò E‘M�G˜TØ—J‘J×5Ñ5°g¸tÕDñEð Ô5×9Ñ9¸$¿)¹)ÀA¹,ÓGÒGØˆIØ—‘“ˆØ!Ÿ_™_×2Ñ2Ó4ò 	8‰MˆD�'ô -×3Ñ3°E·L±L³NÓCˆEá49�5—;‘;˜q“>Ð" $Ð'×.Ñ.Ô0¸yð ð �W×,Ñ,¨YÓ7Ñ7‰Eð	8ô ˜×)Ñ)Ó+Ó,ˆ
Ü2×6Ñ6°t·y±yÓAˆð Ð$ð ×ÑÔä&ð 	ñ
 ˜j¨>¸,Ñ+GÒGÜ)×0Ñ0Ø˜vÑ&¨óç‰f‹hð ð ˆr   c                 óV   — dj                  | j                  «      j                  d«      S )Nr7   r8   )r<   r   r=   r.   s    r   r@   zDocumentStructure.getvalue
  s    € Ø�w‰w�t—|‘|Ó$×+Ñ+¨GÓ4Ð4r   c                 ó"   — t        «       | _        y r   )r   r`   r.   s    r   Úremove_all_sectionsz%DocumentStructure.remove_all_sections  s   € Ü%›-ˆ�r   c                 ó   — g | _         y r   r-   r.   s    r   Ú
clear_textzDocumentStructure.clear_text  s	   € Øˆ�r   c                 ó^   — | j                  d«      }|j                  j                  |«       |S )NÚtitle)rr   r   Úh1)r   r˜   Útitle_sections      r   Úadd_title_sectionz#DocumentStructure.add_title_section  s,   € Ø×,Ñ,¨WÓ5ˆØ×Ñ×Ñ˜uÔ%ØÐr   c                 ó2  — t         j                  j                  |«      st        j                  |«       t         j                  j	                  ||› d�«      }t        |d«      5 }|j                  | j                  «       «       d d d «       y # 1 sw Y   y xY w)Nz.rstÚwb)Úosrj   ÚexistsÚmakedirsr<   Úopenr&   r†   )r   Ú	full_pathÚ	file_nameÚsub_resource_file_pathÚfs        r   Úwrite_to_filezDocumentStructure.write_to_file  sq   € Ü�w‰w�~‰~˜iÔ(Ü�K‰K˜	Ô"Ü!#§¡§¡¨i¸I¸;ÀdÐ9KÓ!LÐÜÐ(¨$Ó/ð 	,°1Ø�G‰G�D×(Ñ(Ó*Ô+÷	,÷ 	,ñ 	,ús   Á$ BÂB)NrV   Nr   )rW   rX   rY   r   Úpropertyr   rj   Úsetterro   re   rc   rr   rz   r|   r~   r†   r@   r”   r–   r›   r¦   Ú__classcell__)rf   s   @r   r\   r\   …   s¨   ø„ õ4ð. ñó ðð ñó ðð 
‡[�[ñó ðð ñ%ó ð%ð ñó ðò/óò6%ò'ò"ó(òT5ò(òòö
,r   r\   )Úloggingrž   ÚreÚbotocore.compatr   Ú#botocore.docs.bcdoc.docstringparserr   Úbotocore.docs.bcdoc.styler   r‰   Úcompiler‚   rŠ   Ú	getLoggerrN   rˆ   r�   r   r\   rZ   r   r   ú<module>r±      s¨   ðó Û 	Û 	å 'Ý ?Ý /à@Ð Ø%˜2Ÿ:™:ðIóÐ ð	Ð ð €g×Ñ˜Ó!€à!2À$ÑGØ0ÀÑEØ 0ÀÑEØ+¸4Ñ@ñ	Ð ð ØØñÐ ÷P(ñ P(ôfX,˜õ X,r   