
    |                        S SK r S SKJr  S rS rS r\" S/ SQ5      r " S S\5      r " S	 S
5      r " S S5      r	 " S S5      r
SSSSSS.r\ R                  " SR                  \" \ R                  \5      5      5      rS rS rg)    N)
namedtuplec                 4    SSSSSSSS.R                  X 5      $ )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    &lib/third_party/botocore/docs/utils.pypy_type_namer      s/      
c)     c                 <    SSSSSSSSSSS	.
R                  U S
5      $ )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                 D   U R                   R                  S5      nU R                   R                  SS5      nUR                  S5      (       a  USS nUR                  S5      (       a  USS nU(       a+  UR                  5       UR                  5       ;  a	  US	U S
3-  nU$ )zoGenerate 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                   6   ^  \ rS rSrSr   SU 4S jjrSrU =r$ )r.   ]   zBUse this class to inject new shapes into a model for documentationc           	      L   > Uc  / nUc  / nUc  / n[         TU ]  U UUUUUU5      $ N)super__new__)clsr/   r   r0   r'   r1   r2   	__class__s          r   r8   DocumentedShape.__new__`   sL     H?G#!w
 	
r    )NNN)__name__
__module____qualname____firstlineno____doc__r8   __static_attributes____classcell__)r:   s   @r   r.   r.   ]   s    L 
 
r   c                   $    \ rS rSrSS jrS rSrg)AutoPopulatedParamz   Nc                 2    Xl         X l        Uc  SU l        g g )Nz{Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
r/   param_description)selfr/   rI   s      r   __init__AutoPopulatedParam.__init__{   s%    	!2$ " %r   c                    UR                  S5      (       a  U R                  UR                  ;   ai  UR                  U R                  5      nSUR                  ;   a  UR	                  S5        UR                  S5      nUR                  U R                  5        ggUR                  S5      (       aH  UR                  S5      nU R                  UR                  ;   a  UR	                  U R                  5        ggg)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writelnrI   rJ   
event_namesectionkwargsdescription_sections        r   document_auto_populated_param0AutoPopulatedParam.document_auto_populated_param   s       !67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   rH   r6   )r=   r>   r?   r@   rK   rY   rB   r<   r   r   rE   rE   z   s    2r   rE   c                   $    \ rS rSrSrS rS rSrg)HideParamFromOperations   a.  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                     X l         [        5       U l        [        5       U l        SnSnU HA  nU R                  R	                  XAU4-  5        U R                  R	                  XQU4-  5        MC     g)z
: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)rJ   service_nameparameter_nameoperation_namesparam_templateexample_templater/   s          r   rK    HideParamFromOperations.__init__   sl      .!e"uEH#D##ND5I$IJ  $$%5t8L%LM $r   c                     XR                   ;   a  UR                  S5      nOXR                  ;  a  g U R                  UR                  ;   a  UR                  U R                  5        g g )NrO   )rb   rQ   ra   r_   rP   rR   )rJ   rU   rV   rW   s       r   
hide_param"HideParamFromOperations.hide_param   s[    ---))*;<G2227#=#==""4#7#78 >r   )rb   r_   ra   N)r=   r>   r?   r@   rA   rK   rk   rB   r<   r   r   r\   r\      s    DN*9r   r\   c                   $    \ rS rSrSrS rS rSrg)AppendParamDocumentation   z-Appends documentation to a specific parameterc                     Xl         X l        g r6   )r_   _doc_string)rJ   re   
doc_strings      r   rK   !AppendParamDocumentation.__init__   s    -%r   c                     U R                   UR                  ;   aH  UR                  U R                   5      nUR                  S5      nUR                  U R                  5        g g )NrN   )r_   rP   rQ   rS   rq   rT   s        r   append_documentation-AppendParamDocumentation.append_documentation   sW    7#=#==))$*>*>?G")"5"56K"L''(8(89 >r   )rq   r_   N)r=   r>   r?   r@   rA   rK   ru   rB   r<   r   r   rn   rn      s    7&:r   rn   z\nz\rz\tz\bz\f)
	|c                 2    [         U R                  S5         $ )Nr   )	_CONTROLSgroup)matchs    r   <lambda>r      s    	%++a.(Ar   c                 6    [         R                  [        U 5      $ r6   )_ESCAPE_CONTROLS_REsub_CONTROLS_MATCH_HANDLER)values    r   escape_controlsr      s    ""#:EBBr   )recollectionsr   r   r   r-   _DocumentedShaper.   rE   r\   rn   r~   compilejoinr   escaper   r   r   r<   r   r   <module>r      s    
 " *4  
 
& 
:2 2B$9 $9N: : 



	 jj#bii*C!DE A Cr   