B ?@Sa ã@srddlmZddlmZddlmZddlmZddlmZddlm Z ddlm Z Gdd „d eƒZ 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@seZdZdd„ZdS)ÚSubResourceDocumentercCstt|ddddt|jjjjdd„d}g}||jd<x8|D]0}| |j¡}|  |j¡t ||j ||j d q#óz>SubResourceDocumenter.document_sub_resources..)Úkeyz sub-resources)r Ú resource_nameÚsub_resource_modelÚ service_model) rÚsortedZ _resourceÚmetaZresource_modelZ subresourcesÚ member_mapÚadd_new_sectionr ÚappendÚdocument_sub_resourceZ_resource_nameZ_service_model)Úselfr Z sub_resourcesZsub_resources_listr Zsub_resource_sectionrrrÚdocument_sub_resourcess$      z,SubResourceDocumenter.document_sub_resourcesN)Ú__name__Ú __module__Ú __qualname__rrrrrr sr TcCs|g}x*|jjD]}|jdkr| t|jƒ¡qW|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¡|j ¡qÜW|  d ¡}|j ¡| d t|ƒ|jj f¡|j ¡| d |jj ¡|j ¡d 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: %sÚreturnz:rtype: :py:class:`%s.%s`z:returns: A %s resourceN)ÚresourceZ identifiersÚsourcerrÚtargetrÚstyleZstart_sphinx_py_methodr rÚtypeZinclude_doc_stringrZ service_nameZstart_codeblockÚwriteZ end_codeblockrÚnew_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