U C^%@sddlmZddlmZddlmZddlmZddlm Z ddl m Z ddlm Z Gdd d eZ dd d Zdd dZdddZdS)) xform_name)get_instance_public_methods)DocumentedShape)BaseDocumenter)get_resource_ignore_params)%document_model_driven_resource_method)add_resource_type_overviewc@seZdZddZddZdS)CollectionDocumentercCs\|jjjj}g}t|dddd||jd<|D](}||j}||j| ||q.dS)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_sectionr8/tmp/pip-install-6_kvzl1k/boto3/boto3/docs/collection.pydocument_collectionss    z)CollectionDocumenter.document_collectionsc Cstt|j|j}t||i}|jD]}|||j<q&t|D]p}||}||krt||j |jj j j j ||||jj j j j dq>t||j ||jj j j j ||jj j j j dq>dS)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(s4           z)CollectionDocumenter._document_collectionN)__name__ __module__ __qualname__rrrrrrr sr TcCs(|r|j|j|d|jjdS)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 %s resourcesN)styleZstart_sphinx_py_attrrZinclude_doc_stringresourcetype)r rinclude_signaturerrrr Fs  r c Cs|||jj}t|jj}d} |jr0t|jj} t|} |j|krF|} d| | |j |j f} 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 %s = %s.%s.%s) r method_nameoperation_modelrmethod_descriptionexample_prefix exclude_inputresource_action_modelr/N) r2request operationrparamsr-rr. service_namerr documentation) r rrrrrr/r2Z ignore_paramsZexample_return_valueexample_resource_namer4rrrr#Ws:  r#c Cs*||jj}g}|jr |jj}t|} |j|kr6|} d|jjdt|jj| |j f|dd|jjdt|jj| |j ft |jj dd|jjdt|jj| |j ft dd d d g|d d |jjdt|jj| |j ft dd dd g|d d} || kr&| |} t f||||||d| dS)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. z:Creates an iterable of all %s resources in the collection.z%s_iterator = %s.%s.all)r3r4r5z^Creates an iterable of all %s resources in the collection filtered by kwargs passed to method.z%s_iterator = %s.%s.filterzOCreates an iterable up to a specified amount of %s resources in the collection.z%s_iterator = %s.%s.limitcountintegerz5The limit to the number of resources in the iterable.)r type_namer;)r3r4Z include_inputr5zCreates an iterable of all %s resources in the collection, but limits the number of items returned by each service call by the specified amount.z%s_iterator = %s.%s.page_sizez1The number of items returned by each service call)allfilterlimitZ page_size)r r1r2rr6r/N)r2r7r8Z input_shapemembersrr:r-r.rrr9rr) r rrrrrr/r2Zunderlying_operation_membersr<Zcustom_action_info_dictZ action_inforrrr&s       7 r&N)T)T)T)ZbotocorerZbotocore.docs.methodrZbotocore.docs.utilsrZboto3.docs.baserZboto3.docs.utilsrZboto3.docs.methodrrr r r#r&rrrr s       0  5