Skip to content

Commit b4cca1f

Browse files
committed
api [nfc]: Rename StreamPostPolicy to ChannelPostPolicy
Fixes parts of zulip#631
1 parent 059bec5 commit b4cca1f

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

lib/api/model/model.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class Channel {
320320
final bool historyPublicToSubscribers;
321321
final int? messageRetentionDays;
322322
@JsonKey(name: 'stream_post_policy')
323-
final StreamPostPolicy channelPostPolicy;
323+
final ChannelPostPolicy channelPostPolicy;
324324
// final bool isAnnouncementOnly; // deprecated for `channelPostPolicy`; ignore
325325

326326
// TODO(server-6): `canRemoveSubscribersGroupId` added in FL 142
@@ -359,19 +359,19 @@ class Channel {
359359
Map<String, dynamic> toJson() => _$ChannelToJson(this);
360360
}
361361

362-
/// Policy for which users can post to the stream.
362+
/// Policy for which users can post to the channel.
363363
///
364364
/// For docs, search for "stream_post_policy"
365365
/// in <https://zulip.com/api/get-stream-by-id>
366366
@JsonEnum(valueField: 'apiValue')
367-
enum StreamPostPolicy {
367+
enum ChannelPostPolicy {
368368
any(apiValue: 1),
369369
administrators(apiValue: 2),
370370
fullMembers(apiValue: 3),
371371
moderators(apiValue: 4),
372372
unknown(apiValue: null);
373373

374-
const StreamPostPolicy({
374+
const ChannelPostPolicy({
375375
required this.apiValue,
376376
});
377377

lib/api/model/model.g.dart

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

test/api/model/model_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void main() {
7878
'is_web_public': false,
7979
'history_public_to_subscribers': true,
8080
'message_retention_days': null,
81-
'stream_post_policy': StreamPostPolicy.any.apiValue,
81+
'stream_post_policy': ChannelPostPolicy.any.apiValue,
8282
// 'can_remove_subscribers_group': null,
8383
'stream_weekly_traffic': null,
8484
});

test/example_data.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Channel stream({
160160
bool? isWebPublic,
161161
bool? historyPublicToSubscribers,
162162
int? messageRetentionDays,
163-
StreamPostPolicy? channelPostPolicy,
163+
ChannelPostPolicy? channelPostPolicy,
164164
int? canRemoveSubscribersGroup,
165165
int? channelWeeklyTraffic,
166166
}) {
@@ -175,7 +175,7 @@ Channel stream({
175175
isWebPublic: isWebPublic ?? false,
176176
historyPublicToSubscribers: historyPublicToSubscribers ?? true,
177177
messageRetentionDays: messageRetentionDays,
178-
channelPostPolicy: channelPostPolicy ?? StreamPostPolicy.any,
178+
channelPostPolicy: channelPostPolicy ?? ChannelPostPolicy.any,
179179
canRemoveSubscribersGroup: canRemoveSubscribersGroup ?? 123,
180180
channelWeeklyTraffic: channelWeeklyTraffic,
181181
);

0 commit comments

Comments
 (0)