B 劇c@sZddlmZddlmZddlmZddlmZmZm Z m Z GdddeZ d dd Z d S) ) xform_name)get_service_module_name)BaseDocumenter)add_resource_type_overview!get_identifier_args_for_signatureget_identifier_description!get_identifier_values_for_examplec@seZdZddZdS)SubResourceDocumentercCstt|ddddt|jjjjddd}g}||jd<x8|D]0}||j}| |jt ||j ||j d q'z>SubResourceDocumenter.document_sub_resources..)keyz sub-resources)r resource_namesub_resource_model service_model) rsortedZ _resourcemetaZresource_modelZ subresources member_mapadd_new_sectionr appenddocument_sub_resourceZ_resource_nameZ_service_model)selfr Z sub_resourcesZsub_resources_listr Zsub_resource_sectionrrrdocument_sub_resourcess$      z,SubResourceDocumenter.document_sub_resourcesN)__name__ __module__ __qualname__rrrrrr sr TcCsg}x*|jjD]}|jdkr|t|jqW|rLt|}|j|j || d}d|jj d} | | | d} t |} t|} |j|kr|} dt|jj | |j | } | j| | | j| d}xT|D]L}t|j |} |d|d |j|d |d | |jqW| d }|j|d t||jj |j|d|jj d|jdS)ajDocuments a resource action :param section: The section to write to :param resource_name: The name of the resource :param sub_resource_model: The model of the subresource :param service_model: The model of the service :param include_signature: Whether or not to include the signature. It is useful for generating docstrings. inputz method-introz Creates a z resource.examplez{} = {}.{}({})paramsz:type z: stringz:param z: returnz:rtype: :py:class:`{}.{}`z :returns: A z resourceN)resourceZ identifierssourcerrtargetrstyleZstart_sphinx_py_methodr rtypeZinclude_doc_stringr service_nameformatZstart_codeblockwriteZ end_codeblockrnew_liner)r rrrZinclude_signatureZidentifiers_needed identifierZsignature_argsZmethod_intro_sectionr Zexample_sectionZexample_valuesZexample_resource_namer"Z param_sectionZreturn_sectionrrrr6sT                  rN)T) ZbotocorerZbotocore.utilsrZboto3.docs.baserZboto3.docs.utilsrrrrr rrrrr s   "