B ܁[%@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<x0|D](}||j}||j| ||q0WdS)NZ CollectionszUCollections provide an interface to iterate over and manipulate groups of resources. Zguide_collections)section resource_type description intro_link collections) _resourcemetaresource_modelrr member_mapadd_new_sectionnameappend_document_collection)selfr rZcollections_list collectionZcollection_sectionrV/Users/kashii/Desktop/Projects/Workshops/worker-safety/lambda/boto3/docs/collection.pydocument_collectionss     z)CollectionDocumenter.document_collectionsc Cstt|j|j}t||i}x|jD]}|||j<q(Wx|t|D]p}||}||krt||j |jj j j j ||||jj j j j dqDt||j ||jj j j j ||jj j j j dqDWdS)N)r resource_name event_emitterbatch_action_modelcollection_model service_model)r r action_namerrr )rgetattrrrdocument_collection_object batch_actionssortedrdocument_batch_action_resource_namerclienteventsr document_collection_method)rr rmethodsr$ batch_actionmethodZmethod_sectionrrrr(s.     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)stylestart_sphinx_py_attrrinclude_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_modelr6N) r9request operationrparamsr4rr5 service_namerr documentation) r rrrr rr6r9 ignore_paramsexample_return_valueexample_resource_namer;rrrr&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)r:r;r<z^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_namerB)r:r; include_inputr<zCreates 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)allfilterlimit page_size)r r8r9rr=r6N)r9r>r? input_shapemembersrrAr4r5rrr@rr) r rr!rrr r6r9Zunderlying_operation_membersrEZcustom_action_info_dictZ action_inforrrr*s`             r*N)T)T)T)botocorerbotocore.docs.methodrbotocore.docs.utilsrboto3.docs.baserboto3.docs.utilsrboto3.docs.methodrrr r#r&r*rrrr s       0  3