Skip to content

Commit 4b2357e

Browse files
authored
[comminication] - sms-Adds type check for enable_delivery_report parameter in send function (#37341)
* Rolled back spell check changes in README.md * Separating pipeline changes
1 parent be9a055 commit 4b2357e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ def send(self, from_, # type: str
106106
if isinstance(to, str):
107107
to = [to]
108108

109+
if not isinstance(enable_delivery_report, bool):
110+
raise TypeError("enable_delivery_report must be a boolean.")
111+
109112
sms_send_options = SmsSendOptions(
110113
enable_delivery_report=enable_delivery_report,
111114
tag=tag

sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .._version import SDK_MONIKER
2323

2424

25-
class SmsClient(object): # pylint: disable=client-accepts-api-version-keyword
25+
class SmsClient(object): # pylint: disable=client-accepts-api-version-keyword
2626
"""A client to interact with the AzureCommunicationService Sms gateway asynchronously.
2727
2828
This client provides operations to send an SMS via a phone number.
@@ -105,6 +105,9 @@ async def send(
105105
if isinstance(to, str):
106106
to = [to]
107107

108+
if not isinstance(enable_delivery_report, bool):
109+
raise TypeError("enable_delivery_report must be a boolean.")
110+
108111
sms_send_options = SmsSendOptions(
109112
enable_delivery_report=enable_delivery_report,
110113
tag=tag

0 commit comments

Comments
 (0)