Repository navigation
feat: regenerate the client from the current Stream API #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -413,6 +413,7 @@ async def get_channel( | |
| messages_id_gt: Optional[str] = None, | ||
| messages_id_gte: Optional[str] = None, | ||
| messages_id_around: Optional[str] = None, | ||
| include_soft_deleted_channel: Optional[bool] = None, | ||
| user_id: Optional[str] = None, | ||
| ) -> StreamResponse[ChannelStateResponse]: | ||
| query_params = build_query_param( | ||
|
|
@@ -426,6 +427,7 @@ async def get_channel( | |
| "messages_id_gt": messages_id_gt, | ||
| "messages_id_gte": messages_id_gte, | ||
| "messages_id_around": messages_id_around, | ||
| "include_soft_deleted_channel": include_soft_deleted_channel, | ||
| "user_id": user_id, | ||
| } | ||
| ) | ||
|
|
@@ -1104,8 +1106,10 @@ async def create_channel_type( | |
| uploads: Optional[bool] = None, | ||
| url_enrichment: Optional[bool] = None, | ||
| user_message_reminders: Optional[bool] = None, | ||
| voice_transcription: Optional[bool] = None, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Append the new channel-type arguments after the existing arguments. Inserting The update signature also shifts Append both new arguments after Also applies to: 1112-1112, 1217-1217, 1221-1221
|
||
| blocklists: Optional[List[BlockListOptions]] = None, | ||
| commands: Optional[List[str]] = None, | ||
| mark_types: Optional[List[str]] = None, | ||
| permissions: Optional[List[PolicyRequest]] = None, | ||
| automod_thresholds: Optional[Thresholds] = None, | ||
| chat_preferences: Optional[ChatPreferences] = None, | ||
|
|
@@ -1142,8 +1146,10 @@ async def create_channel_type( | |
| uploads=uploads, | ||
| url_enrichment=url_enrichment, | ||
| user_message_reminders=user_message_reminders, | ||
| voice_transcription=voice_transcription, | ||
| blocklists=blocklists, | ||
| commands=commands, | ||
| mark_types=mark_types, | ||
| permissions=permissions, | ||
| automod_thresholds=automod_thresholds, | ||
| chat_preferences=chat_preferences, | ||
|
|
@@ -1208,9 +1214,11 @@ async def update_channel_type( | |
| uploads: Optional[bool] = None, | ||
| url_enrichment: Optional[bool] = None, | ||
| user_message_reminders: Optional[bool] = None, | ||
| voice_transcription: Optional[bool] = None, | ||
| allowed_flag_reasons: Optional[List[str]] = None, | ||
| blocklists: Optional[List[BlockListOptions]] = None, | ||
| commands: Optional[List[str]] = None, | ||
| mark_types: Optional[List[str]] = None, | ||
| permissions: Optional[List[PolicyRequest]] = None, | ||
| automod_thresholds: Optional[Thresholds] = None, | ||
| chat_preferences: Optional[ChatPreferences] = None, | ||
|
|
@@ -1249,9 +1257,11 @@ async def update_channel_type( | |
| uploads=uploads, | ||
| url_enrichment=url_enrichment, | ||
| user_message_reminders=user_message_reminders, | ||
| voice_transcription=voice_transcription, | ||
| allowed_flag_reasons=allowed_flag_reasons, | ||
| blocklists=blocklists, | ||
| commands=commands, | ||
| mark_types=mark_types, | ||
| permissions=permissions, | ||
| automod_thresholds=automod_thresholds, | ||
| chat_preferences=chat_preferences, | ||
|
|
@@ -1578,6 +1588,48 @@ async def ephemeral_message_update( | |
| json=json, | ||
| ) | ||
|
|
||
| @telemetry.operation_name("getstream.api.chat.create_message_mark") | ||
| async def create_message_mark( | ||
| self, | ||
| id: str, | ||
| type: str, | ||
| user_id: Optional[str] = None, | ||
| user: Optional[UserRequest] = None, | ||
| ) -> StreamResponse[CreateMessageMarkResponse]: | ||
| path_params = { | ||
| "id": id, | ||
| } | ||
| json = CreateMessageMarkRequest(type=type, user_id=user_id, user=user).to_dict() | ||
| return await self.post( | ||
| "/api/v2/chat/messages/{id}/marks", | ||
| CreateMessageMarkResponse, | ||
| path_params=path_params, | ||
| json=json, | ||
| ) | ||
|
|
||
| @telemetry.operation_name("getstream.api.chat.query_message_marks") | ||
| async def query_message_marks( | ||
| self, | ||
| id: str, | ||
| limit: Optional[int] = None, | ||
| next: Optional[str] = None, | ||
| user_id: Optional[str] = None, | ||
| filter: Optional[QueryMessageMarksFilter] = None, | ||
| user: Optional[UserRequest] = None, | ||
| ) -> StreamResponse[QueryMessageMarksResponse]: | ||
| path_params = { | ||
| "id": id, | ||
| } | ||
| json = QueryMessageMarksRequest( | ||
| limit=limit, next=next, user_id=user_id, filter=filter, user=user | ||
| ).to_dict() | ||
| return await self.post( | ||
| "/api/v2/chat/messages/{id}/marks/query", | ||
| QueryMessageMarksResponse, | ||
| path_params=path_params, | ||
| json=json, | ||
| ) | ||
|
|
||
| @telemetry.operation_name("getstream.api.chat.send_reaction") | ||
| async def send_reaction( | ||
| self, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,7 @@ async def update_app( | |
| grants: Optional[Dict[str, List[str]]] = None, | ||
| huawei_config: Optional[HuaweiConfig] = None, | ||
| image_upload_config: Optional[FileUploadConfig] = None, | ||
| message_marks: Optional[MessageMarksConfig] = None, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve the existing positional argument order. An existing positional
|
||
| moderation_dashboard_preferences: Optional[ | ||
| ModerationDashboardPreferences | ||
| ] = None, | ||
|
|
@@ -163,6 +164,7 @@ async def update_app( | |
| grants=grants, | ||
| huawei_config=huawei_config, | ||
| image_upload_config=image_upload_config, | ||
| message_marks=message_marks, | ||
| moderation_dashboard_preferences=moderation_dashboard_preferences, | ||
| push_config=push_config, | ||
| xiaomi_config=xiaomi_config, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ def get_or_create( | |
| next: Optional[str] = None, | ||
| overwrite_interest_weights: Optional[bool] = None, | ||
| prev: Optional[str] = None, | ||
| skip_feed_creation: Optional[bool] = None, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve existing positional argument bindings in both signatures. An existing call such as Append the new parameter after the existing parameters in both signatures. This preserves positional calls and keeps the new keyword option available. Update the generator for the REST signature and regenerate it. Based on learnings, generated API endpoints must be rebuilt with
|
||
| user_id: Optional[str] = None, | ||
| view: Optional[str] = None, | ||
| watch: Optional[bool] = None, | ||
|
|
@@ -63,6 +64,7 @@ def get_or_create( | |
| next=next, | ||
| overwrite_interest_weights=overwrite_interest_weights, | ||
| prev=prev, | ||
| skip_feed_creation=skip_feed_creation, | ||
| user_id=user_id, | ||
| view=view, | ||
| watch=watch, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve the positional
user_idargument.An existing call such as
channel.get(*([None] * 9), "alice")now binds"alice"toinclude_soft_deleted_channel. The request omitsuser_idand sendsinclude_soft_deleted_channel=aliceinstead.Append the new parameter after
user_id. Apply the same correction to syncChannel.getand both RESTget_channelsignatures. Existing positional calls and new keyword calls will then retain their intended bindings.