o ?c|@sddlZddlmZddZddZddZed gd ZGd d d eZGd d d ZGdddZ GdddZ ddddddZ e d eeje ZddZddZdS)N) namedtuplecCsdddddddd||S)zGet the Python type name for a given model type. >>> py_type_name('list') 'list' >>> py_type_name('structure') 'dict' :rtype: string bytesstringfloatintegerdictdatetime)blob characterdoublelongmap structure timestampget type_namern/private/var/folders/cw/wlscbxl13mj6wd668h7l9g9sllkg5j/T/pip-target-b31awkwq/lib/python/botocore/docs/utils.py py_type_names rc Cs"ddddddddddd |d S) zGet 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 booleanlistr rrz...rrrrr py_default&s  rcCsn|jd}|jdd}|dr|dd}|dr#|dd}|r5||vr5|d |d 7}|S) zwGenerate the official name of an AWS Service :param service_model: The service model representing the service ZserviceFullNameZserviceAbbreviationZAmazonNZAWSz ())metadatar startswithlower)Z service_modelZ official_nameZ short_namerrrget_official_service_name@s     r!DocumentedShape)namer documentationrmembersrequired_memberscs(eZdZdZ   dfdd ZZS)r"zBUse this class to inject new shapes into a model for documentationNc s<|durg}|dur g}|durg}t|||||||SN)super__new__)clsr#rr$rr%r& __class__rrr)`s zDocumentedShape.__new__)NNN)__name__ __module__ __qualname____doc__r) __classcell__rrr+rr"]s c@seZdZdddZddZdS)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#r3rrr__init__{s zAutoPopulatedParam.__init__cKs|dr*|j|jvr(||j}d|jvr|d|d}||jdSdS|drB|d}|j|jvrD||jdSdSdS)zDocuments 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-requiredparam-documentationzdocs.request-examplestructure-valueN)rr#available_sections get_sectiondelete_sectionwritelnr3r4 event_namesectionkwargsZdescription_sectionrrrdocument_auto_populated_params        z0AutoPopulatedParam.document_auto_populated_paramr')r-r.r/r5r@rrrrr2zs  r2c@ eZdZdZddZddZdS)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|||fqdS)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_nameset_params_events_example_eventsadd)r4Z service_nameparameter_nameZoperation_namesZparam_templateZexample_templater#rrrr5s z HideParamFromOperations.__init__cKsD||jvr |d}n||jvrdS|j|jvr ||jdSdS)Nr7)rFr9rErCr8r:)r4r=r>r?rrr hide_params    z"HideParamFromOperations.hide_paramN)r-r.r/r0r5rIrrrrrBs rBc@rA)AppendParamDocumentationz-Appends documentation to a specific parametercCs||_||_dSr')rC _doc_string)r4rHZ doc_stringrrrr5s z!AppendParamDocumentation.__init__cKs6|j|jvr||j}|d}||jdSdS)Nr6)rCr8r9r;rKr<rrrappend_documentations   z-AppendParamDocumentation.append_documentationN)r-r.r/r0r5rLrrrrrJs rJz\nz\rz\tz\bz\f)    |cCst|dS)Nr) _CONTROLSgroup)matchrrrsrVcCs tt|Sr')_ESCAPE_CONTROLS_REsub_CONTROLS_MATCH_HANDLER)valuerrrescape_controlss r[)re collectionsrrrr!Z_DocumentedShaper"r2rBrJrScompilejoinr escaperWrYr[rrrrs,  !'