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#sz>SubResourceDocumenter.document_sub_resources..)keyz sub-resources)r resource_namesub_resource_model service_model) rsorted _resourcemetaresource_model subresources member_mapadd_new_sectionrappenddocument_sub_resource_resource_name_service_model)selfr sub_resourcesZsub_resources_listrZsub_resource_sectionrrrdocument_sub_resourcess$      z,SubResourceDocumenter.document_sub_resourcesN)__name__ __module__ __qualname__r$rrrrr 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)resource identifierssourcerrtargetrstylestart_sphinx_py_methodrrtypeinclude_doc_stringr service_namestart_codeblockwrite end_codeblockrnew_liner)r rrrinclude_signatureZidentifiers_needed identifierZsignature_argsmethod_intro_sectionr example_sectionexample_valuesexample_resource_namer) param_sectionreturn_sectionrrrr2sV                   rN)T) botocorerbotocore.utilsrboto3.docs.baserboto3.docs.utilsrrrrr rrrrr s