
    -                     ^    S SK Jr  S SKJr   " S S\5      r " S S\5      r " S S\5      rg	)
    )ShapeDocumenter)py_type_namec                   v    \ rS rSrSS jrS r SS jr SS jr SS jr   SS jr	S	 r
S
 rS rS rS rSrg)BaseParamsDocumenter   Nc           	      0    / nU R                  UUUSUUS9  g)a  Fills out the documentation for a section given a model shape.

:param section: The section to write the documentation to.

:param shape: The shape of the operation.

:type include: Dictionary where keys are parameter names and
    values are the shapes of the parameter names.
:param include: The parameter shapes to include in the documentation.

:type exclude: List of the names of the parameters to exclude.
:param exclude: The names of the parameters to exclude from
    documentation.
N)sectionshapehistorynameincludeexclude)traverse_and_document_shape)selfr	   r
   r   r   r   s         'lib/third_party/botocore/docs/params.pydocument_params$BaseParamsDocumenter.document_params   s.     (( 	) 	
    c                 *    U R                   " X40 UD6  g N_add_member_documentationr   r	   r
   kwargss       r   document_recursive_shape-BaseParamsDocumenter.document_recursive_shape+   s    &&w@@r   c                 *    U R                   " X40 UD6  g r   r   )r   r	   r
   r   r   r   r   s          r   document_shape_default+BaseParamsDocumenter.document_shape_default.   s     	&&w@@r   c                 ,   U R                   " X40 UD6  UR                  nUR                  UR                  SUR                  R                  0S9nU R	                  U5        U R                  UUUS S9  UR                  S5      nU R                  U5        g )Nr
   contextr	   r
   r   r   zend-list)r   memberadd_new_sectionr   _start_nested_paramr   _end_nested_param)	r   r	   r
   r   r   r   r   param_shapeparam_sections	            r   document_shape_type_list-BaseParamsDocumenter.document_shape_type_list3   s     	&&w@@ll//w0A0A&B 0 
 	  /((!	 	) 	
 ))*5w'r   c                 6   U R                   " X40 UD6  UR                  SSUR                  R                  0S9nU R	                  U5        U R                  XrR                  5        UR                  UR
                  R                  SUR
                  R                  0S9nUR                  R                  5         U R	                  U5        U R                  UUR
                  US S9  UR                  S5      n	U R                  U	5        U R                  U	5        g )Nkeyr
   r!   r#   zend-map)
