o .&a The default unregister iterates through all of the available document events and looks for a corresponding handler method defined in the object. If it's there, that handler method will be unregistered for the all events of that type for the specified ``event_class``. N)r:rrr unregister)rrrrr;Ks z"CLIDocumentEventHandler.unregistercKs|j}|jdkrC|jd}|d|ddg}|ddD]}|d||d|}|d ||fq!|d dSdS) Nmanr)[ z:ref:`aws `aws .  z:ref:`%s ` ])doctargetrr0writerjoin)rrkwargsrC cmd_names full_cmd_listcmd full_cmd_namerrrdoc_breadcrumbsYs       z'CLIDocumentEventHandler.doc_breadcrumbscKsN|j}|j|jdd}|dkrd|}|d||j|jdS)Nr)rAr>zaws z .. _cli:%s:)rCstyle new_paragraphrr,writelnh1r )rrrGrC referencerrr doc_titlegs z!CLIDocumentEventHandler.doc_titlecKs,|j}|jd||j|jdSN Description)rCrMh2include_doc_string descriptionrNrrrGrCrrrdoc_descriptionp  z'CLIDocumentEventHandler.doc_descriptioncKs6g|_|j}|jd|j|d|jdS)NSynopsis%s)rrCrMrUstart_codeblockrOr rXrrrdoc_synopsis_startvs   z*CLIDocumentEventHandler.doc_synopsis_startcKs|j}|j|}|j|jvr,|j|jvrdSddd|j|jD}|j|jn|jdr8d|j}nd|j}|j sJt |ddsJd |}| d |dS) N | cSsg|]}|jqSrcli_name.0arrr sz?CLIDocumentEventHandler.doc_synopsis_option..z--z %s z<%s>_DOCUMENT_AS_REQUIREDFz[%s]r\) rCrrrrrFrra startswithrequiredr.rO)rarg_namerrGrCargument option_strrrrdoc_synopsis_option}s&        z+CLIDocumentEventHandler.doc_synopsis_optioncKs|j}|jg|_dSr )rCrM end_codeblockrrXrrrdoc_synopsis_ends  z(CLIDocumentEventHandler.doc_synopsis_endcKs*|j}|jd|js|ddSdS)NOptionsz*None* )rCrMrUrrErXrrrdoc_options_starts  z)CLIDocumentEventHandler.doc_options_startcKs|j}|j|}|j|jvr,|j|jvrdSddd|j|jD}|j|jnd|j}|d|| |j |j f|j ||jt|dr^||j |||j ||j |j dS)Nr_cSsg|]}d|jqS)``%s``r`rbrrrresz6CLIDocumentEventHandler.doc_option..rqz%s (%s) argument_model)rCrrrrrFrrarEr&rr cli_type_namerMindentrV documentationr-_document_enums_document_nested_structurededentrN)rrirrGrCrjr rrr doc_options,          z"CLIDocumentEventHandler.doc_optioncKs |jr|j}|jddSdS)NzSee Also) related_itemsrCrMrUrXrrrdoc_relateditems_startsz.CLIDocumentEventHandler.doc_relateditems_startcKs2|j}|d|jjd||d|ddS)N* zcli:%slabeltext )rCrErMsphinx_reference_label)rr related_itemrGrCrrrdoc_relateditems z'CLIDocumentEventHandler.doc_relateditemcCs`t|tr,|jr.|j|d|j|jD] }|jd|q|jdSdSdS)z#Documents top-level parameter enumszPossible values:rqN) isinstancerenumrMrNrEstart_ulliend_ul)rmodelrCrrrrrvs     z'CLIDocumentEventHandler._document_enumsc Cst|dd}|dkr!|jD]\}}|j||||jgdqdS|dkr3|j|d|j|jgddS|dkrc|j}|jdd }|j||||jgd|j }|jdd } |j|| ||jgddSdS) z5Recursively documents parameters in nested structures type_nameN structurestacklistmapr keyvalue) r.membersr _doc_memberr memberr serializationgetr) rrrCmember_type_name member_name member_shape key_shapekey_name value_shape value_namerrrrws"  z2CLIDocumentEventHandler._document_nested_structurecCsh|j|vr||jdkr|jdkr|ddS||jz|||||W|dS|w)Nrz( ... recursive ... ))r countrrEr_do_doc_memberpop)rrCrrrrrrrs    z#CLIDocumentEventHandler._doc_membercCs|j}|||j}|r|d||fn|d||j|j|||j|j}|dkrK|j D] \}} | ||| |q=n6|dkrt|j } | j dd} | || | ||j} | j dd} | || | |n |dkr| |d |j||j|jdS) Nz %s -> (%s)z(%s)rrr rrrr)rur&rrErMrtrNrVrrrrrrrrrx)rrCrrrdocsrrsub_name sub_shaperrrrrrrrs6     z&CLIDocumentEventHandler._do_doc_memberN)__name__ __module__ __qualname__rrr&r:rr;rLrRrYr^rlrnrpryr{rrvrwrrrrrrr s*      r c@sLeZdZddZddZddZddZd d Zd d Zd dZ ddZ dS)ProviderDocumentEventHandlercKdSr r)rr event_namerGrrrrLz,ProviderDocumentEventHandler.doc_breadcrumbscKs0|j}|jd|j|j||jdS)Nr[)rCrMrU codeblocksynopsisrV help_usagerXrrrr^s z/ProviderDocumentEventHandler.doc_synopsis_startcKrr rrrirrGrrrrlrz0ProviderDocumentEventHandler.doc_synopsis_optioncKs|j}|jdSr )rCrMrNrXrrrrnsz-ProviderDocumentEventHandler.doc_synopsis_endcKs|j}|jddS)Nro)rCrMrUrXrrrrpsz.ProviderDocumentEventHandler.doc_options_startcKsl|j}|j|}|d|j|jf||j|jr4|j |jD]}|j |q$|j dSdS)Nz ``%s`` (%s)) rCrrOrarsrVruchoicesrMrrr)rrirrGrCrjchoicerrrry"s     z'ProviderDocumentEventHandler.doc_optioncK |j}|jd|jdS)NzAvailable ServicesrCrMrUtoctreerXrrrdoc_subitems_start. z/ProviderDocumentEventHandler.doc_subitems_startcKs"|j}d|}|jj||ddS)N%s/index file_name)rCrMtocitem)r command_namerrGrCrrrr doc_subitem3sz(ProviderDocumentEventHandler.doc_subitemN) rrrrLr^rlrnrpryrrrrrrr s rc@s\eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)ServiceDocumentEventHandlercKrr rrrrGrrrr^<rz.ServiceDocumentEventHandler.doc_synopsis_startcKrr rrrrrrl?rz/ServiceDocumentEventHandler.doc_synopsis_optioncKrr rrrrrrnBrz,ServiceDocumentEventHandler.doc_synopsis_endcKrr rrrrrrpFrz-ServiceDocumentEventHandler.doc_options_startcKrr rrrrrryIrz&ServiceDocumentEventHandler.doc_optioncKrr rrrrrdoc_option_exampleLrz.ServiceDocumentEventHandler.doc_option_examplecKrr rrrrrdoc_options_endOrz+ServiceDocumentEventHandler.doc_options_endcKs(|j}|j}|jd||jdSrS)rCobjrMrUrVru)rrrGrC service_modelrrrrYRs z+ServiceDocumentEventHandler.doc_descriptioncKr)NzAvailable CommandsrrXrrrrYrz.ServiceDocumentEventHandler.doc_subitems_startcKsT|j}|j|}t|di}t|dkr"d|}|jj||ddS|j|dS)Nsubcommand_tablerrr)rC command_tabler.r/rMr)rrrrGrC subcommandrrrrrr^s   z'ServiceDocumentEventHandler.doc_subitemN) rrrr^rlrnrpryrrrYrrrrrrr9s rc@szeZdZdZddZddZddZdd Zdd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)OperationDocumentEventHandlerz'https://docs.aws.amazon.com/goto/WebAPIcKsF|j}|j}|jd||j||||||dSrS) rCrrMrUrVru_add_webapi_crosslink_add_top_level_args_reference$_add_note_for_document_types_if_used)rrrGrCoperation_modelrrrrYps    z-OperationDocumentEventHandler.doc_descriptioncCs:|jd|jd|jjjddd|jddS)NrzSee z 'aws help'z/reference/index)titlepagez' for descriptions of global parameters.)rCrOrErM internal_linkrrrrrys  z;OperationDocumentEventHandler._add_top_level_args_referencecCsn|j}|j}|j}|jd}|durdS|j|dd|j||j f}|jj d|d| ddS)Nuidz See also: z%s/%s/%szAWS API Documentation)rlinkr) rCrrmetadatarrMrNrE AWS_DOC_BASEr external_linkrO)rrrCrr service_uidrrrrrs   z3OperationDocumentEventHandler._add_webapi_crosslinkcCs0t|jr|jj|jd|jdSdS)NaC``%s`` uses document type values. Document types follow the JSON data model where valid values are: strings, numbers, booleans, null, arrays, and objects. For command input, options and nested parameters that are labeled with the type ``document`` must be provided as JSON. Shorthand syntax does not support document types.)r rrCrMrNrOr rrrrrs  zBOperationDocumentEventHandler._add_note_for_document_types_if_usedTcCsJt|tr|jr|r|j}ddd|DSdS|jdkr dSd|jS)N|cSsg|]}d|qS)z"%s"r)rccrrrreszJOperationDocumentEventHandler._json_example_value_name..z"string"booleanz true|falser\)rrrrFr)rrrinclude_enum_valuesrrrr_json_example_value_names    z6OperationDocumentEventHandler._json_example_value_namecCsf|j|vr||jdkr|jdkr|ddS||jz||||W|dS|w)Nrrz{ ... recursive ... })r rrrEr_do_json_exampler)rrCrrrrrr _json_examples    z+OperationDocumentEventHandler._json_examplecCsn|jdkrI|d|jjtvr|d||jn&|j|j|||j||j|d|j |j|ddS|jdkr|d|j||j }|d||j jtvru|||j n|j|||j ||j |j|d|j |d dS|jd kr|j r| |dS||||dSdS) Nr[z%s, ...z...]r{z%s: }r)rrErrrrMrtnew_linerrxrrr _doc_document_member_doc_input_structure_members)rrCrrr key_stringrrrrs>                    z.OperationDocumentEventHandler._do_json_examplecCs|ddS)Nz{...})rE)rrCrrrrz2OperationDocumentEventHandler._doc_document_memberc Cs|d|j|j|j}t|D]f\}}||}|j}|tvr2|d|||fn8|dkrE|d|| |||n%|dkrX|d|| |||n|dkrj|d|| ||||t |dkr||d|jq|j |j|d dS) Nrz"%s": %srz"%s": rrr,r) rErMrtrr enumeraterrrrr/rx) rrCrrrrir member_modelrrrrrs6        z:OperationDocumentEventHandler._doc_input_structure_memberscKst|\}}|j}|j|}|j|jvr|j|jvrdS|j} t} | |jrW| |||} | dur5dS| rW|j | d|j | D]} || qJ|j | dur| jdkr| jjtvr| j} |j | d|j |j| dd}| d||ft| tr| jr||| j|j |j dS|jtvr|j | d|j |j|| gd|j |j dSdS) NzShorthand SyntaxrSyntaxF)rz %s %s ...z JSON Syntaxr)r rCrrrrrrrsupports_shorthandgenerate_shorthand_examplerMrNrEr] splitlinesrOrmrrrrrrr_write_valid_enumsrsr)rrirrrG service_idoperation_namerC cli_argumentrrdocgenexample_shorthand_syntax example_liner example_typerrrrsX                    z0OperationDocumentEventHandler.doc_option_examplecCs:|j|d|D] }|d|q |ddS)NzWhere valid values are: z %s r)rMrNrE)rrC enum_valuesrrrrr4s  z0OperationDocumentEventHandler._write_valid_enumsc Ksd|j}|jd|j}|j}|dus|js|ddS|jD] \}}|j|||gdq"dS)NOutputNoner) rCrMrUr output_shaperrErr) rrrrGrCrrrrrrr doc_output;s z(OperationDocumentEventHandler.doc_outputcKs||dSr )rrrrrrFrz-OperationDocumentEventHandler.doc_options_endN)T)rrrrrYrrrrrrrrrrrrrrrrrls   #8 rc@sXeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ dS)TopicListerDocumentEventHandlerasThis is the AWS CLI Topic Guide. It gives access to a set of topics that provide a deeper understanding of the CLI. To access the list of topics from the command line, run ``aws help topics``. To access a specific topic from the command line, run ``aws help [topicname]``, where ``topicname`` is the name of the topic as it appears in the output from ``aws help topics``.cCs,||_||j|jt|_|jdSr )rrrrr _topic_tag_dbload_json_indexrrrrrSsz(TopicListerDocumentEventHandler.__init__cKs<|j}|jdkr|d|jjddd|ddSdS)Nr<r=cli:awsr>r}rBrCrDrErMrrXrrrrLYs   z/TopicListerDocumentEventHandler.doc_breadcrumbscKs8|j}|j|jjd|jjdd|jddS)Ncli:aws help %srrefnamerzAWS CLI Topic Guide)rCrMrNlink_target_definitionrr rPrXrrrrR`s  z)TopicListerDocumentEventHandler.doc_titlecKs,|j}|jd||j|jdSrS)rCrMrUrV DESCRIPTIONrNrXrrrrYhrZz/TopicListerDocumentEventHandler.doc_descriptioncKrr rrrrrr^nrz2TopicListerDocumentEventHandler.doc_synopsis_startcKrr rrrrrrnqrz0TopicListerDocumentEventHandler.doc_synopsis_endcKrr rrrrrrptrz1TopicListerDocumentEventHandler.doc_options_startcKrr rrrrrrwrz/TopicListerDocumentEventHandler.doc_options_endc Ks|j}|jd|jd}|j}t|}|D]3}|j||j t||D]}|j |d} | d|jj d||d| d| q/q|j |D]}|j|qWdS)NzAvailable TopicscategoryrWr|rr}z: %s )rCrMrUrqueryget_all_topic_namessortedkeysh3rNget_tag_single_valuerErhidden_toctreehidden_tocitem) rrrGrC categories topic_namescategory_names category_name topic_namerWrrrrzs.        z2TopicListerDocumentEventHandler.doc_subitems_startN) rrrrrrLrRrYr^rnrprrrrrrrJs rc@s<eZdZddZddZddZddZd d Zd d Zd S)TopicDocumentEventHandlercKsV|j}|jdkr)|d|jjddd|d|jjddd|d dSdS) Nr<r=rr>r}r@zcli:aws help topicstopicsrBrrXrrrrLs   z)TopicDocumentEventHandler.doc_breadcrumbscKsH|j}|j|jjd|jjdd|j|jd}|j|dS)Nrrrr) rCrMrNrrr rr rP)rrrGrCrrrrrRs  z#TopicDocumentEventHandler.doc_titlecKs@|j}tj|jj|jd}||}|||j dS)Nz.rst) rCospathrFr topic_dirr _remove_tags_from_contentrOrMrN)rrrGrCtopic_filenamecontentsrrrrYs   z)TopicDocumentEventHandler.doc_descriptioncCslt|d }|}Wdn1swYd}t|D] \}}||s,|}nqd||dS)Nrrr)open readlinesr _line_has_tagrF)rfilenameflinescontent_begin_indexrlinerrrrs   z3TopicDocumentEventHandler._remove_tags_from_contentcCs*|jjD]}|d|drdSqdS)N:TF)r valid_tagsrg)rr"tagrrrrs z'TopicDocumentEventHandler._line_has_tagcKrr rrrrrrrz,TopicDocumentEventHandler.doc_subitems_startN) rrrrLrRrYrrrrrrrrs   r)loggingrbotocorerbotocore.modelrbotocore.utilsrawsclirawscli.argprocessrawscli.bcdoc.doceventsrawscli.topictagsr awscli.utilsr r r getLoggerrLOGobjectr rrrrrrrrrs&         n-3_N