U å€C^ì*ã@sÌddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZGdd„deƒZGdd„deƒZdS)é)Ú xform_name)Úget_official_service_name)ÚBaseDocumenter)ÚActionDocumenter)ÚWaiterResourceDocumenter)ÚCollectionDocumenter)ÚSubResourceDocumenter)Údocument_attribute)Údocument_identifier)Údocument_reference)Ú!get_identifier_args_for_signature)Ú!get_identifier_values_for_example)Úget_identifier_description)Úadd_resource_type_overviewcsŒeZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Z‡ZS)ÚResourceDocumentercstt|ƒ |¡||_dS©N)ÚsuperrÚ__init__Ú_botocore_session)ÚselfÚresourceZbotocore_session©Ú __class__©ú6/tmp/pip-install-6_kvzl1k/boto3/boto3/docs/resource.pyrszResourceDocumenter.__init__cCsr| |¡| |¡| d¡}| |¡| |¡| |¡| |¡| |¡| |¡|  |¡|  |¡dS)Nzmember-overview) Ú _add_titleÚ _add_introÚadd_new_sectionÚ_add_identifiersÚ_add_attributesÚ_add_referencesÚ _add_actionsÚ_add_sub_resourcesÚ_add_collectionsÚ _add_waitersÚ_add_overview_of_members)rÚsectionZoverview_sectionrrrÚdocument_resource#s          z$ResourceDocumenter.document_resourcecCs|j |j¡dSr)ÚstyleÚh2Ú_resource_name©rr&rrrr0szResourceDocumenter._add_titlecCsŠg}|jjr&|jjD]}| |j¡qt|ƒ}|jjd|j|fd| d¡}|  |¡| d¡}|  ||¡| d¡}|  ||¡dS)Nz%s(%s))Ú class_nameÚ descriptionÚexampleÚparams) Z_resource_modelÚ identifiersÚappendÚnamer r(Zstart_sphinx_py_classr,rÚ_add_descriptionÚ _add_exampleÚ_add_params_description)rr&Úidentifier_namesÚ identifierZ class_argsZdescription_sectionZexample_sectionZ param_sectionrrrr3s  ÿ     zResourceDocumenter._add_introcCs"t|jƒ}| d||jf¡dS)Nz A resource representing an %s %s)rÚ_service_modelÚwriter*©rr&Zofficial_service_namerrrr3Ksÿÿÿz#ResourceDocumenter._add_descriptioncCsˆ|j ¡|j ¡| d¡|j ¡|j ¡| d|j|jf¡|j ¡t|ƒ}| dt|jƒ|j|j|f¡|j ¡dS)Nú import boto3ú%s = boto3.resource('%s')z%s = %s.%s(%s)) r(Ústart_codeblockÚnew_liner9Ú _service_namer rr*Ú end_codeblock)rr&r6Zexample_valuesrrrr4Rs,     ÿÿ þÿzResourceDocumenter._add_examplecCsN|D]D}t|j|ƒ}| d|¡|j ¡| d||f¡|j ¡qdS)Nz:type %s: stringz :param %s: %s)rr*r9r(r>)rr&r6Zidentifier_namer-rrrr5dsÿ ÿz*ResourceDocumenter._add_params_descriptioncCsl|jD]`}|j ¡| d|¡|j ¡|j|D].}|dkrT|j d|¡q6|j d|¡q6qdS)Nz&These are the resource's available %s:)r0Ú attributesÚ referencesÚ collectionsz :py:attr:`%s`z:py:meth:`%s()`)Ú member_mapr(r>r9Úli)rr&Zresource_member_typeÚmemberrrrr%ns  ÿ z+ResourceDocumenter._add_overview_of_memberscCsn|jjjj}| d¡}g}|r8||jd<t|dddd|D],}| |j¡}| |j¡t ||j |dq  ÿ ÿ ø      úz"ResourceDocumenter._add_attributescCsj| d¡}|jjjj}g}|r8t|dddd||jd<|D](}| |j¡}| |j¡t ||dqr9r?r@)rr&r6rrrr4ús     ÿÿz&ServiceResourceDocumenter._add_exampleN)rXrYrZÚpropertyr,rr3r4rrrrr\ìs  r\N)ZbotocorerZbotocore.docs.utilsrZboto3.docs.baserZboto3.docs.actionrZboto3.docs.waiterrZboto3.docs.collectionrZboto3.docs.subresourcerZboto3.docs.attrr r r Zboto3.docs.utilsr r rrrr\rrrrÚ s              O