MCPcopy Index your code
hub / github.com/aws/aws-cli / document_paginate_method

Function document_paginate_method

awscli/botocore/docs/paginator.py:114–234  ·  view source on GitHub ↗

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_co

(
    section,
    paginator_name,
    event_emitter,
    service_model,
    paginator_config,
    include_signature=True,
)

Source from the content-addressed store, hash-verified

112
113
114def document_paginate_method(
115 section,
116 paginator_name,
117 event_emitter,
118 service_model,
119 paginator_config,
120 include_signature=True,
121):
122 """Documents the paginate method of a paginator
123
124 :param section: The section to write to
125
126 :param paginator_name: The name of the paginator. It is snake cased.
127
128 :param event_emitter: The event emitter to use to emit events
129
130 :param service_model: The service model
131
132 :param paginator_config: The paginator config associated to a particular
133 paginator.
134
135 :param include_signature: Whether or not to include the signature.
136 It is useful for generating docstrings.
137 """
138 # Retrieve the operation model of the underlying operation.
139 operation_model = service_model.operation_model(paginator_name)
140
141 # Add representations of the request and response parameters
142 # we want to include in the description of the paginate method.
143 # These are parameters we expose via the botocore interface.
144 pagination_config_members = OrderedDict()
145
146 pagination_config_members['MaxItems'] = DocumentedShape(
147 name='MaxItems',
148 type_name='integer',
149 documentation=(
150 '<p>The total number of items to return. If the total '
151 'number of items available is more than the value '
152 'specified in max-items then a <code>NextToken</code> '
153 'will be provided in the output that you can use to '
154 'resume pagination.</p>'
155 ),
156 )
157
158 if paginator_config.get('limit_key', None):
159 pagination_config_members['PageSize'] = DocumentedShape(
160 name='PageSize',
161 type_name='integer',
162 documentation='<p>The size of each page.<p>',
163 )
164
165 pagination_config_members['StartingToken'] = DocumentedShape(
166 name='StartingToken',
167 type_name='string',
168 documentation=(
169 '<p>A token to specify where to start paginating. '
170 'This is the <code>NextToken</code> from a previous '
171 'response.</p>'

Callers 2

_write_docstringMethod · 0.90
_add_paginatorMethod · 0.85

Calls 5

DocumentedShapeClass · 0.90
get_service_module_nameFunction · 0.90
xform_nameFunction · 0.90
operation_modelMethod · 0.80

Tested by

no test coverage detected