
    /Jf"                     r    d dl mZ d dlmZ  G d de          Z G d de          Z G d de          Zd	S )
    )ShapeDocumenter)
py_defaultc                   l    e Zd Z	 ddZd Z	 ddZ	 ddZ	 ddZ	 ddZ	 ddZ	d	 Z
dd
ZddZd ZdS )BaseExampleDocumenterNc                 ,   g }|j                                          |j                                          ||                    |           |                     |||||           |                    d          }|j                                          dS )a]  Generates an example based on a shape

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

        :param shape: The shape of the operation.

        :param prefix: Anything to be included before the example

        :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includeexcludezfinal-blank-line)stylenew_linestart_codeblockwritetraverse_and_document_shapeadd_new_section)selfr   r	   prefixr   r   r
   final_blank_line_sections           X/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/botocore/docs/example.pydocument_examplez&BaseExampleDocumenter.document_example   s    &    %%'''MM&!!!(( 	) 	
 	
 	
 $+#:#:;M#N#N  &//11111    c                 0    |                     d           d S )Nz{'... recursive ...'})r   )r   r   r	   kwargss       r   document_recursive_shapez.BaseExampleDocumenter.document_recursive_shape4   s    /00000r   c                     |                      |          }|t          |j                  }| j                            d          |k    rd}|                    |           d S )Nstreaming_shapezStreamingBody())_get_special_py_defaultr   	type_name_contextgetr   )r   r   r	   r
   r   r   r   py_types           r   document_shape_defaultz,BaseExampleDocumenter.document_shape_default7   sd     ..u55? 11G=.//588'Ggr   c                 &   d|j         v rpt          |j         d                   D ]S\  }}|                    d|z             |t          |j         d                   dz
  k     r|                    d           Td S |                     |||           d S )Nenum'%s'   |)metadata	enumerater   lenr#   )	r   r   r	   r
   r   r   r   ir%   s	            r   document_shape_type_stringz0BaseExampleDocumenter.document_shape_type_stringB   s     U^##$U^F%;<< ' '4ho...s5>&122Q666MM#&&&' '
 ''@@@@@r   c                    |j         }|                    d          }|                     |d           |                    dd|j        i          }	|                     |	||           |                    d          }
|
                    d           |                    d	          }|                     |d
           d S )Nz
list-value[memberr	   contextr   r	   r
   ending-comma,ending-bracket])r0   r   _start_nested_paramnamer   r   _end_nested_param)r   r   r	   r
   r   r   r   param_shapelist_sectionparam_sectionending_comma_sectionending_bracket_sections               r   document_shape_type_listz.BaseExampleDocumenter.document_shape_type_listM   s     l..|<<  s333$44w(89 5 
 
 	((!g 	) 	
 	
 	
  ,;;NKK""3'''!-!=!=>N!O!O5s;;;;;r   c                    |j         s|                    d           d S |                    d          }|                     |d           |                     |j         |          }t          |          D ]\  }}	|r|	|v r|                    |	          }
|
                    d|	z             ||	         }|
                    dd|j        i          }|                     ||||	           |t          |          d	z
  k     rC|
                    d
          }|                    d           |j	        
                                 |                     |dd           d S )Nz{}structure-value{z'%s': member-valuer	   r1   r   r	   r
   r9   r'   r4   r5   })membersr   r   r8   _add_members_to_shaper*   r9   r   r+   r   r   _end_structure)r   r   r	   r
   r   r   r   input_membersr,   paramr=   r;   param_value_sectionr>   s                 r   document_shape_type_structurez3BaseExampleDocumenter.document_shape_type_structure^   s    } 	MM$F))*;<<  #...225='JJ!-00 	6 	6HAu 5G++#33E::M
U 2333'.K"/"?"?+2B(C #@ # # ,,+!	 -    3}%%)))'4'D'D"( ($ %**3///$*33555GS#.....r   c                    |                     d          }|                     |d           |j        }|                     dd|j        j        i          }	|	                    d           |                     dd|j        i          }
|                     |
||           |                     d	          }|                     |d
           d S )Nz	map-valuerC   keyr	   r1   z
