B ݁[/"@sLddlmZddlmZGdddeZGdddeZGdddeZd S) )ShapeDocumenter) py_defaultc@steZdZdddZddZdddZddd Zdd d Zdd d ZdddZ ddZ dddZ dddZ ddZ dS) BaseExampleDocumenterNcCsBg}|j|j|dk r*|||j|||||ddS)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)sectionshapehistoryincludeexclude)stylenew_linestart_codeblockwritetraverse_and_document_shape)selfrrprefixrr rrV/Users/kashii/Desktop/Projects/Workshops/worker-safety/lambda/botocore/docs/example.pydocument_examples   z&BaseExampleDocumenter.document_examplecKs|ddS)Nz{'... recursive ...'})r )rrrkwargsrrrdocument_recursive_shape-sz.BaseExampleDocumenter.document_recursive_shapecKs>||}|dkrt|j}|jd|kr0d}||dS)NZstreaming_shapezStreamingBody())_get_special_py_defaultr type_name_contextgetr )rrrrrr rpy_typerrrdocument_shape_default0s   z,BaseExampleDocumenter.document_shape_defaultc Kshd|jkrVxXt|jdD]6\}}|d||t|jddkr|dqWn||||dS)Nenumz'%s'|)metadata enumerater lenr) rrrrrr rirrrrdocument_shape_type_string:s  z0BaseExampleDocumenter.document_shape_type_stringc Ksn|j}|d}||d|jdd|jid} |j| ||d|d} | d|d } || d dS) Nz list-value[memberr)context)rrrz ending-comma,zending-bracket])r%add_new_section_start_nested_paramnamerr _end_nested_param) rrrrrr r param_shapeZ list_section param_sectionending_comma_sectionZending_bracket_sectionrrrdocument_shape_type_listDs     z.BaseExampleDocumenter.document_shape_type_listcKs|js|ddS|d}||d||j|}xt|D]\}} |rX| |krXqB|| } | d| || } | jdd| jid} |j| | || d|t|d krB| d } | d | j qBW| |dd dS) Nz{}zstructure-value{z'%s': z member-valuer)r&)rrrr+rz ending-commar'}) membersr r)r*_add_members_to_shaper r+rr!r r _end_structure)rrrrrr r input_membersr"paramr.r-param_value_sectionr/rrrdocument_shape_type_structureSs.       z3BaseExampleDocumenter.document_shape_type_structurec Ksz|d}||d|j}|jdd|jjid} | d|jdd|jid} |j| ||d|d } || d dS) Nz map-valuer1keyr)r&z 'string': value)rrrzending-bracketr2)r)r*r;r:r+r rr,) rrrrrr rZ map_section value_shape key_sectionZ value_sectionend_bracket_sectionrrrdocument_shape_type_mapps     z-BaseExampleDocumenter.document_shape_type_mapcCs(|r$|}x|D]}|||j<qW|S)N)copyr+)rr3rr7rrrr4s  z+BaseExampleDocumenter._add_members_to_shapecCs4|dk r|||j|j|jdS)N)r r indentr )rrstartrrrr*s    z)BaseExampleDocumenter._start_nested_paramcCs4|j|j|j|dk r0||dS)N)r dedentr r )rrendrrrr,s    z'BaseExampleDocumenter._end_nested_paramcCsB|js(||||||n|d}|||dS)Nzending-bracket)available_sectionsZ clear_textr r,r))rrrBrDr>rrrr5s   z$BaseExampleDocumenter._end_structure)NNN)NN)NN)NN)NN)NN)N)N)__name__ __module__ __qualname__rrrr#r0r9r?r4r*r,r5rrrrrs       rc@seZdZdZddZdS)ResponseExampleDocumenterzresponse-examplecKs4|d|j|||f||d}|ddS)Nz EventStream(zevent-stream-end))r r9r))rrrrr end_sectionrrr document_shape_type_event_streams  z:ResponseExampleDocumenter.document_shape_type_event_streamN)rFrGrH EVENT_NAMErLrrrrrIsrIc@seZdZdZdddZdS)RequestExampleDocumenterzrequest-exampleNcKsd}d}d} d} t|dkr,d}d} d} d }|d }||| ||j|} xt| D]\} } |rp| |krpqZ|| }||| ||| | }|jd d |jid }|j|||| d| t| dkrZ|d}|d|j qZW| || | dS)Nz'%s'z: r1r2r=(rJz%szstructure-valuez member-valuer)r&)rrrr+z ending-commar') r!r)r*r4r3r r r+rr r r5)rrrrrr rZ param_formatoperatorrBrDr6r"r7r.r-r8r/rrrr9s<        z6RequestExampleDocumenter.document_shape_type_structure)NN)rFrGrHrMr9rrrrrNsrNN)botocore.docs.shaperbotocore.docs.utilsrrrIrNrrrr s