o dB@spddlZddlmZddlmZddlmZddlmZddl m Z m Z m Z m Z GdddeZ d d d ZdS) N) xform_name)DocumentStructure)get_service_module_name)NestedDocumenter)add_resource_type_overview!get_identifier_args_for_signatureget_identifier_description!get_identifier_values_for_examplec@seZdZddZdS)SubResourceDocumentercCst|ddddt|jjjjddd}g}||jd<|D]9}||jt |jd d }| |j| |j}t ||j ||jd tj|j|j|j}|||jqdS) Nz Sub-resourceszSub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child.Zsubresources_intro)sectionZ resource_type descriptionZ intro_linkcSs|jS)N)name) sub_resourcerq/private/var/folders/v1/_jykv66s6qd26_69j1njbrl80000gr/T/pip-target-p1gutpg6/lib/python/boto3/docs/subresource.py*sz>SubResourceDocumenter.document_sub_resources..)keyz sub-resourceshtml)target)r resource_namesub_resource_model service_model)rsortedZ _resourcemetaZresource_modelZ subresources member_mapappendr rZadd_title_sectionadd_new_sectiondocument_sub_resourceZ_resource_nameZ_service_modelospathjoinZ_root_docs_pathZ _service_nameZ_resource_sub_pathZ write_to_file)selfr Z sub_resourcesZsub_resources_listrZsub_resource_docZsub_resource_sectionZsub_resources_dir_pathrrrdocument_sub_resourcessH     z,SubResourceDocumenter.document_sub_resourcesN)__name__ __module__ __qualname__r"rrrrr s r TcCsg}|jjD]}|jdkr|t|jq|r$t|}|j|j || d}d|jj d} | | | d} t |} t|} |j|krJ|} dt|jj | |j | } | j| | | j| d}|D]&}t|j |} |d|d |j|d |d | |jqm| 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 identifierssourcerrrrstyleZstart_sphinx_py_methodr rtypeZinclude_doc_stringr Z service_nameformatZstart_codeblockwriteZ end_codeblockrnew_liner)r rrrZinclude_signatureZidentifiers_needed identifierZsignature_argsZmethod_intro_sectionr Zexample_sectionZexample_valuesZexample_resource_namer'Z param_sectionZreturn_sectionrrrrKsb                r)T)rZbotocorerZbotocore.docs.bcdoc.restdocrZbotocore.utilsrZboto3.docs.baserZboto3.docs.utilsrrrr r rrrrrs    4