@@ -312,33 +312,9 @@ enum StreamPostPolicy{
312
312
/// For docs, search for "subscriptions:"
313
313
/// in <https://zulip.com/api/register-queue>.
314
314
@JsonSerializable (fieldRename: FieldRename .snake)
315
- class Subscription {
316
- // First, fields that are about the stream and not the user's relation to it.
317
- // These are largely the same as in [ZulipStream].
318
-
319
- final int streamId;
320
- final String name;
321
- final String description;
322
- final String renderedDescription;
323
-
324
- final int dateCreated;
325
- final int ? firstMessageId;
326
- final int ? streamWeeklyTraffic;
327
-
328
- final bool inviteOnly;
329
- final bool isWebPublic;
330
- final bool historyPublicToSubscribers;
331
- final int ? messageRetentionDays;
315
+ class Subscription extends ZulipStream {
332
316
// final List<int> subscribers; // we register with includeSubscribers false
333
317
334
- final StreamPostPolicy streamPostPolicy;
335
- // final bool? isAnnouncementOnly; // deprecated for `streamPostPolicy`; ignore
336
-
337
- final int ? canRemoveSubscribersGroupId; // TODO(server-6)
338
-
339
- // Then, fields that are specific to the subscription,
340
- // i.e. the user's relationship to the stream.
341
-
342
318
final bool ? desktopNotifications;
343
319
final bool ? emailNotifications;
344
320
final bool ? wildcardMentionsNotify;
@@ -353,32 +329,33 @@ class Subscription {
353
329
final String color;
354
330
355
331
Subscription ({
356
- required this .streamId,
357
- required this .name,
358
- required this .description,
359
- required this .renderedDescription,
360
- required this .dateCreated,
361
- required this .inviteOnly,
332
+ required super .streamId,
333
+ required super .name,
334
+ required super .description,
335
+ required super .renderedDescription,
336
+ required super .dateCreated,
337
+ required super .firstMessageId,
338
+ required super .inviteOnly,
339
+ required super .isWebPublic,
340
+ required super .historyPublicToSubscribers,
341
+ required super .messageRetentionDays,
342
+ required super .streamPostPolicy,
343
+ required super .canRemoveSubscribersGroup,
344
+ required super .streamWeeklyTraffic,
362
345
required this .desktopNotifications,
363
346
required this .emailNotifications,
364
347
required this .wildcardMentionsNotify,
365
348
required this .pushNotifications,
366
349
required this .audibleNotifications,
367
350
required this .pinToTop,
368
351
required this .isMuted,
369
- required this .isWebPublic,
370
352
required this .color,
371
- required this .streamPostPolicy,
372
- required this .messageRetentionDays,
373
- required this .historyPublicToSubscribers,
374
- required this .firstMessageId,
375
- required this .streamWeeklyTraffic,
376
- required this .canRemoveSubscribersGroupId,
377
353
});
378
354
379
355
factory Subscription .fromJson (Map <String , dynamic > json) =>
380
356
_$SubscriptionFromJson (json);
381
357
358
+ @override
382
359
Map <String , dynamic > toJson () => _$SubscriptionToJson (this );
383
360
}
384
361
0 commit comments