Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/awscli/customizations/kinesis.py
1566 views
1
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License"). You
4
# may not use this file except in compliance with the License. A copy of
5
# the License is located at
6
#
7
# http://aws.amazon.com/apache2.0/
8
#
9
# or in the "license" file accompanying this file. This file is
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
# ANY KIND, either express or implied. See the License for the specific
12
# language governing permissions and limitations under the License.
13
14
15
def register_kinesis_list_streams_pagination_backcompat(event_emitter):
16
# The ListStreams previously used the ExclusiveStartStreamName parameter
17
# for input tokens to pagination. This operation was then updated to
18
# also allow for the typical NextToken input and output parameters. The
19
# pagination model was also updated to use the NextToken field instead of
20
# the ExclusiveStartStreamName field for input tokens. However, the
21
# ExclusiveStartStreamName is still a valid parameter to control pagination
22
# of this operation and is incompatible with the NextToken parameter. So,
23
# the CLI needs to continue to treat the ExclusiveStartStreamName as if it
24
# is a raw input token parameter to the API by disabling auto-pagination if
25
# provided. Otherwise, if it was treated as a normal API parameter, errors
26
# would be thrown when paginating across multiple pages since the parameter
27
# is incompatible with the NextToken parameter.
28
event_emitter.register(
29
'building-argument-table.kinesis.list-streams',
30
undocument_exclusive_start_stream_name,
31
)
32
event_emitter.register(
33
'operation-args-parsed.kinesis.list-streams',
34
disable_pagination_when_exclusive_start_stream_name_provided,
35
)
36
37
38
def undocument_exclusive_start_stream_name(argument_table, **kwargs):
39
argument_table['exclusive-start-stream-name']._UNDOCUMENTED = True
40
41
42
def disable_pagination_when_exclusive_start_stream_name_provided(
43
parsed_args, parsed_globals, **kwargs
44
):
45
if parsed_args.exclusive_start_stream_name is not None:
46
parsed_globals.paginate = False
47
48