B -<` @srddlmZddlmZddlmZddlmZddlmZddlm Z ddlm Z Gdd d eZ dd d Z d S)) xform_name)get_service_module_name)BaseDocumenter)!get_identifier_args_for_signature)!get_identifier_values_for_example)get_identifier_description)add_resource_type_overviewc@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 TcCs|g}x*|jjD]}|jdkr|t|jqW|rLt|}|j|j || d}d|jj } | | | d} t |} t|} |j|kr|} dt|jj | |j | f} | j| | | j| d}xL|D]D}t|j |} |d||j|d|| f|jqW| d }|j|d t||jj f|j|d |jj |jd S) 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-introzCreates a %s resource.examplez%s = %s.%s(%s)paramsz:type %s: stringz :param %s: %sreturnz:rtype: :py:class:`%s.%s`z:returns: A %s resourceN)resourceZ identifierssourcerrtargetrstyleZstart_sphinx_py_methodr rtypeZinclude_doc_stringrZ service_nameZstart_codeblockwriteZ end_codeblockrnew_liner)r rrrZinclude_signatureZidentifiers_needed identifierZsignature_argsZmethod_intro_sectionr Zexample_sectionZexample_valuesZexample_resource_namer"Z param_sectionZreturn_sectionrrrr2sV                   rN)T) ZbotocorerZbotocore.utilsrZboto3.docs.baserZboto3.docs.utilsrrrrr rrrrr s