U n‰^ã@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úm/private/var/folders/sd/whlwsn6x1_qgglc0mjv25_695qk2gl/T/pip-install-4zq3fp6i/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...rrrrrÚ 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__rrr+rr"Us ÿc@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#r3rrrÚ__init__es ÿzAutoPopulatedParam.__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-requiredúparam-documentationzdocs.request-exampleústructure-valueN)rr#Úavailable_sectionsÚ get_sectionÚdelete_sectionÚwritelnr3©r4Ú event_nameÚsectionÚkwargsZdescription_sectionrrrÚdocument_auto_populated_paramns     ÿ   z0AutoPopulatedParam.document_auto_populated_param)N)r-r.r/r5r@rrrrr2ds r2c@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).cCsT||_tƒ|_tƒ|_d}d}|D],}|j |||f¡|j |||f¡q"dS)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)r4Z service_nameÚparameter_nameZoperation_namesZparam_templateZexample_templater#rrrr5Šs z HideParamFromOperations.__init__cKs@||jkr| d¡}n||jkr$dS|j|jkr<| |j¡dS)Nr7)rEr9rDrBr8r:)r4r=r>r?rrrÚ hide_paramŸs     z"HideParamFromOperations.hide_paramN)r-r.r/r0r5rHrrrrrAƒsrAc@s eZdZdZdd„Zdd„ZdS)ÚAppendParamDocumentationz-Appends documentation to a specific parametercCs||_||_dSr')rBÚ _doc_string)r4rGZ doc_stringrrrr5«sz!AppendParamDocumentation.__init__cKs2|j|jkr.| |j¡}| d¡}| |j¡dS)Nr6)rBr8r9r;rJr<rrrÚappend_documentation¯s   ÿz-AppendParamDocumentation.append_documentationN)r-r.r/r0r5rKrrrrrI©srIz\nz\rz\tz\bz\f)Ú ú ú úú ú|cCst| d¡S)Nr)Ú _CONTROLSÚgroup)ÚmatchrrrÚÁórUcCs t t|¡Sr')Ú_ESCAPE_CONTROLS_REÚsubÚ_CONTROLS_MATCH_HANDLER)ÚvaluerrrÚescape_controlsÄsr[)ÚreÚ collectionsrrrr!Z_DocumentedShaper"Úobjectr2rArIrRÚcompileÚjoinr ÚescaperWrYr[rrrrÚ s0 ÿÿ&û