
    "hj(                     &   d dl Z d dlmZ d Zd Zd Z edg d      Z G d de      Z G d	 d
      Z G d d      Z	 G d d      Z
 G d d      ZddddddZ e j                  dj                   ee j                   e                  Zd Zd Zy)    N)
namedtuplec                 6    ddddddddj                  | |       S )zGet the Python type name for a given model type.

        >>> py_type_name('list')
        'list'
        >>> py_type_name('structure')
        'dict'

    :rtype: string
    bytesstringfloatintegerdictdatetime)blob	characterdoublelongmap	structure	timestampget	type_names    Q/root/.hermes/SkillClaw/.venv/lib/python3.12/site-packages/botocore/docs/utils.pypy_type_namer      s1      
c)Y     c                 <    ddddddddddd	
j                  | d
      S )zGet the Python default value for a given model type.

        >>> py_default('string')
        ''string''
        >>> py_default('list')
        '[...]'
        >>> py_default('unknown')
        '...'

    :rtype: string
    z123.0123z'string'zb'bytes'z
True|Falsez[...]z{...}zdatetime(2015, 1, 1))
r   r   r   r   r   booleanlistr   r   r   z...r   r   s    r   
py_defaultr   &   s:     + 
c)Ur   c                 "   | j                   j                  d      }| j                   j                  dd      }|j                  d      r|dd }|j                  d      r|dd }|r)|j                         |j                         vr	|d	| d
z  }|S )zwGenerate the official name of an AWS Service

    :param service_model: The service model representing the service
    serviceFullNameserviceAbbreviation Amazon   NAWS   z ())metadatar   
startswithlower)service_modelofficial_name
short_names      r   get_official_service_namer-   @   s    
 "**../@AM''++,A2FJX&^
