B “äī\/"ć@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ś9/tmp/pip-build-uw_ogi45/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 Kshd|jkrVxXt|jdƒD]6\}}| d|”|t|jdƒdkr| d”qWn| |||”dS)NŚenumz'%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)rrrz ending-commaś,zending-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|”}x–t|ƒ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_shaperr'r rr r Ś_end_structure)rrrrrr rŚ input_membersrŚparamr*r)Śparam_value_sectionr+rrrŚ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-valuer-Śkeyr)r"z 'string': Śvalue)rrrzending-bracketr.)r%r&r7r6r'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$| ”}x|D]}|||j<qW|S)N)Ścopyr')rr/rr3rrrr0s  z+BaseExampleDocumenter._add_members_to_shapecCs4|dk r| |”|j ”|j ”|j ”dS)N)r r Śindentr )rrŚstartrrrr&†s    z)BaseExampleDocumenter._start_nested_paramcCs4|j ”|j ”|j ”|dk r0| |”dS)N)r Śdedentr r )rrŚendrrrr(s    z'BaseExampleDocumenter._end_nested_paramcCsB|js(| ”| ||”| |”n| d”}| ||”dS)Nzending-bracket)Zavailable_sectionsZ clear_textr r(r%)rrr<r>r8rrrr1”s   z$BaseExampleDocumenter._end_structure)NNN)NN)NN)NN)NN)NN)N)N)Ś__name__Ś __module__Ś __qualname__rrrrr,r5r9r0r&r(r1rrrrrs       rc@seZdZdZdd„ZdS)ŚResponseExampleDocumenterzresponse-examplecKs4| d”|j|||f|Ž| d”}| d”dS)Nz EventStream(zevent-stream-endś))r r5r%)rrrrrZ end_sectionrrrŚ document_shape_type_event_stream¤s  z:ResponseExampleDocumenter.document_shape_type_event_streamN)r?r@rAŚ EVENT_NAMErDrrrrrB”srBc@seZdZdZddd„ZdS)ŚRequestExampleDocumenterzrequest-exampleNcKsd}d}d} d} t|ƒdkr,d}d} d} d }| d ”}| || ”| |j|”} x t| ƒD]”\} } |rp| |krpqZ| | ”}| || ”| |”| | }|jd d |jid }|j|||| d| t| ƒdkrZ| d”}| d”|j   ”qZW|  || | ”dS)Nz'%s'z: r-r.rś=ś(rCz%szstructure-valuez member-valuer)r")rrrr'z ending-commar#) rr%r&r0r/rr r'r r r r1)rrrrrr rZ param_formatŚoperatorr<r>r2rr3r*r)r4r+rrrr5Æs<        z6RequestExampleDocumenter.document_shape_type_structure)NN)r?r@rArEr5rrrrrF¬srFN)Zbotocore.docs.shaperZbotocore.docs.utilsrrrBrFrrrrŚ s