
    Pe|                        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
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    5/usr/lib/python3/dist-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.
        zdocs.request-paramszis-requiredparam-documentationz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   rQ    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 )NrG   )rY   rI   rX   rV   rH   rJ   )rC   rM   rN   rO   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   ra   rR   r   r   rT   rT      s    DN*9r   rT   c                       e Zd ZdZd Zd Zy)AppendParamDocumentationz-Appends documentation to a specific parameterc                      || _         || _        y r5   )rV   _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 )NrF   )rV   rH   rI   rK   re   rL   s        r   append_documentationz-AppendParamDocumentation.append_documentation   sW    7#=#==))$*>*>?G")"5"56K"L''(8(89 >r   N)r:   r;   r<   r=   rD   rh   rR   r   r   rc   rc      s    7&:r   rc   z\nz\rz\tz\bz\f)
	|c                 2    t         | j                  d         S )Nr   )	_CONTROLSgroup)matchs    r   <lambda>rs      s    	%++a.(A r   c                 6    t         j                  t        |       S r5   )_ESCAPE_CONTROLS_REsub_CONTROLS_MATCH_HANDLER)values    r   escape_controlsry      s    ""#:EBBr   )recollectionsr   r   r   r-   _DocumentedShaper.   r@   rT   rc   rp   compilejoinr   escaperu   rw   ry   rR   r   r   <module>r      s    
 " *4  
 
& 
:2 2B$9 $9N: : 



	 !bjj#bii*C!DE A Cr   