U#^
j&&(0C0C0EE2j\++r   DocumentedShape)namer   documentationr'   membersrequired_membersc                   *     e Zd ZdZ	 	 	 d fd	Z xZS )r.   zBUse this class to inject new shapes into a model for documentationc           	      F    |g }|g }|g }t         |   | ||||||      S N)super__new__)clsr/   r   r0   r'   r1   r2   	__class__s          r   r7   zDocumentedShape.__new__`   sL     H?G#!w
 	
r   )NNN)__name__
__module____qualname____doc__r7   __classcell__)r9   s   @r   r.   r.   ]   s    L 
 
r   c                       e Zd ZddZd Zy)AutoPopulatedParamNc                 4    || _         || _        |d| _        y y )Nz{Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
)r/   param_description)selfr/   rB   s      r   __init__zAutoPopulatedParam.__init__{   s)    	!2$ " %r   c                    |j                  d      r| j                  |j                  v rg|j                  | j                        }d|j                  v r|j	                  d       |j                  d      }|j                  | j                         yy|j                  d      rF|j                  d      }| j                  |j                  v r|j	                  | j                         yyy)zDocuments auto populated parameters

        It will remove any required marks for the parameter, remove the
        parameter from the example, and add a snippet about the parameter
        being autopopulated in the description.
        docs.request-paramszis-requiredparam-documentationdocs.request-examplestructure-valueN)r(   r/   available_sectionsget_sectiondelete_sectionwritelnrB   rC   
event_namesectionkwargsdescription_sections        r   document_auto_populated_paramz0AutoPopulatedParam.document_auto_populated_param   s       !67yyG666!--dii8 G$>$>>**=9&-&9&9)'# $++D,B,BC 7 ""#9:))*;<GyyG666&&tyy1 7 ;r   r5   )r:   r;   r<   rD   rS    r   r   r@   r@   z   s    2r   r@   c                       e Zd ZdZd Zd Zy)HideParamFromOperationsa>  Hides a single parameter from multiple operations.

    This method will remove a parameter from documentation and from
    examples. This method is typically used for things that are
    automatically populated because a user would be unable to provide
    a value (e.g., a checksum of a serialized XML request body).c                     || _         t               | _        t               | _        d}d}|D ]B  }| j                  j	                  |||fz         | j                  j	                  |||fz         D y)a(  
        :type service_name: str
        :param service_name: Name of the service to modify.

        :type parameter_name: str
        :param parameter_name: Name of the parameter to modify.

        :type operation_names: list
        :param operation_names: Operation names to modify.
        z*docs.request-params.%s.%s.complete-sectionz+docs.request-example.%s.%s.complete-sectionN)_parameter_nameset_params_events_example_eventsadd)rC   service_nameparameter_nameoperation_namesparam_templateexample_templater/   s          r   rD   z HideParamFromOperations.__init__   sy      .!e"uEH# 	ND##NlD5I$IJ  $$%5t8L%LM	Nr   c                     || j                   v r|j                  d      }n|| j                  vry | j                  |j                  v r|j                  | j                         y y )NrI   )r[   rK   rZ   rX   rJ   rL   )rC   rO   rP   rQ   s       r   
hide_paramz"HideParamFromOperations.hide_param   s_    ---))*;<Gt2227#=#==""4#7#78 >r   N)r:   r;   r<   r=   rD   rc   rT   r   r   rV   rV      s    DN*9r   rV   c                       e Zd ZdZd Zd Zy)AppendParamDocumentationz-Appends documentation to a specific parameterc                      || _         || _        y r5   )rX   _doc_string)rC   r^   
doc_strings      r   rD   z!AppendParamDocumentation.__init__   s    -%r   c                     | j                   |j                  v rH|j                  | j                         }|j                  d      }|j                  | j                         y y )NrG   )rX   rJ   rK   rM   rg   rN   s        r   append_documentationz-AppendParamDocumentation.append_documentation   sW    7#=#==))$*>*>?G")"5"56K"L''(8(89 >r   N)r:   r;   r<   r=   rD   rj   rT   r   r   re   re      s    7&:r   re   c                   "    e Zd ZdZd Zd Zd Zy)DocumentModifiedShapea2  Modifies the documentation for a shape to reflect runtime transformations.

    This is used when a handler transforms a shape's value at runtime
    (e.g., decoding a JSON string into a dict) and the documentation
    needs to reflect the actual Python type returned rather than the
    modeled type.
    c                 <    || _         || _        || _        || _        y r5   )_shape_name	_new_type_new_description_new_example_value)rC   
shape_namenew_typenew_descriptionnew_example_values        r   rD   zDocumentModifiedShape.__init__   s#     &! /"3r   c                 V   | j                   |j                  j                  d      k(  r| j                  ||       |j                  D ]`  }|j                  |      }| j                   |j                  j                  d      k(  r| j                  ||       O| j                  ||       b y )Nshape)rn   contextr   _replace_documentationrJ   rK   (replace_documentation_for_matching_shape)rC   rO   rP   rQ   section_namesub_sections         r   rz   z>DocumentModifiedShape.replace_documentation_for_matching_shape   s     w227;;''
G<#66 	L!--l;K;#6#6#:#:7#CC++JD==	r   c                    |j                  d      s|j                  d      r;|j                          |j                          |j                  | j                         |j                  d      s|j                  d      rEd}|j
                  D ]  }||vs|j                  |        | j                  Jd|j
                  v r<|j                  d      }|j                          |j                  | j                         |j                  d      }|j                         j                  d      j                  d	      r<|j                          |j                  d
|j                   d| j                          y |j                          |j                  j                  d| j                   d       |j                  d       y y )NrH   zdocs.response-examplerF   zdocs.response-params)z
param-namerG   zend-structure
param-typez	end-paramrG   r~   zutf-8z:typez:type z: (z) -- )r(   remove_all_sections
clear_textwriterq   rJ   rL   rp   rK   getvaluedecoder/   ro   styleitalics)rC   rO   rP   allowed_sectionsr{   rR   type_sections          r   ry   z,DocumentModifiedShape._replace_documentation   s     "
""#:;'') MM$112  !
""#9:  !( : : 9  '77**<8	9 %%1)W-G-GG&-&9&9)'# $..0#))$*?*?@ #..|<L$$&--g6AA'J'')""VGLL>DNN;K#LM'')""**Qt~~.>d+CD""3'C ;r   N)r:   r;   r<   r=   rD   rz   ry   rT   r   r   rl   rl      s    
4+(r   rl   z\nz\rz\tz\bz\f)
	|c                 2    t         | j                  d         S )Nr   )	_CONTROLSgroup)matchs    r   _CONTROLS_MATCH_HANDLERr   -  s    U[[^$$r   c                 6    t         j                  t        |       S r5   )_ESCAPE_CONTROLS_REsubr   )values    r   escape_controlsr   1  s    ""#:EBBr   )recollectionsr   r   r   r-   _DocumentedShaper.   r@   rV   re   rl   r   compilejoinr   escaper   r   r   rT   r   r   <module>r      s    
 " *4  
 
& 
:2 2B$9 $9N: :N( N(d 



	 !bjj#bii*C!DE %Cr   