Skip to content

Commit d2c1875

Browse files
Merge customizations for Polly
1 parent fadad21 commit d2c1875

4 files changed

Lines changed: 44 additions & 0 deletions

File tree

awscli/botocore/handlers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,12 @@ def remove_connecthealth_start_medical_scribe_listening_session(class_attributes
10021002
del class_attributes['start_medical_scribe_listening_session']
10031003

10041004

1005+
def remove_polly_start_speech_synthesis_stream(class_attributes, **kwargs):
1006+
"""Operation requires h2 which is currently unsupported in Python"""
1007+
if 'start_speech_synthesis_stream' in class_attributes:
1008+
del class_attributes['start_speech_synthesis_stream']
1009+
1010+
10051011
def remove_bucket_from_url_paths_from_model(params, model, context, **kwargs):
10061012
"""Strips leading `{Bucket}/` from any operations that have it.
10071013
@@ -1355,6 +1361,10 @@ def _set_extra_headers_for_unsigned_request(
13551361
'creating-client-class.connecthealth',
13561362
remove_connecthealth_start_medical_scribe_listening_session,
13571363
),
1364+
(
1365+
'creating-client-class.polly',
1366+
remove_polly_start_speech_synthesis_stream,
1367+
),
13581368
('after-call.iam', json_decode_policies),
13591369
('after-call.ec2.GetConsoleOutput', decode_console_output),
13601370
('after-call.cloudformation.GetTemplate', json_decode_template_body),

awscli/customizations/removals.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def register_removals(event_handler):
106106
on_event='building-command-table.logs',
107107
remove_commands=['get-log-object'],
108108
)
109+
cmd_remover.remove(
110+
on_event='building-command-table.polly',
111+
remove_commands=['start-speech-synthesis-stream'],
112+
)
109113

110114
cmd_remover.remove(
111115
on_event='building-command-table.connecthealth',

tests/functional/botocore/test_h2_required.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# Added only to keep a record of this feature being incompatible
2323
'bedrock-runtime': ['InvokeModelWithBidirectionalStream'],
2424
'connecthealth': ['StartMedicalScribeListeningSession'],
25+
'polly': ['StartSpeechSynthesisStream'],
2526
}
2627

2728

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2026 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+
from tests import BaseSessionTest
15+
16+
17+
class TestPolly(BaseSessionTest):
18+
def test_start_speech_synthesis_stream(self):
19+
"""StartSpeechSynthesisStream operation removed due to h2 requirement"""
20+
polly_client = self.session.create_client('polly', 'us-west-2')
21+
try:
22+
polly_client.start_speech_synthesis_stream
23+
except AttributeError:
24+
pass
25+
else:
26+
self.fail(
27+
'start_speech_synthesis_stream shouldn\'t be available on the '
28+
'polly client.'
29+
)

0 commit comments

Comments
 (0)