B “äî\ã@s¾ddlZddlmZdd„Zdd„Zdd„Zed d d d d ddgƒZGdd „d eƒZGdd„deƒZ Gdd„deƒZ Gdd„deƒZ ddddddœZ e  d eeje ƒ¡¡Zdd„Zd d!„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ú7/tmp/pip-build-uw_ogi45/botocore/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.0Z123z'string'zb'bytes'z True|Falsez[...]z{...}zdatetime(2015, 1, 1)) r r rrr ÚbooleanÚlistr rrz...)r)rrrrÚ py_default&s rcCsl|j d¡}|j dd¡}| d¡r0|dd…}| d¡rF|dd…}|rh| ¡| ¡krh|d  |¡7}|S) zwGenerate the official name of an AWS Service :param service_model: The service model representing the service ZserviceFullNameZserviceAbbreviationÚZAmazonéNZAWSéz ({0}))ÚmetadatarÚ startswithÚlowerÚformat)Z service_modelZ official_nameZ short_namerrrÚget_official_service_name@s     rÚDocumentedShapeÚnamerÚ documentationrÚmembersÚrequired_memberscs"eZdZdZd‡fdd„ Z‡ZS)r zBUse this class to inject new shapes into a model for documentationNc s@|dkr g}|dkrg}|dkr$g}tt|ƒ |||||||¡S)N)Úsuperr Ú__new__)Úclsr!rr"rr#r$)Ú __class__rrr&Ws  zDocumentedShape.__new__)NNN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r&Ú __classcell__rr)r(rr Usc@seZdZddd„Zdd„ZdS)ÚAutoPopulatedParamNcCs||_||_|dkrd|_dS)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__eszAutoPopulatedParam.__init__cKs~| d¡rN|j|jkrz| |j¡}d|jkr6| d¡| d¡}| |j¡n,| d¡rz| d¡}|j|jkrz| |j¡dS)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-requiredzparam-documentationzdocs.request-examplezstructure-valueN)rr!Úavailable_sectionsÚ get_sectionÚdelete_sectionÚwritelnr/)r0Ú event_nameÚsectionÚkwargsÚdescription_sectionrrrÚdocument_auto_populated_paramns        z0AutoPopulatedParam.document_auto_populated_param)N)r)r*r+r1r:rrrrr.ds r.c@s 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).cCsX||_tƒ|_tƒ|_d}d}x4|D],}|j |||f¡|j |||f¡q$WdS)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)r0Z service_nameÚparameter_nameZoperation_namesZparam_templateZexample_templater!rrrr1Šs  z HideParamFromOperations.__init__cKs@||jkr| d¡}n||jkr$dS|j|jkr<| |j¡dS)Nzstructure-value)r?r3r>r<r2r4)r0r6r7r8rrrÚ hide_paramŸs     z"HideParamFromOperations.hide_paramN)r)r*r+r,r1rBrrrrr;ƒsr;c@s eZdZdZdd„Zdd„ZdS)ÚAppendParamDocumentationz-Appends documentation to a specific parametercCs||_||_dS)N)r<Ú _doc_string)r0rAZ doc_stringrrrr1«sz!AppendParamDocumentation.__init__cKs2|j|jkr.| |j¡}| d¡}| |j¡dS)Nzparam-documentation)r<r2r3r5rD)r0r6r7r8r9rrrÚappend_documentation¯s   z-AppendParamDocumentation.append_documentationN)r)r*r+r,r1rErrrrrC©srCz\nz\rz\tz\bz\f)Ú ú ú úú ú|cCst| d¡S)Nr)Ú _CONTROLSÚgroup)ÚmatchrrrÚÁórOcCs t t|¡S)N)Ú_ESCAPE_CONTROLS_REÚsubÚ_CONTROLS_MATCH_HANDLER)ÚvaluerrrÚescape_controlsÄsrU)ÚreÚ collectionsrrrrZ_DocumentedShaper Úobjectr.r;rCrLÚcompileÚjoinr ÚescaperQrSrUrrrrÚ s&   &