o
    .&ßa†  ã                   @   s\   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e
ƒZ	dd	d
„ZdS )é    )Ú
xform_name)ÚOrderedDict)ÚDocumentedShape)Úget_service_module_name)Údocument_model_driven_methodc                   @   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   ú9/usr/lib/python3/dist-packages/botocore/docs/paginator.pyÚ__init__   s   
zPaginatorDocumenter.__init__c                 C   s`   |j  d¡ |j  ¡  | d¡ t| jjƒ}|D ]}|j  d| jj	j
|f ¡ |  ||¡ 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:`%s.Paginator.%s`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d| jjj|f d� |j ¡  |j ¡  | dt	|ƒ ¡ |j 
¡  |j ¡  | j |¡}t||| jjj| jjj|d� d S )Nz%s.Paginator.%s)Ú
class_namez&paginator = client.get_paginator('%s'))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   -   s2   

ÿÿ

ÿÿ

ÿ
û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>)r2   r3   r4   ÚmembersÚ	NextTokenz$<p>A token to resume pagination.</p>Úinput_tokenÚoutput_tokenzXCreates an iterator that will paginate through responses from :py:meth:`{0}.Client.{1}`.Ú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%   rF   rG   Úpagination_config_membersÚbotocore_pagination_paramsÚ#botocore_pagination_response_paramsÚservice_pagination_paramsÚ"service_pagination_response_paramsÚpaginate_descriptionr   r   r   r,   J   st   ÿ
ý	
þ
ýûÿ
ýÿÿÿÿþ
÷r,   N)T)Úbotocorer   Úbotocore.compatr   Úbotocore.docs.utilsr   Úbotocore.utilsr   Úbotocore.docs.methodr   Úobjectr   r,   r   r   r   r   Ú<module>   s   8þ