Skip to content

Commit 059bec5

Browse files
committed
api [nfc]: Rename streamWeeklyTraffic to channelWeeklyTraffic in Channel
Fixes parts of zulip#631
1 parent 97c1493 commit 059bec5

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

lib/api/model/model.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ class Channel {
329329
final int? canRemoveSubscribersGroup;
330330

331331
// TODO(server-8): added in FL 199, was previously only on [Subscription] objects
332-
final int? streamWeeklyTraffic;
332+
@JsonKey(name: 'stream_weekly_traffic')
333+
final int? channelWeeklyTraffic;
333334

334335
static int? _readCanRemoveSubscribersGroup(Map<dynamic, dynamic> json, String key) {
335336
return (json[key] as int?)
@@ -349,7 +350,7 @@ class Channel {
349350
required this.messageRetentionDays,
350351
required this.channelPostPolicy,
351352
required this.canRemoveSubscribersGroup,
352-
required this.streamWeeklyTraffic,
353+
required this.channelWeeklyTraffic,
353354
});
354355

355356
factory Channel.fromJson(Map<String, dynamic> json) =>
@@ -420,7 +421,7 @@ class Subscription extends Channel {
420421
required super.messageRetentionDays,
421422
required super.channelPostPolicy,
422423
required super.canRemoveSubscribersGroup,
423-
required super.streamWeeklyTraffic,
424+
required super.channelWeeklyTraffic,
424425
required this.desktopNotifications,
425426
required this.emailNotifications,
426427
required this.wildcardMentionsNotify,

lib/api/model/model.g.dart

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/example_data.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Channel stream({
162162
int? messageRetentionDays,
163163
StreamPostPolicy? channelPostPolicy,
164164
int? canRemoveSubscribersGroup,
165-
int? streamWeeklyTraffic,
165+
int? channelWeeklyTraffic,
166166
}) {
167167
return Channel(
168168
channelId: channelId ?? 123, // TODO generate example IDs
@@ -177,7 +177,7 @@ Channel stream({
177177
messageRetentionDays: messageRetentionDays,
178178
channelPostPolicy: channelPostPolicy ?? StreamPostPolicy.any,
179179
canRemoveSubscribersGroup: canRemoveSubscribersGroup ?? 123,
180-
streamWeeklyTraffic: streamWeeklyTraffic,
180+
channelWeeklyTraffic: channelWeeklyTraffic,
181181
);
182182
}
183183
const _stream = stream;
@@ -210,7 +210,7 @@ Subscription subscription(
210210
messageRetentionDays: stream.messageRetentionDays,
211211
channelPostPolicy: stream.channelPostPolicy,
212212
canRemoveSubscribersGroup: stream.canRemoveSubscribersGroup,
213-
streamWeeklyTraffic: stream.streamWeeklyTraffic,
213+
channelWeeklyTraffic: stream.channelWeeklyTraffic,
214214
desktopNotifications: desktopNotifications ?? false,
215215
emailNotifications: emailNotifications ?? false,
216216
wildcardMentionsNotify: wildcardMentionsNotify ?? false,

0 commit comments

Comments
 (0)