Azure / Azure/azure-sdk-for-python

Automatically chunk SMS recipients to avoid"Max of 100 phone numbers are allowed in the To field."

オープン
#42,010 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Client Communication - SMS customer-reported needs-team-attention question Service Attention
主要言語
Python
スター
5.6k
フォーク
3.4k
平均マージ
2日 2時間
マージ済み PR(30日)
213

説明

**Is your feature request related to a problem? Please describe.**

[`SMSClient.send`](https://github.com/Azure/azure-sdk-for-python/blob/9d7aea0a14d0766398b3c18ac8ddad2df95f0750/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py#L84) can fail with:

```
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Bad Request'
Content: {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.1","title":"One or more validation errors occurred.","status":400,"errors":{"SmsRecipients":["Max of 100 phone numbers are allowed in the To field."]},"traceId":"..."}
````

**Describe the solution you'd like**

Automatically chunk the list in to groups of 100 and make repeated API requests.

**Describe alternatives you've considered**

Manually chunk at the caller, but that requires the user to know about the API limitation ahead of time.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py の SMSClient.send から開始します。ここで issue は受信者数の上限に関する失敗を報告しています。受信者がどのように送信されるかを追跡し、その後、100 件を超えるリストが 100 件ずつのグループに分割され、API リクエストを繰り返して送信されることを確認します。その際、より小さいリストに対して要求されている動作は変更しません。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, python
領域
api
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。