o ‰ü?ct"ć@sLddlmZddlmZGdd„deƒZGdd„deƒZGdd„deƒZd S) é)ŚShapeDocumenter)Ś py_defaultc@s€eZdZ ddd„Zdd„Z ddd„Z ddd „Z dd d „Z dd d „Z ddd„Z dd„Z ddd„Z ddd„Z dd„Z dS)ŚBaseExampleDocumenterNcCsBg}|j ”|j ”|dur| |”|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śp/private/var/folders/cw/wlscbxl13mj6wd668h7l9g9sllkg5j/T/pip-target-b31awkwq/lib/python/botocore/docs/example.pyŚdocument_examples    ūz&BaseExampleDocumenter.document_examplecKs| d”dS)Nz{'... recursive ...'})r )rrrŚkwargsrrrŚdocument_recursive_shape2sz.BaseExampleDocumenter.document_recursive_shapecKs>| |”}|durt|jƒ}|j d”|krd}| |”dS)NZstreaming_shapezStreamingBody())Z_get_special_py_defaultrŚ type_nameŚ_contextŚgetr )rrrrrr rZpy_typerrrŚdocument_shape_default5s  z,BaseExampleDocumenter.document_shape_defaultc Ksfd|jvr*t|jdƒD]\}}| d|”|t|jdƒdkr'| d”q dS| |||”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_listKs   ’’   z.BaseExampleDocumenter.document_shape_type_listcKsŽ|js | d”dS| d”}| |d”| |j|”}t|ƒD]E\}} |r+| |vr+q | | ”} |  d| ”|| } | jdd| jid} |j| | || d|t|ƒd kre|  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 Śparamr0r/Śparam_value_sectionr1rrrŚdocument_shape_type_structure\s:      ’ü’  €z3BaseExampleDocumenter.document_shape_type_structurec Ksz| d”}| |d”|j}|jdd|jjid} |  d”|jdd|jid} |j| ||d| d ”} | | d ”dS) Nz map-valuer4Śkeyrr$z 'string': Śvaluer&r)r7)r+r,r@r?r-r r r.) rrrrrr rZ map_sectionZ value_shapeZ key_sectionZ value_sectionŚend_bracket_sectionrrrŚdocument_shape_type_maps   ’  ’’ z-BaseExampleDocumenter.document_shape_type_mapcCs$|r| ”}|D]}|||j<q|S©N)Ścopyr-)rr8rr<rrrr9’s  z+BaseExampleDocumenter._add_members_to_shapecCs4|dur | |”|j ”|j ”|j ”dSrC)r r Śindentr )rrŚstartrrrr,™s    z)BaseExampleDocumenter._start_nested_paramcCs8|j ”|j ”|j ”|dur| |”dSdSrC)r Śdedentr r )rrŚendrrrr. s   ’z'BaseExampleDocumenter._end_nested_paramcCsD|js| ”| ||”| |”dS| d”}| ||”dS)Nr))Zavailable_sectionsZ clear_textr r.r+)rrrFrHrArrrr:§s  z$BaseExampleDocumenter._end_structure)NNN©NNrC)Ś__name__Ś __module__Ś __qualname__rrrr!r2r>rBr9r,r.r:rrrrrs$ ’  ’ ’ ’ ’$ ’   rc@seZdZdZdd„ZdS)ŚResponseExampleDocumenterzresponse-examplecKs8| d”|j|||fi|¤Ž| d”}| d”dS)Nz EventStream(zevent-stream-endś))r r>r+)rrrrrŚ end_sectionrrrŚ document_shape_type_event_stream·s  z:ResponseExampleDocumenter.document_shape_type_event_streamN)rJrKrLŚ EVENT_NAMErPrrrrrM“s rMc@seZdZdZ ddd„ZdS)ŚRequestExampleDocumenterzrequest-exampleNcKsd}d}d} d} t|ƒdkrd}d} d} d }| d ”}| || ”| |j|”} t| ƒD]J\} } |r7| |vr7q,| | ”}| || ”| |”| | }|jd d |jid }|j|||| d| t| ƒdkrv| d”}| d”|j   ”q,|  || | ”dS)Nrz: r4r7rś=ś(rNz%sr3r5rr$r6r'r() rr+r,r9r8rr r-r r r r:)rrrrrr rZ param_formatŚoperatorrFrHr;r r<r0r/r=r1rrrr>ĆsH       ’ü’  €z6RequestExampleDocumenter.document_shape_type_structurerI)rJrKrLrQr>rrrrrRĄs’rRN)Zbotocore.docs.shaperZbotocore.docs.utilsrrrMrRrrrrŚs $