r   r%   r-   r   r&   valuestyleindentr   r'   )
r   r	   r
   r   r   r   r   key_sectionr)   end_sections
             r   document_shape_type_map,BaseParamsDocumenter.document_shape_type_mapE   s    	&&w@@--GUYY^^4 . 
 	  -&&{II>//KKw0@0@&A 0 
 	""$  /((!++	 	) 	
 --i8{+{+r   c                 T   U R                  UR                  U5      nU R                  XUS9  U HT  n	U(       a  X;   a  M  X   n
UR                  U	SU
R                  0S9nU R                  U5        U R                  UU
UU	S9  MV     UR                  S5      nU R                  U5        g )N)r   r
   r!   r#   end-structure)_add_members_to_shapemembersr   r%   r   r&   r   r'   )r   r	   r
   r   r   r   r   r   r8   paramr(   r)   s               r   document_shape_type_structure2BaseParamsDocumenter.document_shape_type_structure`   s     ,,U]]GD&&wD&AE5+!.K#33)9)9: 4 M $$]3,,%!	 -   ))/:w'r   c                     g r    r   s       r   r   .BaseParamsDocumenter._add_member_documentation}   s    r   c                 b    U(       a'  UR                  5       nU H  nX1UR                  '   M     U$ r   )copyr   )r   r8   r   r9   s       r   r7   *BaseParamsDocumenter._add_members_to_shape   s+    llnG &+

# !r   c                     U R                  U5      n[        UR                  5      nSnUb  UR                  XS-  5        OUR                  R                  XT-  5        UR                  S5        g )Nz(%s) -- )_get_special_py_type_namer   	type_namewriter/   italics)r   type_sectionr
   special_py_typepy_typetype_formats         r   "_document_non_top_level_param_type7BaseParamsDocumenter._document_non_top_level_param_type   sc    88?u/& {<=&&{'<=3r   c                 l    UR                   R                  5         UR                   R                  5         g r   )r/   r0   new_liner   r	   s     r   r&   (BaseParamsDocumenter._start_nested_param   "     r   c                 l    UR                   R                  5         UR                   R                  5         g r   )r/   dedentrO   rP   s     r   r'   &BaseParamsDocumenter._end_nested_param   rR   r   r=   NN)NNN)__name__
__module____qualname____firstlineno__r   r   r   r*   r3   r:   r   r7   rL   r&   r'   __static_attributes__r=   r   r   r   r      sY    
2A >BA >B(& >B,@ (: !!r   r   c                   ,    \ rS rSrSrSrSS jrS rSrg)	ResponseParamsDocumenter   z5Generates the description for the response parameterszresponse-paramsNc                 "   UR                  S5      nUR                  S5        Ub/  UR                  R                  SU-  5        UR                  S5        UR                  S5      nU R	                  Xb5        UR                  S5      nUR
                  (       a  UR                  R                  5         [        USS5      (       a  UR                  S	5      nS
n	SR                  UR                  R                  5        V
s/ s H  n
SU
-  PM
     sn
5      nSnUR                  X-  5        UR                  S5      nUR                  R                  U5        UR                  UR
                  5        UR                  R                  5         g s  sn
f )N
param-name- %srC   
param-typeparam-documentationis_tagged_unionFparam-tagged-union-docsaK  .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: %s.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows, ``%s``z3'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}zparam-unknown-example)r%   rF   r/   boldrL   documentationr0   getattrjoinr8   keys	codeblockinclude_doc_stringnew_paragraph)r   r	   r
   r   r   name_sectionrH   documentation_sectiontagged_union_docsnoter-   tagged_union_members_strunknown_code_exampleexamples                 r   r   2ResponseParamsDocumenter._add_member_documentation   sf   ..|<4 ##D4K0s#..|<//D ' 7 78M N!''..0u/77$+$;$;-%!%  ,099/4}}/A/A/CD/CX^/CD,(8 % "''(IJ!112IJ''(<=!44U5H5HI##% Es   ?Fc                 ,    U R                   " XU40 UD6  g r   )r:   )r   r	   r
   r   r   s        r    document_shape_type_event_stream9ResponseParamsDocumenter.document_shape_type_event_stream   s     	**77MfMr   r=   r   )	rW   rX   rY   rZ   __doc__
EVENT_NAMEr   rz   r[   r=   r   r   r]   r]      s    ?"J%&NNr   r]   c                   D    \ rS rSrSrSr S
S jr   SS jrS rS r	S	r
g)RequestParamsDocumenter   z4Generates the description for the request parameterszrequest-paramsNc           	      V   [        U5      S:  a-  U R                  " X40 UD6  UR                  R                  5         U R	                  UR
                  U5      n[        U5       Hn  u  pU(       a  X;   a  M  Xy   n
UR                  U	SU
R                  0S9nUR                  R                  5         XR                  ;   nU R                  UU
UU	US9  Mp     UR                  S5      n[        U5      S:  a  UR                  R                  5         UR                  R                  5         g )N   r
   r!   )r	   r
   r   r   is_requiredr6   )lenr   r/   r0   r7   r8   	enumerater%   r   rO   required_membersr   rT   )r   r	   r
   r   r   r   r   r8   ir9   r(   r)   r   s                r   r:   5RequestParamsDocumenter.document_shape_type_structure   s    w<!**7DVDMM  ",,U]]GD!'*HA5+!.K#33)9)9: 4 M ((*#9#99K,,%!' -  +  ))/:w<!MM  " r   c                    U R                  U5      nUc  [        UR                  5      nU(       ay  UR                  S5      nUR	                  SU SU 35        UR                  S5      n	U	R
                  R                  5         UR                  S5      n
U
R	                  SU-  5        OvUR                  S5      n
U
R	                  S5        Ub/  U
R
                  R                  SU-  5        U
R	                  S	5        UR                  S5      nU R                  X5        U(       aW  UR                  S
5      nUR
                  R                  5         UR
                  R                  S5        UR	                  S	5        UR                  (       a  UR                  S5      nUR
                  R                  5         [        USS5      (       ad  UR                  S5      nSnSR                  UR                  R                  5        Vs/ s H  nSU-  PM
     sn5      nUR	                  UU-  5        UR                  UR                  5        U R!                  X5        UR                  S5      nUR
                  R#                  5         g s  snf )Nrc   z:type z: zend-param-typer`   z:param %s: ra   rb   rC   zis-requiredz
[REQUIRED]rd   re   Frf   zl.. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: %s. rg   rh   z	end-param)rD   r   rE   r%   rF   r/   rO   ri   rL   r0   rj   rk   rl   r8   rm   ro    _add_special_trait_documentationrp   )r   r	   r
   r   is_top_level_paramr   r   rJ   rH   end_type_sectionrq   is_required_sectionrr   rs   rt   r-   ru   end_param_sections                     r   r   1RequestParamsDocumenter._add_member_documentation   sF    007?"5??3G"22<@LvRy9:+;;<LM""++-"22<@L}t34 #22<@Lt$""''t4""3'"22<@L33LH")"9"9-"H%%,,.%%**<8%%c*$+$;$;%%! "''..0u/77$+$;$;-%!D 
 ,099/4}}/A/A/CD/CX^/CD,( "''0H(IJ!44U5H5HI112GO#33K@--/ Es   Jc                 H    SUR                   ;   a  U R                  U5        g g )NidempotencyToken)metadata!_append_idempotency_documentation)r   r	   r
   s      r   r   8RequestParamsDocumenter._add_special_trait_documentation)  s!    /227; 0r   c                 *    SnUR                  U5        g )Nz,This field is autopopulated if not provided.)rF   )r   r	   	docstrings      r   r   9RequestParamsDocumenter._append_idempotency_documentation-  s    B	i r   r=   rV   )NFF)rW   rX   rY   rZ   r|   r}   r:   r   r   r   r[   r=   r   r   r   r      s1    >!J >B!@  70r<!r   r   N)botocore.docs.shaper   botocore.docs.utilsr   r   r]   r   r=   r   r   <module>r      s;    0 ,I!? I!X/N3 /Nd`!2 `!r   