@@ -312,80 +312,49 @@ 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
- // TODO(server-6): `canRemoveSubscribersGroupId` added in FL 142
338
- // TODO(server-8): in FL 197 renamed to `canRemoveSubscribersGroup`
339
- @JsonKey (readValue: _readCanRemoveSubscribersGroup)
340
- final int ? canRemoveSubscribersGroup;
341
-
342
- // Then, fields that are specific to the subscription,
343
- // i.e. the user's relationship to the stream.
344
-
345
318
final bool ? desktopNotifications;
346
319
final bool ? emailNotifications;
347
320
final bool ? wildcardMentionsNotify;
348
321
final bool ? pushNotifications;
349
322
final bool ? audibleNotifications;
350
323
351
324
final bool pinToTop;
352
-
353
325
final bool isMuted;
354
326
// final bool? inHomeView; // deprecated; ignore
355
327
356
328
final String color;
357
329
358
- static int ? _readCanRemoveSubscribersGroup (Map json, String key) {
359
- return json[key] ?? json['can_remove_subscribers_group_id' ];
360
- }
361
-
362
330
Subscription ({
363
- required this .streamId,
364
- required this .name,
365
- required this .description,
366
- required this .renderedDescription,
367
- required this .dateCreated,
368
- required this .inviteOnly,
331
+ required super .streamId,
332
+ required super .name,
333
+ required super .description,
334
+ required super .renderedDescription,
335
+ required super .dateCreated,
336
+ required super .firstMessageId,
337
+ required super .inviteOnly,
338
+ required super .isWebPublic,
339
+ required super .historyPublicToSubscribers,
340
+ required super .messageRetentionDays,
341
+ required super .streamPostPolicy,
342
+ required super .canRemoveSubscribersGroup,
343
+ required super .streamWeeklyTraffic,
369
344
required this .desktopNotifications,
370
345
required this .emailNotifications,
371
346
required this .wildcardMentionsNotify,
372
347
required this .pushNotifications,
373
348
required this .audibleNotifications,
374
349
required this .pinToTop,
375
350
required this .isMuted,
376
- required this .isWebPublic,
377
351
required this .color,
378
- required this .streamPostPolicy,
379
- required this .messageRetentionDays,
380
- required this .historyPublicToSubscribers,
381
- required this .firstMessageId,
382
- required this .streamWeeklyTraffic,
383
- required this .canRemoveSubscribersGroup,
384
352
});
385
353
386
354
factory Subscription .fromJson (Map <String , dynamic > json) =>
387
355
_$SubscriptionFromJson (json);
388
356
357
+ @override
389
358
Map <String , dynamic > toJson () => _$SubscriptionToJson (this );
390
359
}
391
360
0 commit comments