o
    ˷e                     @   sZ   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	 G dd dZ
	dd	d
ZdS )    )
xform_name)OrderedDict)document_model_driven_method)DocumentedShape)get_service_module_namec                   @   s$   e Zd Zdd Zdd Zdd ZdS )PaginatorDocumenterc                 C   s   || _ | j jjj| _|| _d S )N)_clientmetaservice_modelservice_name_service_name_service_paginator_model)selfclientservice_paginator_model r   N/var/www/ideatree/venv/lib/python3.10/site-packages/botocore/docs/paginator.py__init__   s   
zPaginatorDocumenter.__init__c                 C   sf   |j d |j   |d t| jj}|D ]}|j d| jj	j
 d| d | || qdS )zhDocuments the various paginators for a service

        param section: The section to write to.
        
PaginatorszThe available paginators are:z:py:class:`.Paginator.`N)styleh2new_linewritelnsortedr   _paginator_configlir   	__class____name___add_paginator)r   sectionpaginator_namespaginator_namer   r   r   document_paginators   s   

z'PaginatorDocumenter.document_paginatorsc                 C   s   | |}|jj| jjj d| d |j  |j  |dt	| d |j
  |j  | j|}t||| jjj| jjj|d d S )Nr   )
class_namez"paginator = client.get_paginator('z'))r!   r#   event_emitterr
   paginator_config)add_new_sectionr   start_sphinx_py_classr   r   r   start_codeblockr   writer   end_codeblockr   get_paginatordocument_paginate_methodr	   eventsr
   )r   r!   r#   r'   r   r   r   r    .   s*   





z"PaginatorDocumenter._add_paginatorN)r   
__module____qualname__r   r$   r    r   r   r   r   r      s    r   Tc                 C   s   | |}t }tdddd|d< |ddr tdddd|d< td	d
dd|d	< tddd|dg}tdd
ddg}	g }
t|d trJ|
|d 7 }
n|
|d  |ddr^|
|d  g }t|d trn||d 7 }n||d  dt|t	|}t
| d|||d||	|
||d dS )a  Documents the paginate method of a paginator

    :param section: The section to write to

    :param paginator_name: The name of the paginator. It is snake cased.

    :param event_emitter: The event emitter to use to emit events

    :param service_model: The service model

    :param paginator_config: The paginator config associated to a particular
        paginator.

    :param include_signature: Whether or not to include the signature.
        It is useful for generating docstrings.
    MaxItemsintegerz<p>The total number of items to return. If the total number of items available is more than the value specified in max-items then a <code>NextToken</code> will be provided in the output that you can use to resume pagination.</p>)name	type_namedocumentation	limit_keyNPageSizez<p>The size of each page.<p>StartingTokenstringzq<p>A token to specify where to start paginating. This is the <code>NextToken</code> from a previous response.</p>PaginationConfig	structurezC<p>A dictionary that provides parameters to control pagination.</p>)r4   r5   r6   members	NextTokenz$<p>A token to resume pagination.</p>input_tokenoutput_tokenzVCreates an iterator that will paginate through responses from :py:meth:`{}.Client.{}`.paginatez&response_iterator = paginator.paginate)r&   method_descriptionexample_prefixinclude_inputinclude_outputexclude_inputexclude_outputinclude_signature)operation_modelr   r   get
isinstancelistappendformatr   r   r   )r!   r#   r&   r
   r'   rH   rI   pagination_config_membersbotocore_pagination_params#botocore_pagination_response_paramsservice_pagination_params"service_pagination_response_paramspaginate_descriptionr   r   r   r.   M   sz   




r.   N)T)botocorer   botocore.compatr   botocore.docs.methodr   botocore.docs.utilsr   botocore.utilsr   r   r.   r   r   r   r   <module>   s   ?