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

Open
#992 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
2.1k
Forks
821
Avg merge
9h 33m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twilio/twilio-python

All issues in twilio/twilio-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.