o .&a,@sLddlmZddlmZGdddeZGdddeZGdddeZd S) )ShapeDocumenter) py_type_namec@s~eZdZdddZddZ  dddZ  ddd Z  dd d Z  dd d ZddZ ddZ ddZ ddZ ddZ dS)BaseParamsDocumenterNcCsg}|j|||d||ddS)a3Fills out the documentation for a section given a model shape. :param section: The section to write the documentation to. :param shape: The shape of the operation. :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)sectionshapehistorynameincludeexclude)traverse_and_document_shape)selfrrr r rr 6/usr/lib/python3/dist-packages/botocore/docs/params.pydocument_paramss  z$BaseParamsDocumenter.document_paramscKs|j||fi|dSN_add_member_documentationr rrkwargsr r rdocument_recursive_shape&sz-BaseParamsDocumenter.document_recursive_shapecKs|j||fi|dSrr)r rrrr r rr r rdocument_shape_default)sz+BaseParamsDocumenter.document_shape_defaultc Ksf|j||fi||j}|j|jd|jjid}|||j|||dd|d}||dS)Nrcontextrrrrzend-list)rmemberadd_new_sectionr_start_nested_paramr _end_nested_param) r rrrr r r param_shape param_sectionr r rdocument_shape_type_list-s  z-BaseParamsDocumenter.document_shape_type_listc Ks|j||fi||jdd|jjid}|||||j|j|jjd|jjid}|j|||j||j|dd|d} | | | | dS)Nkeyrrrzend-map) rrr!rrvaluestyleindentr r) r rrrr r r key_sectionr end_sectionr r rdocument_shape_type_map:s$      z,BaseParamsDocumenter.document_shape_type_mapc Ks||j|}|j|||d|D]%} |r| |vrq|| } |j| d| jid} || |j| | || dq|d}||dS)N)rrrr end-structure)_add_members_to_shapemembersrrrrr r) r rrrr r rrr*paramrrr r rdocument_shape_type_structureOs     z2BaseParamsDocumenter.document_shape_type_structurecKsdSrr rr r rrasz.BaseParamsDocumenter._add_member_documentationcCs$|r|}|D]}|||j<q|Sr)copyr)r r*r r+r r rr)ds  z*BaseParamsDocumenter._add_members_to_shapecCsF||}t|j}d}|dur|||dS|j||dS)Nz(%s) -- )_get_special_py_type_namer type_namewriter#italics)r type_sectionrspecial_py_typepy_type type_formatr r r"_document_non_top_level_param_typeks  z7BaseParamsDocumenter._document_non_top_level_param_typecC|j|jdSr)r#r$new_liner rr r rrw z(BaseParamsDocumenter._start_nested_paramcCr7r)r#dedentr8r9r r rr{r:z&BaseParamsDocumenter._end_nested_paramNN)NNN)__name__ __module__ __qualname__rrrr r'r,rr)r6rrr r r rrs(       rc@s&eZdZdZdZdddZddZdS) ResponseParamsDocumenterz5Generates the description for the response parameterszresponse-paramsNc Ks|d}|d|dur|jd||d}||||d}|jrb|jt|ddr\|d}d } d d d |j D} d } || | |d} | j | | |j|j dS)N param-name- %s param-typeparam-documentationis_tagged_unionFparam-tagged-union-docsaK.. note:: This is a Tagged Union structure. Only one of the following top level keys will be set: %s. If a client receives an unknown member it will set ``SDK_UNKNOWN_MEMBER`` as the top level key, which maps to the name or tag of the unknown member. The structure of ``SDK_UNKNOWN_MEMBER`` is as follows, cSg|]}d|qSz``%s``r .0r!r r r zFResponseParamsDocumenter._add_member_documentation..z3'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}zparam-unknown-example)rr0r#boldr6 documentationr$getattrjoinr*keys codeblockinclude_doc_string new_paragraph) r rrrr name_sectionr2documentation_sectiontagged_union_docsnotetagged_union_members_strunknown_code_exampleexampler r rrs0           z2ResponseParamsDocumenter._add_member_documentationcKs|j|||fi|dSr)r,)r rrrrr r r document_shape_type_event_streamsz9ResponseParamsDocumenter.document_shape_type_event_streamr)r=r>r?__doc__ EVENT_NAMErr^r r r rr@s   $r@c@s>eZdZdZdZ d ddZ  dddZd d Zd d ZdS)RequestParamsDocumenterz4Generates the description for the request parameterszrequest-paramsNc Kst|dkr|j||fi||j||j|}t|D]-\}} |r+| |vr+q || } |j| d| jid} | j | |j v} |j | | || | dq |d}t|dkr^|j |j dS)Nrr)rrrr is_requiredr() lenrr#r$r)r* enumeraterrr8required_membersr r;) r rrrr r rr*ir+rrrcr r rr,s*         z5RequestParamsDocumenter.document_shape_type_structureFcKs\||}|durt|j}|r5|d}|d||f|d} | j|d} | d|n!|d} | d|durK| jd||d}||||rh|d} | j | jd |j r|d } | j t |d d r|d } d}d dd|j D}| ||| |j || ||d}|jdS)NrDz :type %s: %szend-param-typerAz :param %s: rBrCz is-requiredz [REQUIRED] rErFFrGzl.. note:: This is a Tagged Union structure. Only one of the following top level keys can be set: %s. rHcSrIrJr rKr r rrMrNzERequestParamsDocumenter._add_member_documentation..z end-param)r.rr/rr0r#r8rOr6r$rPrQrRr*rSrU _add_special_trait_documentationrV)r rrris_top_level_paramrcrr4r2end_type_sectionrWis_required_sectionrXrYrZr[end_param_sectionr r rrsN                  z1RequestParamsDocumenter._add_member_documentationcCsd|jvr ||dSdS)NidempotencyToken)metadata!_append_idempotency_documentation)r rrr r rrhs z8RequestParamsDocumenter._add_special_trait_documentationcCsd}||dS)Nz,This field is autopopulated if not provided.)r0)r r docstringr r rrosz9RequestParamsDocumenter._append_idempotency_documentationr<)NFF) r=r>r?r_r`r,rrhror r r rras  0 raN)botocore.docs.shaperbotocore.docs.utilsrrr@rar r r rs o.