Skip to content

Commit

Permalink
model [nfc]: Clarify how to add new fields to ZulipStream
Browse files Browse the repository at this point in the history
  • Loading branch information
sm-sayedi committed Aug 20, 2024
1 parent f1e67bf commit 00237ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/api/model/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ enum UserRole{
/// in <https://zulip.com/api/register-queue>.
@JsonSerializable(fieldRename: FieldRename.snake)
class ZulipStream {
// When adding a field to this class:
// * If a [ChannelUpdateEvent] can update it, be sure to add
// that case as a field of [ChannelUpdateEvent] or as a new value to
// [ChannelPropertyName] enum; based on what the stream-update API suggests.
// * If the field can never change for a given Zulip stream, mark it final.
// * (If it can change but [ChannelUpdateEvent] doesn't cover that,
// then that's a bug in the API; raise it in `#api design`.)

final int streamId;
String name;
String description;
Expand Down

0 comments on commit 00237ae

Please sign in to comment.