o
    é’Oj ,  ã                   @   s˜   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZmZ G d	d
„ d
e
ƒZ	ddd„Z	ddd„Z	ddd„ZdS )é    N)Ú
xform_name)ÚDocumentStructure)Úget_instance_public_methods)ÚDocumentedShape)ÚNestedDocumenter)Ú%document_model_driven_resource_method)Úadd_resource_type_overviewÚget_resource_ignore_paramsc                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚCollectionDocumenterc           	      C   sÚ   | j jjj}g }t|dddd� || jd< |D ]S}| |j¡ t|jdd�}| 	d¡}|j
 | jd	¡ | d
|j› �¡ | |j¡ |j	|jd| j› d�id�}|  ||¡ tj | j| j› | j› ¡}| ||j¡ qd S )NÚCollectionszUCollections provide an interface to iterate over and manipulate groups of resources. Úguide_collections)ÚsectionÚresource_typeÚdescriptionÚ
intro_linkÚcollectionsÚhtml)ÚtargetÚ
breadcrumbÚindexz / Collection / Ú	qualifierÚ.)Úcontext)Ú	_resourceÚmetaÚresource_modelr   r   Ú
member_mapÚappendÚnamer   Úadd_new_sectionÚstyleÚrefÚ_resource_class_nameÚwriteÚadd_title_sectionÚ
class_nameÚ_document_collectionÚosÚpathÚjoinÚ_root_docs_pathÚ_service_nameÚ_resource_sub_pathÚwrite_to_file)	Úselfr   r   Úcollections_listÚ
collectionÚcollection_docÚbreadcrumb_sectionÚcollection_sectionÚcollections_dir_path© r5   ú[/var/www/html/pharmsmart-cdr-gen/venv/lib/python3.10/site-packages/boto3/docs/collection.pyÚdocument_collections   s8   ù
	
þýëz)CollectionDocumenter.document_collectionsc              	   C   s´   t t| j|jƒƒ}t||ƒ i }|jD ]}|||j< qt|ƒD ]8}| |¡}||v rBt|| j	| jj
jj
j|| || jj
jj
jd� qt|| j	|| jj
jj
j|| jj
jj
jd� qd S )N)r   Úresource_nameÚevent_emitterÚbatch_action_modelÚcollection_modelÚservice_model)r   r8   Úaction_namer9   r;   r<   )r   Úgetattrr   r   Údocument_collection_objectÚbatch_actionsÚsortedr   Údocument_batch_actionÚ_resource_namer   ÚclientÚeventsr<   Údocument_collection_method)r.   r   r0   Úmethodsr@   Úbatch_actionÚmethodÚmethod_sectionr5   r5   r6   r&   A   s6   ÿ


ú	úôz)CollectionDocumenter._document_collectionN)Ú__name__Ú
__module__Ú__qualname__r7   r&   r5   r5   r5   r6   r
      s    $r
   Tc                 C   sX   |r| j  dd¡› |j› �}| j |¡ |  d|jj› d�¡ |  d|jj› d�¡ dS )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.
    r   Ú zA collection of z resources.zA z€ Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.N)r   Úgetr   r    Ústart_sphinx_py_attrÚinclude_doc_stringÚresourceÚtype)r   r;   Úinclude_signatureÚfull_collection_namer5   r5   r6   r?   `   s   ÿÿÿr?   c                 C   s†   |  |jj¡}t|jjƒ}d}	|jrt|jjƒ}	t|ƒ}
|j|kr#|}
|	› d|
› d|j	› d|j	› �}t
| |j	|||j||||d�	 dS )ai  Documents 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   )	r   Úmethod_nameÚoperation_modelr9   Úmethod_descriptionÚexample_prefixÚexclude_inputÚresource_action_modelrT   N)rX   ÚrequestÚ	operationr	   ÚparamsrR   r   rS   Úservice_namer   r   Údocumentation)r   r8   r9   r:   r<   r;   rT   rX   Úignore_paramsÚexample_return_valueÚexample_resource_namerZ   r5   r5   r6   rB   }   s0   ÿÿ

÷rB   c              
   C   sf  |  |jj¡}g }|jr|jj}t|ƒ}	|j|kr|}	d|jj› d�t|jjƒ› d|	› d|j	› d�|dœd|jj› d|jj› d�t|jjƒ› d|	› d|j	› d	�t
|jjƒdœd
|jj› d�t|jjƒ› d|	› d|j	› d�tdddd�g|dœd|jj› d�t|jjƒ› d|	› d|j	› d�tdddd�g|dœdœ}
||
v r±|
| }td| |||||dœ|¤Ž dS dS )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 z resources in the collection.z_iterator = r   z.all)rY   rZ   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.filterz0Creates an iterable up to a specified amount of z.limitÚcountÚintegerz5The limit to the number of resources in the iterable.)r   Ú	type_namera   )rY   rZ   Úinclude_inputr[   zs resources in the collection, but limits the number of items returned by each service call by the specified amount.z
.page_sizez1The number of items returned by each service call)ÚallÚfilterÚlimitÚ	page_size)r   rW   rX   r9   r\   rT   Nr5   )rX   r]   r^   Úinput_shapeÚmembersr   r`   rR   rS   r   r	   r_   r   r   )r   r8   r=   r9   r;   r<   rT   rX   Úunderlying_operation_membersrd   Úcustom_action_info_dictÚaction_infor5   r5   r6   rF   ¶   sr   ÿ
ú
þÿöÿüÿ	ñüÿ	ðØ;ú
ùþrF   )T)r'   Úbotocorer   Úbotocore.docs.bcdoc.restdocr   Úbotocore.docs.methodr   Úbotocore.docs.utilsr   Úboto3.docs.baser   Úboto3.docs.methodr   Úboto3.docs.utilsr   r	   r
   r?   rB   rF   r5   r5   r5   r6   Ú<module>   s   G
ý$
ù@ù