[BUG] Wrong typing in Client.insights.v1.rooms.list

未關閉
#992 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python
領域
api

研究方向

Start from the RoomInstance definition behind Client.insights.v1.rooms.list, likely in the generated insights room resource, and compare its payload.get(...) assignments with the Video Log Analyzer Room Summary properties linked in the issue. Check whether these models are generated from the twilio-oai spec, since the durable fix may belong there and then be regenerated. Done when the documented non-optional fields are typed as required and the relevant insights tests still pass.

由索引模型根據 Issue 內容生成。

描述

type: bug
Describe the bug

Client.insights.v1.rooms.list returns a list[RoomInstance]. But there is an issue with RoomInstance types, all the fields of that RoomInstance are optional. Are there any reason why they marked optional?

Code snippet
class RoomInstance:
        self.account_sid: Optional[str] = payload.get("account_sid")
        self.room_sid: Optional[str] = payload.get("room_sid")
        self.room_name: Optional[str] = payload.get("room_name")
        self.create_time: Optional[datetime] = deserialize.iso8601_datetime(
            payload.get("create_time")
        )
        self.end_time: Optional[datetime] = deserialize.iso8601_datetime(
            payload.get("end_time")
        )

Screenshot 2026-11-18 at 18 15 53
Actual behavior
According to your API docs, Room fields are not optional: https://www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#room-summary-resource-properties
Screenshot 2026-11-18 at 18 11 01
But according to the code, they all are optional:
Screenshot 2026-11-18 at 18 11 31
Expected behavior

All the fields should not be Optional

twilio-python version

9.13.0

Python version

3.9.11

Logs or error messages

No response

Additional context

No response

主要語言
Python
星號
2.1k
分支
821
平均合併
9 小時 33 分鐘
30 天內合併 PR
3

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

twilio/twilio-python 的其他 Issue

查看 twilio/twilio-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。