
    fj(                     L   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                     ee j        e                              Zd Zd ZdS )    N)
namedtuplec                 >    dddddddd                     | |           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    W/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/botocore/docs/utils.pypy_type_namer      s9       
c)Y     c                 D    ddddddddddd	
                     | 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   &   sB     +  
c)Ur   c                 R   | j                             d          }| j                             dd          }|                    d          r
|dd         }|                    d          r
|dd         }|r1|                                |                                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    
 "*../@AAM'++,A2FFJX&& $^
U## $^
 ,j&&((0C0C0E0EEE+j++++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 documentationNc           	      j    |g }|g }|g }t                                          | ||||||          S N)super__new__)clsr/   r   r0   r'   r1   r2   	__class__s          r   r7   zDocumentedShape.__new__`   sU     H?G#!ww
 
 	
r   )NNN)__name__
__module____qualname____doc__r7   __classcell__)r9   s   @r   r.   r.   ]   sN        LL 
 
 
 
 
 
 
 
 
 
r   c                       e Zd ZddZd ZdS )AutoPopulatedParamNc                 8    || _         || _        |	d| _        d S d S )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__{   s2    	!2$ """ %$r   c                    |                     d          ry| j        |j        v ri|                    | j                  }d|j        v r|                    d           |                    d          }|                    | j                   dS dS |                     d          r?|                    d          }| j        |j        v r|                    | j                   dS dS dS )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7 	2yG666!--di88 G$>>>**=999&-&9&9)' '# $++D,BCCCCC 76 ""#9:: 	2))*;<<GyG666&&ty11111	2 	266r   r5   )r:   r;   r<   rD   rS    r   r   r@   r@   z   s7           2 2 2 2 2r   r@   c                       e Zd ZdZd Zd ZdS )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 ]@}| j                            |||fz             | j                            |||fz             AdS )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__   s      .!ee"uuEH# 	N 	ND##NlD5I$IJJJ $$%5t8L%LMMMM	N 	Nr   c                     || j         v r|                    d          }n|| j        vrd S | j        |j        v r|                    | j                   d S d S )NrI   )r[   rK   rZ   rX   rJ   rL   )rC   rO   rP   rQ   s       r   
hide_paramz"HideParamFromOperations.hide_param   so    ---))*;<<GGt222F7#===""4#788888 >=r   N)r:   r;   r<   r=   rD   rc   rT   r   r   rV   rV      sA        D DN N N*9 9 9 9 9r   rV   c                       e Zd ZdZd Zd ZdS )AppendParamDocumentationz-Appends documentation to a specific parameterc                 "    || _         || _        d S r5   )rX   _doc_string)rC   r^   
doc_strings      r   rD   z!AppendParamDocumentation.__init__   s    -%r   c                     | j         |j        v rK|                    | j                   }|                    d          }|                    | j                   d S d S )NrG   )rX   rJ   rK   rM   rg   rN   s        r   append_documentationz-AppendParamDocumentation.append_documentation   sc    7#===))$*>??G")"5"56K"L"L''(899999 >=r   N)r:   r;   r<   r=   rD   rj   rT   r   r   re   re      s8        77& & &: : : : :r   re   c                   $    e Zd ZdZd Zd Zd ZdS )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                 >    || _         || _        || _        || _        d S 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                            d          k    r|                     ||           |j        D ]g}|                    |          }| j         |j                            d          k    r|                     ||           Q|                     ||           hd S )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 	 	L!--l;;K;#6#:#:7#C#CCC++JDDDD==   	 	r   c                    |                     d          s|                     d          rB|                                 |                                 |                    | j                   |                     d          s|                     d          rPd}|j        D ]}||vr|                    |           | j        Ld|j        v rC|                    d          }|                                 |                    | j                   |                    d          }|	                                
                    d                               d	          r;|                                 |                    d
|j         d| j                    d S |                                 |j                            d| j         d           |                    d           d S d S )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     "
 
 	3""#:;;	3 '')))   MM$1222  !
 
 #	(""#9::#	(  !( : 9 9  '777**<888 %1)W-GGG&-&9&9)' '# $..000#))$*?@@@ #..|<<L$$&&--g66AA'JJ ('')))""#LGL#L#LDN#L#LMMMMM'')))"**+Ct~+C+C+CDDD""3'''''G#	( #	(r   N)r:   r;   r<   r=   rD   rz   ry   rT   r   r   rl   rl      sK         
4 
4 
4  +( +( +( +( +(r   rl   z\nz\rz\tz\bz\f)
	|c                 B    t           |                     d                   S )Nr   )	_CONTROLSgroup)matchs    r   _CONTROLS_MATCH_HANDLERr   -  s    U[[^^$$r   c                 B    t                               t          |           S r5   )_ESCAPE_CONTROLS_REsubr   )values    r   escape_controlsr   1  s    ""#:EB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 2 2 2 2 2 2 2B$9 $9 $9 $9 $9 $9 $9 $9N: : : : : : : :N( N( N( N( N( N( N( N(d 



 	 !bj##bi*C*C!D!DEE % % %C C C C Cr   