B ݁[Y%@sLddlmZddlmZGdddeZGdddeZGdddeZd S) )ShapeDocumenter) py_type_namec@sneZdZdddZddZdddZddd Zdd d Zdd 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 U/Users/kashii/Desktop/Projects/Workshops/worker-safety/lambda/botocore/docs/params.pydocument_paramssz$BaseParamsDocumenter.document_paramscKs|j||f|dS)N)_add_member_documentation)r rrkwargsr r rdocument_recursive_shape&sz-BaseParamsDocumenter.document_recursive_shapecKs|j||f|dS)N)r)r rrrr r rr r rdocument_shape_default)sz+BaseParamsDocumenter.document_shape_defaultc Ksb|j||f||j}|j|jd|jjid}|||j|||dd|d}||dS)Nr)context)rrrrzend-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||f||jdd|jjid}|||||j|j|jjd|jjid}|j|||j||j|dd|d} | | | | dS)Nkeyr)r)rrrrzend-map) rrrrrvaluestyleindentr r) r rrrr r rZ key_sectionrZ end_sectionr r rdocument_shape_type_map:s      z,BaseParamsDocumenter.document_shape_type_mapc Ks||j|}|j|||dxR|D]J} |r6| |kr6q$|| } |j| d| jid} || |j| | || dq$W|d}||dS)N)rr)r)rrrrz end-structure)_add_members_to_shapemembersrrrrr r) r rrrr r rrr"paramrrr r rdocument_shape_type_structureOs    z2BaseParamsDocumenter.document_shape_type_structurecKsdS)Nr )r rrrr r rrasz.BaseParamsDocumenter._add_member_documentationcCs(|r$|}x|D]}|||j<qW|S)N)copyr)r r"r r#r r rr!ds  z*BaseParamsDocumenter._add_members_to_shapecCsD||}t|j}d}|dk r0|||n|j||dS)Nz(%s) -- )_get_special_py_type_namer type_namewriterZitalics)r type_sectionrZspecial_py_typepy_typeZ type_formatr r r"_document_non_top_level_param_typeks   z7BaseParamsDocumenter._document_non_top_level_param_typecCs|j|jdS)N)rrnew_line)r rr r rrws z(BaseParamsDocumenter._start_nested_paramcCs|j|jdS)N)rdedentr,)r rr r rr{s z&BaseParamsDocumenter._end_nested_param)NN)NN)NN)NN)NNN)__name__ __module__ __qualname__rrrrr r$rr!r+rrr r r rrs      rc@s&eZdZdZdZdddZddZdS) ResponseParamsDocumenterz5Generates the description for the response parameterszresponse-paramsNcKsv|d}|d|dk r,|jd||d}||||d}|jrh|j||j|jdS)Nz param-namez- z%s z param-typezparam-documentation) rr(rboldr+ documentationrinclude_doc_string new_paragraph)r rrrr name_sectionr)documentation_sectionr r rrs       z2ResponseParamsDocumenter._add_member_documentationcKs|j|||f|dS)N)r$)r rrrrr r r document_shape_type_event_streamsz9ResponseParamsDocumenter.document_shape_type_event_stream)N)r.r/r0__doc__ EVENT_NAMErr8r r r rr1s r1c@s8eZdZdZdZd ddZdddZd d Zd d ZdS)RequestParamsDocumenterz4Generates the description for the request parameterszrequest-paramsNc Kst|dkr&|j||f||j||j|}xft|D]Z\}} |rT| |krTq>|| } |j| d| jid} | j | |j k} |j | | || | dq>W|d}t|dkr|j |j dS)Nr)r)rrrr is_requiredz end-structure) lenrrrr!r" enumeraterrr,required_membersr r-) r rrrr r rr"ir#rrr=r r rr$s&        z5RequestParamsDocumenter.document_shape_type_structureFcKs||}|dkrt|j}|rj|d}|d||f|d} | j|d} | d|nB|d} | d|dk r| jd||d}||||r|d} | j | jd |j r|d } | j | |j | | ||d } | j dS) Nz param-typez :type %s: %szend-param-typez param-namez :param %s: z- z%s z is-requiredz [REQUIRED] zparam-documentationz end-param)r&rr'rr(rr,r2r+rr3r4 _add_special_trait_documentationr5)r rrrZis_top_level_paramr=rr*r)Zend_type_sectionr6Zis_required_sectionr7Zend_param_sectionr r rrs8                 z1RequestParamsDocumenter._add_member_documentationcCsd|jkr||dS)NZidempotencyToken)metadata!_append_idempotency_documentation)r rrr r rrBs z8RequestParamsDocumenter._add_special_trait_documentationcCsd}||dS)Nz,This field is autopopulated if not provided.)r()r r docstringr r rrDsz9RequestParamsDocumenter._append_idempotency_documentation)NN)NFF) r.r/r0r9r:r$rrBrDr r r rr;s  "r;N)Zbotocore.docs.shaperbotocore.docs.utilsrrr1r;r r r r s  o