U n‰^/"ć@sLddlmZddlmZGdd„deƒZGdd„deƒZGdd„deƒZd S) é)ŚShapeDocumenter)Ś py_defaultc@steZdZddd„Zdd„Zddd„Zddd „Zdd d „Zdd d „Zddd„Z dd„Z ddd„Z ddd„Z dd„Z dS) ŚBaseExampleDocumenterNcCsBg}|j ”|j ”|dk r*| |”|j|||||ddS)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Śexclude)ŚstyleŚnew_lineZstart_codeblockŚwriteŚtraverse_and_document_shape)ŚselfrrŚprefixrr r©rśo/private/var/folders/sd/whlwsn6x1_qgglc0mjv25_695qk2gl/T/pip-install-4zq3fp6i/botocore/botocore/docs/example.pyŚdocument_examples   žz&BaseExampleDocumenter.document_examplecKs| d”dS)Nz{'... recursive ...'})r )rrrŚkwargsrrrŚdocument_recursive_shape-sz.BaseExampleDocumenter.document_recursive_shapecKs>| |”}|dkrt|jƒ}|j d”|kr0d}| |”dS)NZstreaming_shapezStreamingBody())Z_get_special_py_defaultrZ type_nameŚ_contextŚgetr )rrrrrr rZpy_typerrrŚdocument_shape_default0s   z,BaseExampleDocumenter.document_shape_defaultc Ksdd|jkrRt|jdƒD]6\}}| d|”|t|jdƒdkr| d”qn| |||”dS)NŚenumś'%s'éś|)ŚmetadataŚ enumerater Ślenr) rrrrrr rŚirrrrŚdocument_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©rrrś ending-commaś,śending-bracketś])r"Śadd_new_sectionŚ_start_nested_paramŚnamer r Ś_end_nested_param) rrrrrr rŚ param_shapeZ list_sectionŚ param_sectionŚending_comma_sectionZending_bracket_sectionrrrŚdocument_shape_type_listDs$  ’’  ’z.BaseExampleDocumenter.document_shape_type_listcKsŽ|js| d”dS| d”}| |d”| |j|”}t|ƒD]Š\}} |rV| |krVq@| | ”} |  d| ”|| } | jdd| jid} |j| | || d|t|ƒd kr@|  d ”} |  d ”| j   ”q@|  |dd ”dS) Nz{}śstructure-valueŚ{z'%s': ś member-valuerr#©rrrr,rr&r'Ś}) Śmembersr r*r+Ś_add_members_to_shaperr,r rr r Ś_end_structure)rrrrrr rŚ input_membersrŚparamr/r.Śparam_value_sectionr0rrrŚdocument_shape_type_structureSs:     ’ž’  z3BaseExampleDocumenter.document_shape_type_structurec Ksz| d”}| |d”|j}|jdd|jjid} |  d”|jdd|jid} |j| ||d| d ”} | | d ”dS) Nz map-valuer3Śkeyrr#z 'string': Śvaluer%r(r6)r*r+r?r>r,r r r-) rrrrrr rZ map_sectionZ value_shapeZ key_sectionZ value_sectionŚend_bracket_sectionrrrŚdocument_shape_type_mapps&   ’ ’’ z-BaseExampleDocumenter.document_shape_type_mapcCs$|r | ”}|D]}|||j<q|S©N)Ścopyr,)rr7rr;rrrr8s  z+BaseExampleDocumenter._add_members_to_shapecCs4|dk r| |”|j ”|j ”|j ”dSrB)r r Śindentr )rrŚstartrrrr+†s    z)BaseExampleDocumenter._start_nested_paramcCs4|j ”|j ”|j ”|dk r0| |”dSrB)r Śdedentr r )rrŚendrrrr-s    z'BaseExampleDocumenter._end_nested_paramcCsB|js(| ”| ||”| |”n| d”}| ||”dS)Nr()Zavailable_sectionsZ clear_textr r-r*)rrrErGr@rrrr9”s   z$BaseExampleDocumenter._end_structure)NNN)NN)NN)NN)NN)NN)N)N)Ś__name__Ś __module__Ś __qualname__rrrr r1r=rAr8r+r-r9rrrrrs.’ ’ ’ ’ ’ ’   rc@seZdZdZdd„ZdS)ŚResponseExampleDocumenterzresponse-examplecKs4| d”|j|||f|Ž| d”}| d”dS)Nz EventStream(zevent-stream-endś))r r=r*)rrrrrZ end_sectionrrrŚ document_shape_type_event_stream¤s  z:ResponseExampleDocumenter.document_shape_type_event_streamN)rHrIrJŚ EVENT_NAMErMrrrrrK”srKc@seZdZdZddd„ZdS)ŚRequestExampleDocumenterzrequest-exampleNcKsd}d}d} d} t|ƒdkr,d}d} d} d }| d ”}| || ”| |j|”} t| ƒD]”\} } |rn| |krnqX| | ”}| || ”| |”| | }|jd d |jid }|j|||| d| t| ƒdkrX| d”}| d”|j   ”qX|  || | ”dS)Nrz: r3r6rś=ś(rLz%sr2r4rr#r5r&r') rr*r+r8r7rr r,r r r r9)rrrrrr rZ param_formatŚoperatorrErGr:rr;r/r.r<r0rrrr=ÆsH      ’ž’  z6RequestExampleDocumenter.document_shape_type_structure)NN)rHrIrJrNr=rrrrrO¬s’rON)Zbotocore.docs.shaperZbotocore.docs.utilsrrrKrOrrrrŚ s