File: //lib/python3.6/site-packages/awscli/customizations/__pycache__/paginate.cpython-36.opt-1.pyc
3
�T_�. � @ s� d Z ddlZddlmZ ddlmZ ddlmZmZ ddlm Z ddl
mZ eje
�ZdZd Zd
Zdd� Zd
d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � ZG d!d"� d"e�ZdS )#a' This module has customizations to unify paging paramters.
For any operation that can be paginated, we will:
* Hide the service specific pagination params. This can vary across
services and we're going to replace them with a consistent set of
arguments. The arguments will still work, but they are not
documented. This allows us to add a pagination config after
the fact and still remain backwards compatible with users that
were manually doing pagination.
* Add a ``--starting-token`` and a ``--max-items`` argument.
� N)�partial)�
xform_name)�DataNotFoundError�PaginationError)�model)�BaseCLIArgumenta/
<p>A token to specify where to start paginating. This is the
<code>NextToken</code> from a previously truncated response.</p>
<p>For usage examples, see <a
href="https://docs.aws.amazon.com/cli/latest/userguide/pagination.html"
>Pagination</a> in the <i>AWS Command Line Interface User
Guide</i>.</p>
a`
<p>The total number of items to return in the command's output.
If the total number of items available is more than the value
specified, a <code>NextToken</code> is provided in the command's
output. To resume pagination, provide the
<code>NextToken</code> value in the <code>starting-token</code>
argument of a subsequent command. <b>Do not</b> use the
<code>NextToken</code> response element directly outside of the
AWS CLI.</p>
<p>For usage examples, see <a
href="https://docs.aws.amazon.com/cli/latest/userguide/pagination.html"
>Pagination</a> in the <i>AWS Command Line Interface User
Guide</i>.</p>
a�
<p>The size of each page to get in the AWS service call. This
does not affect the number of items returned in the command's
output. Setting a smaller page size results in more calls to
the AWS service, retrieving fewer items in each call. This can
help prevent the AWS service calls from timing out.</p>
<p>For usage examples, see <a
href="https://docs.aws.amazon.com/cli/latest/userguide/pagination.html"
>Pagination</a> in the <i>AWS Command Line Interface User
Guide</i>.</p>
c C s | j dt� | jdt� d S )Nzbuilding-argument-tablezdoc-description)�register�unify_paging_paramsZ
register_last�add_paging_description)Zevent_handlers� r �/usr/lib/python3.6/paginate.py�register_paginationL s r
c C sL y| j |�}W n tk
r" d S X y|j|�}W n tk
rF d S X |S )N)Zget_paginator_modelr Z
get_paginator�
ValueError)�session�service_nameZoperation_nameZpaginator_modelZoperation_paginator_configr r r �get_paginator_configQ s
r c K s� t | jtj�sd S | jjj}t| j|| jj�}|s6d S | j j
j� | j jd| j � |j
d�r�|d }t|�tk rx|g}djdd� |D ��}| j jd| � d S )Nz�``%s`` is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the ``--no-paginate`` argument.Z
result_keyz, c S s g | ]}d | �qS )z``%s``r )�.0�sr r r �
<listcomp>s s z*add_paging_description.<locals>.<listcomp>z�When using ``--output text`` and the ``--query`` argument on a paginated response, the ``--query`` argument must extract data from the results of the following query expressions: %s)�
isinstance�objr ZOperationModel�
service_modelr r r �name�docZstyleZ
new_paragraphZwriteln�get�type�list�join)Zhelp_command�kwargsr �paginator_configZqueriesr r r r
^ s&