-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Communication]: SMS 1:N Messages, Custom Tags, and Idempotence (#16836)
* Updated SMS clients with new swagger * Updated SMS client tests * Updated SMS samples * Added resending failed messages to SMS samples * Updated SMS clients to latest swagger * Updated SMS client tests and recordings * Updated SMS samples with changes from new swagger * Added more test cases * Rebased README file * Fixed pylint issues * Added Idempotence Parameters * Updated SWAGGER formatting * Added custom SendMessageRequest model to rename the smsSendOptions field to sendSmsOptions * Updated SMS options parameter * Hide repeatability_result from SmsSendResult * Updated failure message in SMS samples * Updated formatting in models file * Updated SmsSendResult * Refactored SmsSendResult * Fixed pylint issue * Updated CHANGELOG * Use UTC time zone for repeatability_first_sent * Cleaned up CHANGELOG * Updated SMS samples * Updated SmsSendOptions * Add test for idempotency * Added case when single recipient phone number is a string * Updated method documentation in SMS clients
- Loading branch information
1 parent
5d5d5e0
commit e1b84af
Showing
34 changed files
with
1,233 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
sdk/communication/azure-communication-sms/azure/communication/sms/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
from ._sms_client import SmsClient | ||
|
||
from ._shared.models import ( | ||
PhoneNumberIdentifier, | ||
) | ||
|
||
from ._generated.models import ( | ||
SendSmsOptions, | ||
SendSmsResponse, | ||
) | ||
from ._models import SmsSendResult | ||
|
||
__all__ = [ | ||
'SmsClient', | ||
'PhoneNumberIdentifier', | ||
'SendSmsOptions', | ||
'SendSmsResponse', | ||
'SmsSendResult', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...n-sms/azure/communication/sms/_generated/models/_azure_communication_sms_service_enums.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from enum import Enum, EnumMeta | ||
from six import with_metaclass | ||
|
||
class _CaseInsensitiveEnumMeta(EnumMeta): | ||
def __getitem__(self, name): | ||
return super().__getitem__(name.upper()) | ||
|
||
def __getattr__(cls, name): | ||
"""Return the enum member matching `name` | ||
We use __getattr__ instead of descriptors or inserting into the enum | ||
class' __dict__ in order to support `name` and `value` being both | ||
properties for enum members (which live in the class' __dict__) and | ||
enum members themselves. | ||
""" | ||
try: | ||
return cls._member_map_[name.upper()] | ||
except KeyError: | ||
raise AttributeError(name) | ||
|
||
|
||
class SmsSendResponseItemRepeatabilityResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): | ||
"""The result of a repeatable request with one of the case-insensitive values accepted or | ||
rejected. | ||
""" | ||
|
||
ACCEPTED = "accepted" | ||
REJECTED = "rejected" |
Oops, something went wrong.