feat!: add GetChannel endpoint#271
Conversation
Regenerate SDK from the current API spec. Adds the read-only get_channel endpoint (sync and async) returning ChannelStateResponse, plus the channel.get_channel(...) wrapper. BREAKING CHANGE: removes 2 ModerationSettings fields (analyze_max_image_size_bytes, webhook_header_client_request_id_key) no longer present in the API spec. They had no server-side binding and were non-functional; no runtime impact.
📝 WalkthroughWalkthroughAdds chat channel retrieval, feed reaction/share APIs, moderation queue management, expanded moderation and app configuration models, and review-queue export webhook parsing for synchronous and asynchronous clients. ChangesChat channel retrieval
Feeds reactions and shares
Moderation and platform updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ModerationRestClient
participant ModerationQueueAPI
Client->>ModerationRestClient: create_queue(name, type, filters)
ModerationRestClient->>ModerationQueueAPI: POST /moderation/queues
ModerationQueueAPI-->>ModerationRestClient: QueueResponse
ModerationRestClient-->>Client: StreamResponse[QueueResponse]
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@getstream/chat/async_channel.py`:
- Around line 34-52: Expose the promised get_channel API on both Channel
wrappers: rename or alias the async Channel.get method in
getstream/chat/async_channel.py lines 34-52 and the sync Channel.get method in
getstream/chat/channel.py lines 34-52 as get_channel, while preserving existing
get compatibility if needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c7e79265-4d27-4eae-95ef-4c03c1827bc5
📒 Files selected for processing (12)
getstream/chat/async_channel.pygetstream/chat/async_rest_client.pygetstream/chat/channel.pygetstream/chat/rest_client.pygetstream/common/async_rest_client.pygetstream/common/rest_client.pygetstream/feeds/rest_client.pygetstream/models/__init__.pygetstream/moderation/async_rest_client.pygetstream/moderation/rest_client.pygetstream/tests/test_webhook.pygetstream/webhook.py
| @attach_channel_cid_async | ||
| async def get( | ||
| self, | ||
| state: Optional[bool] = None, | ||
| messages_limit: Optional[int] = None, | ||
| members_limit: Optional[int] = None, | ||
| watchers_limit: Optional[int] = None, | ||
| ) -> StreamResponse[ChannelStateResponse]: | ||
| response = await self.client.get_channel( | ||
| type=self.channel_type, | ||
| id=self.channel_id, | ||
| state=state, | ||
| messages_limit=messages_limit, | ||
| members_limit=members_limit, | ||
| watchers_limit=watchers_limit, | ||
| ) | ||
| self._sync_from_response(response.data) | ||
| return response | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Align both channel wrappers with the promised get_channel API.
The REST clients correctly expose get_channel, but both public Channel wrappers are named get, so channel.get_channel(...) is unavailable.
getstream/chat/async_channel.py#L34-L52: rename the asyncgetmethod toget_channel, or add a compatibility alias.getstream/chat/channel.py#L34-L52: rename the syncgetmethod toget_channel, or add a compatibility alias.
📍 Affects 2 files
getstream/chat/async_channel.py#L34-L52(this comment)getstream/chat/channel.py#L34-L52
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@getstream/chat/async_channel.py` around lines 34 - 52, Expose the promised
get_channel API on both Channel wrappers: rename or alias the async Channel.get
method in getstream/chat/async_channel.py lines 34-52 and the sync Channel.get
method in getstream/chat/channel.py lines 34-52 as get_channel, while preserving
existing get compatibility if needed.
Summary
Regenerates the SDK from the current API spec. Adds the read-only GetChannel endpoint:
client.chat.get_channel(type, id, state=..., messages_limit=..., members_limit=..., watchers_limit=...)fetches a channel by CID without creating it (404 if it does not exist). ReturnsChannelStateResponse. Sync and async variants, plus achannel.get_channel(...)wrapper.Breaking changes
Regeneration also syncs accumulated spec drift. Two
ModerationSettingsfields are removed because they are no longer in the API spec:analyze_max_image_size_byteswebhook_header_client_request_id_keyThese had no server-side binding and were non-functional, so removing them has no runtime impact, but it is source-breaking for code referencing them. Warrants a major version bump at release.
Test plan
import getstreamOK;ruff check/ruff formatclean.Summary by CodeRabbit