o ?c)@sddlmZddlmZddlmZddlmZddlm Z ddl m Z m Z GdddeZ dd d Z dd d Z dddZdS)) xform_name)get_instance_public_methods)DocumentedShape)BaseDocumenter)%document_model_driven_resource_method)add_resource_type_overviewget_resource_ignore_paramsc@seZdZddZddZdS)CollectionDocumentercCs\|jjjj}g}t|dddd||jd<|D]}||j}||j| ||qdS)NZ CollectionszUCollections provide an interface to iterate over and manipulate groups of resources. Zguide_collections)sectionZ resource_type descriptionZ intro_link collections) _resourcemetaZresource_modelr r member_mapadd_new_sectionnameappend_document_collection)selfr r Zcollections_list collectionZcollection_sectionrp/private/var/folders/cw/wlscbxl13mj6wd668h7l9g9sllkg5j/T/pip-target-b31awkwq/lib/python/boto3/docs/collection.pydocument_collectionss    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_namerrr)rgetattrr rdocument_collection_object batch_actionssortedrdocument_batch_actionZ_resource_namerclienteventsrdocument_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 rinclude_signaturerrrr Ks 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_modelrmethod_descriptionexample_prefix exclude_inputresource_action_modelr/N) r2request operationrparamsr-rr. service_nameformatrr documentation) r rrrrrr/r2Z ignore_paramsZexample_return_valueexample_resource_namer4rrrr#cs:   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)r3r4r5zD 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_namer<)r3r4Z include_inputr5zs 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 r1r2rr6r/Nr)r2r7r8Z input_shapemembersrr:r-r.r;rrr9rr) r rrrrrr/r2Zunderlying_operation_membersr=Zcustom_action_info_dictZ action_inforrrr&s        L r&N)T)ZbotocorerZbotocore.docs.methodrZbotocore.docs.utilsrZboto3.docs.baserZboto3.docs.methodrZboto3.docs.utilsrrr r r#r&rrrrs    3  E