# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License"). You3# may not use this file except in compliance with the License. A copy of4# the License is located at5#6# http://aws.amazon.com/apache2.0/7#8# or in the "license" file accompanying this file. This file is9# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF10# ANY KIND, either express or implied. See the License for the specific11# language governing permissions and limitations under the License.121314def register_kinesis_list_streams_pagination_backcompat(event_emitter):15# The ListStreams previously used the ExclusiveStartStreamName parameter16# for input tokens to pagination. This operation was then updated to17# also allow for the typical NextToken input and output parameters. The18# pagination model was also updated to use the NextToken field instead of19# the ExclusiveStartStreamName field for input tokens. However, the20# ExclusiveStartStreamName is still a valid parameter to control pagination21# of this operation and is incompatible with the NextToken parameter. So,22# the CLI needs to continue to treat the ExclusiveStartStreamName as if it23# is a raw input token parameter to the API by disabling auto-pagination if24# provided. Otherwise, if it was treated as a normal API parameter, errors25# would be thrown when paginating across multiple pages since the parameter26# is incompatible with the NextToken parameter.27event_emitter.register(28'building-argument-table.kinesis.list-streams',29undocument_exclusive_start_stream_name,30)31event_emitter.register(32'operation-args-parsed.kinesis.list-streams',33disable_pagination_when_exclusive_start_stream_name_provided,34)353637def undocument_exclusive_start_stream_name(argument_table, **kwargs):38argument_table['exclusive-start-stream-name']._UNDOCUMENTED = True394041def disable_pagination_when_exclusive_start_stream_name_provided(42parsed_args, parsed_globals, **kwargs43):44if parsed_args.exclusive_start_stream_name is not None:45parsed_globals.paginate = False464748