Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-cloudwatch-91803.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "``cloudwatch``",
"description": "Alias ``get_o_tel_enrichment``, ``start_o_tel_enrichment``, and ``stop_o_tel_enrichment`` botocore methods to use ``otel`` instead of ``o_tel``."
}
6 changes: 6 additions & 0 deletions botocore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
'GetLinkedWhatsAppBusinessAccountPhoneNumber',
'-',
): 'get-linked-whatsapp-business-account-phone-number',
('GetOTelEnrichment', '_'): 'get_otel_enrichment',
('GetOTelEnrichment', '-'): 'get-otel-enrichment',
('GetWhatsAppMessageMedia', '_'): 'get_whatsapp_message_media',
('GetWhatsAppMessageMedia', '-'): 'get-whatsapp-message-media',
('GetWhatsAppMessageTemplate', '_'): 'get_whatsapp_message_template',
Expand Down Expand Up @@ -132,6 +134,10 @@
): 'put-whatsapp-business-account-event-destinations',
('SendWhatsAppMessage', '_'): 'send_whatsapp_message',
('SendWhatsAppMessage', '-'): 'send-whatsapp-message',
('StartOTelEnrichment', '_'): 'start_otel_enrichment',
('StartOTelEnrichment', '-'): 'start-otel-enrichment',
('StopOTelEnrichment', '_'): 'stop_otel_enrichment',
('StopOTelEnrichment', '-'): 'stop-otel-enrichment',
('UpdateWhatsAppMessageTemplate', '_'): 'update_whatsapp_message_template',
('UpdateWhatsAppMessageTemplate', '-'): 'update-whatsapp-message-template',
}
Expand Down
12 changes: 12 additions & 0 deletions botocore/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,18 @@ def get_bearer_auth_supported_services():
'getattr.socialmessaging.delete_whatsapp_media_message',
ClientMethodAlias('delete_whatsapp_message_media'),
),
(
'getattr.cloudwatch.get_o_tel_enrichment',
ClientMethodAlias('get_otel_enrichment'),
),
(
'getattr.cloudwatch.start_o_tel_enrichment',
ClientMethodAlias('start_otel_enrichment'),
),
(
'getattr.cloudwatch.stop_o_tel_enrichment',
ClientMethodAlias('stop_otel_enrichment'),
),
(
'before-parameter-build.s3.UploadPart',
convert_body_to_file_like_object,
Expand Down
59 changes: 59 additions & 0 deletions tests/functional/test_cloudwatch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import pytest

from botocore import xform_name
from botocore.session import get_session
from botocore.stub import Stubber

_OTEL_OPERATIONS = [
'GetOTelEnrichment',
'StartOTelEnrichment',
'StopOTelEnrichment',
]


@pytest.mark.validates_models
@pytest.mark.parametrize("operation", _OTEL_OPERATIONS)
def test_otel_xform_name(operation):
assert 'otel' in xform_name(operation, '_')
assert 'otel' in xform_name(operation, '-')


class TestCloudWatchOTelEnrichment:
def setup_method(self):
session = get_session()
self.client = session.create_client('cloudwatch', 'us-east-1')
self.stubber = Stubber(self.client)
self.stubber.activate()

@pytest.mark.parametrize(
"old_name, new_name, response",
[
(
'get_o_tel_enrichment',
'get_otel_enrichment',
{'Status': 'Running'},
),
('start_o_tel_enrichment', 'start_otel_enrichment', {}),
('stop_o_tel_enrichment', 'stop_otel_enrichment', {}),
],
)
def test_otel_enrichment_aliased(self, old_name, new_name, response):
self.stubber.add_response(new_name, response)
self.stubber.add_response(new_name, response)

getattr(self.client, old_name)()
getattr(self.client, new_name)()

self.stubber.assert_no_pending_responses()
12 changes: 12 additions & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ def test_special_cases(self):
xform_name('GetLinkedWhatsAppBusinessAccountPhoneNumber', '-'),
'get-linked-whatsapp-business-account-phone-number',
)
self.assertEqual(
xform_name('GetOTelEnrichment', '-'),
'get-otel-enrichment',
)
self.assertEqual(
xform_name('GetWhatsAppMessageMedia', '-'),
'get-whatsapp-message-media',
Expand Down Expand Up @@ -361,6 +365,14 @@ def test_special_cases(self):
self.assertEqual(
xform_name('SendWhatsAppMessage', '-'), 'send-whatsapp-message'
)
self.assertEqual(
xform_name('StartOTelEnrichment', '-'),
'start-otel-enrichment',
)
self.assertEqual(
xform_name('StopOTelEnrichment', '-'),
'stop-otel-enrichment',
)
self.assertEqual(
xform_name('UpdateWhatsAppMessageTemplate', '-'),
'update-whatsapp-message-template',
Expand Down
Loading