Current File : //usr/lib/python3/dist-packages/boto3/docs/__pycache__/collection.cpython-312.pyc
�

��e�-���ddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZmZGd	�d
e
�Z	dd�Z	dd�Z	dd
�Zy)�N)�
xform_name)�DocumentStructure)�get_instance_public_methods)�DocumentedShape)�NestedDocumenter)�%document_model_driven_resource_method)�add_resource_type_overview�get_resource_ignore_paramsc��eZdZd�Zd�Zy)�CollectionDocumenterc�$�|jjjj}g}t	|ddd��||j
d<|D�]@}|j
|j�t|jd��}|jd�}|jj|jd	�|jd
|j���|j|j�|j|jd|j�d�i�
�}|j!||�t"j$j'|j(|j*�|j,��}|j/||j���Cy)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_modelrr	�
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)	�selfrr�collections_list�
collection�collection_doc�breadcrumb_section�collection_section�collections_dir_paths	         �7/usr/lib/python3/dist-packages/boto3/docs/collection.py�document_collectionsz)CollectionDocumenter.document_collectionssj���n�n�)�)�8�8�D�D����"��'�3�+�	
�*:����
�&�%�	P�J��#�#�J�O�O�4�.�z���v�N�N�!/�!?�!?��!M���$�$�(�(��)B�)B�G�L��$�$�'7�
���7H�%I�J��,�,�Z�_�_�=�!/�!?�!?����$����(9��&;�<�"@�"��
�%�%�&8�*�E�$&�7�7�<�<��$�$��%�%�&��*�*�+�$� �

�(�(�)=�z���O�+	P�c	��tt|j|j��}t	||�i}|j
D]}|||j<�t
|�D�]}|j|�}||vr�t||j|jjjjj||||jjjjj����t||j||jjjjj||jjjjj����y)N)r�
resource_name�
event_emitter�batch_action_model�collection_model�
service_model)rr<�action_namer=r?r@)r�getattrrr!�document_collection_object�
batch_actions�sortedr"�document_batch_action�_resource_namer�client�eventsr@�document_collection_method)r1rr3�methodsrD�batch_action�method�method_sections        r8r)z)CollectionDocumenter._document_collectionAs8��-��D�N�N�J�O�O�4�
��	#�7�J�7��
�&�4�4�	<�L�/;�M�,�+�+�,�	<��W�o�	�F�$�4�4�V�<�N���&�%�*�"&�"5�"5�"&�.�.�"5�"5�"<�"<�"A�"A�"H�"H�'4�V�'<�%/�"&�.�.�"5�"5�"<�"<�"A�"A�"O�"O�
�+�*�"&�"5�"5� &�"&�.�.�"5�"5�"<�"<�"A�"A�"H�"H�%/�"&�.�.�"5�"5�"<�"<�"A�"A�"O�"O�
�	r:N)�__name__�
__module__�__qualname__r9r)�r:r8rrs��"P�Hr:rc�6�|rE|jjdd��|j��}|jj	|�|jd|jj�d��|jd|jj�d��y)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�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)r�getr!r#�start_sphinx_py_attr�include_doc_string�resource�type)rr?�include_signature�full_collection_names    r8rCrC`s�������"�"�;��3�4�5E�5J�5J�4K�L�	�	�
�
�*�*�+?�@����
�+�4�4�9�9�:�+�F�����
�
�
&�
&�
+�
+�,�-/�	0�r:c��|j|jj�}t|jj�}d}	|j
rt
|j
j�}	t
|�}
|j|k(r|}
dj|	|
|j|j�}t||j|||j||||��	y)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_name�operation_modelr=�method_description�example_prefix�
exclude_input�resource_action_modelrZN)
r_�request�	operationr
�paramsrXrrY�service_name�formatr!r�
documentation)rr<r=r>r@r?rZr_�
ignore_params�example_return_value�example_resource_nameras            r8rFrF}s���:$�3�3��"�"�,�,��O�/��"�"�)�)��M�&���"�"�)�*<�*E�*E�*J�*J�K��&�}�5���!�!�]�2� -��$�+�+���������	�N�*��&�+�+�'�#�*�8�8�%�#�0�+�
r:c
�T�|j|jj�}g}|jr|jj}t|�}	|j|k(r|}	d|jj�d�djt|jj�|	|j�|d�d|jj�d|jj�d�djt|jj�|	|j�t|jj�d�d|jj�d�d	jt|jj�|	|j�td
dd�
�g|d�d|jj�d�djt|jj�|	|j�td
dd�
�g|d�d�}
||
vr|
|}td||||||d�|��yy)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)r`rarbzD 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 = {}.{}.limit�count�integerz5The limit to the number of resources in the iterable.)r!�	type_nameri)r`ra�
include_inputrbzs 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)�all�filter�limit�	page_size)rr^r_r=rcrZNrR)r_rdre�input_shape�membersrrgrXrYrhr!r
rfrr)rr<rAr=r?r@rZr_�underlying_operation_membersrl�custom_action_info_dict�action_infos            r8rJrJ�s���6$�3�3�� � �*�*��O�$&� ��"�"�'6�'B�'B�'J�'J�$�&�}�5���!�!�]�2� -��
.�.>�.G�.G�.L�.L�-M�N/�0�8�>�>��+�4�4�9�9�:�%� �%�%��
:�
�.�.>�.G�.G�.L�.L�-M�N�-�6�6�;�;�<�=$�%�;�A�A��+�4�4�9�9�:�%� �%�%��
8� �(�(�/�/��
�(C�#�,�,�1�1�2�2O�Q�:�@�@��+�4�4�9�9�:�%� �%�%�� � �'�+�	�	�:�)
�0.�.>�.G�.G�.L�.L�-M�NO�P�>�D�D��+�4�4�9�9�:�%� �%�%�� � �'�N�	��:�)
�kK��X�-�-�-�k�:��-�	
��#�+�'�"2�/�
	
��	
�.r:)T)r*�botocorer�botocore.docs.bcdoc.restdocr�botocore.docs.methodr�botocore.docs.utilsr�boto3.docs.baser�boto3.docs.methodr�boto3.docs.utilsr	r
rrCrFrJrRr:r8�<module>r�sR��
��9�<�/�,�C��A�+�A�N��H�;�J�}
r: