o .&ßaã@s¶ddlZddlmZdd„Zdd„Zdd„Zed gd ¢ƒZGd d „d eƒZGd d „d eƒZ Gdd„deƒZ Gdd„deƒZ ddddddœZ e  d eeje ƒ¡¡Zdd„Zdd„ZdS)éN)Ú namedtuplecCsddddddddœ ||¡S)z¯Get the Python type name for a given model type. >>> py_type_name('list') 'list' >>> py_type_name('structure') 'dict' :rtype: string ÚbytesÚstringÚfloatÚintegerÚdictÚdatetime)ÚblobÚ characterÚdoubleÚlongÚmapÚ structureÚ timestamp©Úget©Ú type_name©rú5/usr/lib/python3/dist-packages/botocore/docs/utils.pyÚ py_type_names ùørc Cs"ddddddddddd œ  |d ¡S) záGet the Python default value for a given model type. >>> py_default('string') ''string'' >>> py_default('list') '[...]' >>> py_default('unknown') '...' :rtype: string z123.0Ú123z'string'zb'bytes'z True|Falsez[...]z{...}zdatetime(2015, 1, 1)) r r rrr ÚbooleanÚlistr rrz...rrrrrÚ py_default&s ö õrcCsl|j d¡}|j dd¡}| d¡r|dd…}| d¡r#|dd…}|r4| ¡| ¡vr4|d  |¡7}|S) zwGenerate the official name of an AWS Service :param service_model: The service model representing the service ÚserviceFullNameÚserviceAbbreviationÚÚAmazonéNÚAWSéz ({0}))ÚmetadatarÚ startswithÚlowerÚformat)Ú service_modelÚ official_nameÚ short_namerrrÚget_official_service_name@s     r)ÚDocumentedShape)ÚnamerÚ documentationr"ÚmembersÚrequired_memberscs&eZdZdZ  d‡fdd„ Z‡ZS)r*zBUse this class to inject new shapes into a model for documentationNc s@|durg}|dur g}|durg}tt|ƒ |||||||¡S©N)Úsuperr*Ú__new__)Úclsr+rr,r"r-r.©Ú __class__rrr1Ws  þzDocumentedShape.__new__)NNN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r1Ú __classcell__rrr3rr*Us ÿc@seZdZddd„Zdd„ZdS)ÚAutoPopulatedParamNcCs"||_||_|durd|_dSdS)Nz{Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required )r+Úparam_description)Úselfr+r;rrrÚ__init__es ÿÿzAutoPopulatedParam.__init__cKsŒ| d¡r*|j|jvr(| |j¡}d|jvr| d¡| d¡}| |j¡dSdS| d¡rB| d¡}|j|jvrD| |j¡dSdSdS)zïDocuments auto populated parameters It will remove any required marks for the parameter, remove the parameter from the example, and add a snippet about the parameter being autopopulated in the description. zdocs.request-paramsz is-requiredúparam-documentationzdocs.request-exampleústructure-valueN)r#r+Úavailable_sectionsÚ get_sectionÚdelete_sectionÚwritelnr;©r<Ú event_nameÚsectionÚkwargsÚdescription_sectionrrrÚdocument_auto_populated_paramns     ÿú   ýz0AutoPopulatedParam.document_auto_populated_paramr/)r5r6r7r=rIrrrrr:ds  r:c@ó eZdZdZdd„Zdd„ZdS)ÚHideParamFromOperationsa>Hides a single parameter from multiple operations. This method will remove a parameter from documentation and from examples. This method is typically used for things that are automatically populated because a user would be unable to provide a value (e.g., a checksum of a serialized XML request body).cCsT||_tƒ|_tƒ|_d}d}|D]}|j |||f¡|j |||f¡qdS)a( :type service_name: str :param service_name: Name of the service to modify. :type parameter_name: str :param parameter_name: Name of the parameter to modify. :type operation_names: list :param operation_names: Operation names to modify. z*docs.request-params.%s.%s.complete-sectionz+docs.request-example.%s.%s.complete-sectionN)Ú_parameter_nameÚsetÚ_params_eventsÚ_example_eventsÚadd)r<Ú service_nameÚparameter_nameÚoperation_namesÚparam_templateÚexample_templater+rrrr=Šs þz HideParamFromOperations.__init__cKsD||jvr | d¡}n||jvrdS|j|jvr | |j¡dSdS)Nr?)rOrArNrLr@rB)r<rErFrGrrrÚ hide_paramŸs    ÿz"HideParamFromOperations.hide_paramN)r5r6r7r8r=rVrrrrrKƒs rKc@rJ)ÚAppendParamDocumentationz-Appends documentation to a specific parametercCs||_||_dSr/)rLÚ _doc_string)r<rRÚ doc_stringrrrr=«s z!AppendParamDocumentation.__init__cKs6|j|jvr| |j¡}| d¡}| |j¡dSdS)Nr>)rLr@rArCrXrDrrrÚappend_documentation¯s  ÿüz-AppendParamDocumentation.append_documentationN)r5r6r7r8r=rZrrrrrW©s rWz\nz\rz\tz\bz\f)Ú ú ú úú ú|cCst| d¡S)Nr)Ú _CONTROLSÚgroup)ÚmatchrrrÚÁsrdcCs t t|¡Sr/)Ú_ESCAPE_CONTROLS_REÚsubÚ_CONTROLS_MATCH_HANDLER)ÚvaluerrrÚescape_controlsÄs ri)ÚreÚ collectionsrrrr)Ú_DocumentedShaper*Úobjectr:rKrWraÚcompileÚjoinr ÚescaperergrirrrrÚs* ÿ&û