@@ -118,6 +118,50 @@ class User {
118118 Map <String , dynamic > toJson () => _$UserToJson (this );
119119}
120120
121+ /// As in `streams` in the initial snapshot.
122+ ///
123+ /// Not called `Stream` because dart:async uses that name.
124+ @JsonSerializable (fieldRename: FieldRename .snake)
125+ class ZulipStream {
126+ final int streamId;
127+ final String name;
128+ final String description;
129+ final String renderedDescription;
130+
131+ final int dateCreated;
132+ final int ? firstMessageId;
133+
134+ final bool inviteOnly;
135+ final bool isWebPublic;
136+ final bool historyPublicToSubscribers;
137+ final int ? messageRetentionDays;
138+
139+ final int streamPostPolicy; // TODO enum
140+ // final bool isAnnouncementOnly; // deprecated; ignore
141+
142+ final int ? canRemoveSubscribersGroupId; // TODO(server-6)
143+
144+ ZulipStream ({
145+ required this .streamId,
146+ required this .name,
147+ required this .description,
148+ required this .renderedDescription,
149+ required this .dateCreated,
150+ required this .firstMessageId,
151+ required this .inviteOnly,
152+ required this .isWebPublic,
153+ required this .historyPublicToSubscribers,
154+ required this .messageRetentionDays,
155+ required this .streamPostPolicy,
156+ required this .canRemoveSubscribersGroupId,
157+ });
158+
159+ factory ZulipStream .fromJson (Map <String , dynamic > json) =>
160+ _$ZulipStreamFromJson (json);
161+
162+ Map <String , dynamic > toJson () => _$ZulipStreamToJson (this );
163+ }
164+
121165/// As in `subscriptions` in the initial snapshot.
122166@JsonSerializable (fieldRename: FieldRename .snake)
123167class Subscription {
0 commit comments