o d+@sddlZddlmZddlmZddlmZddlmZddl m Z ddl m Z ddl mZmZGd d d e Z dd d Z dddZ dddZdS)N) xform_name)DocumentStructure)get_instance_public_methods)DocumentedShape)NestedDocumenter)%document_model_driven_resource_method)add_resource_type_overviewget_resource_ignore_paramsc@seZdZddZddZdS)CollectionDocumentercCs|jjjj}g}t|dddd||jd<|D]5}||jt|jdd}| |j| |j}| ||t j |j|j|j}|||jqdS)NZ CollectionszUCollections provide an interface to iterate over and manipulate groups of resources. Zguide_collections)sectionZ resource_type descriptionZ intro_link collectionshtml)target) _resourcemetaZresource_modelr r member_mapappendnamerZadd_title_sectionadd_new_section_document_collectionospathjoinZ_root_docs_pathZ _service_nameZ_resource_sub_pathZ write_to_file)selfr r Zcollections_list collectionZcollection_docZcollection_sectionZcollections_dir_pathrp/private/var/folders/v1/_jykv66s6qd26_69j1njbrl80000gr/T/pip-target-p1gutpg6/lib/python/boto3/docs/collection.pydocument_collectionss0     z)CollectionDocumenter.document_collectionsc Cstt|j|j}t||i}|jD]}|||j<qt|D]8}||}||vrBt||j |jj j j j ||||jj j j j dqt||j ||jj j j j ||jj j j j dqdS)N)r resource_name event_emitterbatch_action_modelcollection_model service_model)r r action_namer r"r#)rgetattrrrdocument_collection_object batch_actionssortedrdocument_batch_actionZ_resource_namerclienteventsr#document_collection_method)rr rmethodsr'Z batch_actionmethodZmethod_sectionrrrr=s6           z)CollectionDocumenter._document_collectionN)__name__ __module__ __qualname__rrrrrrr s r TcCsB|r |j|j|d|jjd|d|jjddS)a Documents a collection resource object :param section: The section to write to :param collection_model: The model of the collection :param include_signature: Whether or not to include the signature. It is useful for generating docstrings. zA collection of z resources.zA z Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.N)styleZstart_sphinx_py_attrrZinclude_doc_stringresourcetype)r r"include_signaturerrrr&\s r&c Cs|||jj}t|jj}d} |jrt|jj} t|} |j|kr#|} d | | |j |j } t ||j |||j | |||d dS)aiDocuments a collection's batch action :param section: The section to write to :param resource_name: The name of the resource :param action_name: The name of collection action. Currently only can be all, filter, limit, or page_size :param event_emitter: The event emitter to use to emit events :param batch_action_model: The model of the batch action :param collection_model: The model of the collection :param service_model: The model of the service :param include_signature: Whether or not to include the signature. It is useful for generating docstrings. responsez {} = {}.{}.{}) r method_nameoperation_modelr method_descriptionexample_prefix exclude_inputresource_action_modelr5N) r8request operationr paramsr3rr4 service_nameformatrr documentation) r rr r!r#r"r5r8Z ignore_paramsZexample_return_valueexample_resource_namer:rrrr)ts:   r)c CsF||jj}g}|jr|jj}t|} |j|kr|} d|jjdd t|jj| |j |dd|jjd|jjdd t|jj| |j t |jj dd|jjdd t|jj| |j t d d d d g|dd|jjdd t|jj| |j t d d dd g|dd} || vr| |} td||||||d| dSdS)a#Documents a collection method :param section: The section to write to :param resource_name: The name of the resource :param action_name: The name of collection action. Currently only can be all, filter, limit, or page_size :param event_emitter: The event emitter to use to emit events :param collection_model: The model of the collection :param service_model: The model of the service :param include_signature: Whether or not to include the signature. It is useful for generating docstrings. zCreates an iterable of all z resources in the collection.z{}_iterator = {}.{}.all)r9r:r;zD resources in the collection filtered by kwargs passed to method. A z collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.z{}_iterator = {}.{}.filterz0Creates an iterable up to a specified amount of z{}_iterator = {}.{}.limitcountintegerz5The limit to the number of resources in the iterable.)r type_namerB)r9r:Z include_inputr;zs resources in the collection, but limits the number of items returned by each service call by the specified amount.z{}_iterator = {}.{}.page_sizez1The number of items returned by each service call)allfilterlimitZ page_size)r r7r8r r<r5Nr)r8r=r>Z input_shapemembersrr@r3r4rArr r?rr) r rr$r r"r#r5r8Zunderlying_operation_membersrCZcustom_action_info_dictZ action_inforrrr,s        L r,)T)rZbotocorerZbotocore.docs.bcdoc.restdocrZbotocore.docs.methodrZbotocore.docs.utilsrZboto3.docs.baserZboto3.docs.methodrZboto3.docs.utilsrr r r&r)r,rrrrs      A  E