'string': valuer3   r6   rF   )r   r8   rP   rO   r9   r   r   r:   )r   r   r	   r
   r   r   r   map_sectionvalue_shapekey_sectionvalue_sectionend_bracket_sections               r   document_shape_type_mapz-BaseExampleDocumenter.document_shape_type_map   s     --k::  c222k!11GUY^4 2 
 
 	.)))#33g{'78 4 
 
 	((!g 	) 	
 	
 	
 *99:JKK2C88888r   c                 P    |r#|                                 }|D ]}|||j        <   |S N)copyr9   )r   rG   r   rK   s       r   rH   z+BaseExampleDocumenter._add_members_to_shape   s:     	,llnnG  , ,&+
##r   c                     ||                     |           |j                                         |j                                         |j                                         d S rX   )r   r   indentr   )r   r   starts      r   r8   z)BaseExampleDocumenter._start_nested_param   s\    MM%        r   c                     |j                                          |j                                          |j                                          ||                    |           d S d S rX   )r   dedentr   r   )r   r   ends      r   r:   z'BaseExampleDocumenter._end_nested_param   sb       ?MM# ?r   c                     |j         sC|                                 |                    ||z              |                     |           d S |                    d          }|                     ||           d S )Nr6   )available_sections
clear_textr   r:   r   )r   r   r\   r_   rU   s        r   rI   z$BaseExampleDocumenter._end_structure   s     ) 	=   MM%#+&&&""7+++++")"9"9:J"K"K""#6<<<<<r   )NNNNNrX   )__name__
__module____qualname__r   r   r#   r-   r@   rM   rV   rH   r8   r:   rI    r   r   r   r      s       AE 2  2  2  2D1 1 1 >B	 	 	 	 >B	A 	A 	A 	A >B< < < <$ >B!/ !/ !/ !/H >B9 9 9 9&  ! ! ! !   
= 
= 
= 
= 
=r   r   c                       e Zd ZdZd ZdS )ResponseExampleDocumenterzresponse-examplec                     |                     d            | j        |||fi | |                    d          }|                     d           d S )NzEventStream(zevent-stream-end))r   rM   r   )r   r   r	   r
   r   end_sections         r    document_shape_type_event_streamz:ResponseExampleDocumenter.document_shape_type_event_stream   sc     	n%%%**7E7MMfMMM--.@AA#r   N)rd   re   rf   
EVENT_NAMErm   rg   r   r   ri   ri      s(        #J    r   ri   c                       e Zd ZdZ	 ddZdS )RequestExampleDocumenterzrequest-exampleNc                    d}d}d}	d}
t          |          dk    rd}d}	d}
d	}|                    d
          }|                     ||	           |                     |j        |          }t          |          D ]\  }}|r||v r|                    |          }|                    ||z             |                    |           ||         }|                    dd|j        i          }|                     ||||           |t          |          dz
  k     rC|                    d          }|                    d           |j	        
                                 |                     ||	|
           d S )Nr&   z: rC   rF   r'   =(rk   z%srB   rD   r	   r1   rE   r4   r5   )r+   r   r8   rH   rG   r*   r   r9   r   r   r   rI   )r   r   r	   r
   r   r   r   param_formatoperatorr\   r_   rJ   r,   rK   r=   r;   rL   r>   s                     r   rM   z6RequestExampleDocumenter.document_shape_type_structure   s     w<<1HECL))*;<<  %000225='JJ!-00 	6 	6HAu 5G++#33E::Mu 4555)))'.K"/"?"?+2B(C #@ # # ,,+!	 -    3}%%)))'4'D'D"( ($ %**3///$*33555GUC00000r   rc   )rd   re   rf   rn   rM   rg   r   r   rp   rp      s3        "J >B'1 '1 '1 '1 '1 '1r   rp   N)botocore.docs.shaper   botocore.docs.utilsr   r   ri   rp   rg   r   r   <module>rx      s    0 / / / / / * * * * * *b= b= b= b= b=O b= b= b=J	 	 	 	 	 5 	 	 	*1 *1 *1 *1 *14 *1 *1 *1 *1 *1r   