Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for status and type fields in AppContext APIs #130

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pubnub/lib/src/crypto/encryption_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ extension EncryptionModeExtension on EncryptionMode {
return AESMode.cbc;
case EncryptionMode.ECB:
return AESMode.ecb;
default:
throw Exception('Unreachable state');
}
}
}
4 changes: 0 additions & 4 deletions pubnub/lib/src/dx/_endpoints/push.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ extension EnvironmentExtension on Environment {
return 'development';
case Environment.production:
return 'production';
default:
throw Exception('Invalid Gateway Type');
}
}
}
Expand All @@ -43,8 +41,6 @@ extension PushGatewayExtension on PushGateway {
return 'apns';
case PushGateway.apns2:
return 'apns2';
default:
throw Exception('Invalid Gateway Type');
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions pubnub/lib/src/dx/channel/channel_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ extension ChannelHistoryOrderExtension on ChannelHistoryOrder {
return descending;
case ChannelHistoryOrder.ascending:
return ascending;
default:
throw Exception('Unreachable state');
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions pubnub/lib/src/dx/objects/channel_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ class ChannelMetadata {
/// To include `uuid` metadata fields of channel's memebrs in response, set [includeUUIDFields] to `true`
/// To include `custom` fields of channel member's uuidMetadata, set [includeUUIDCustomFields] to `true`
///
/// To omit `status` field from member metadata, set [includeStatus] to `false`
/// Default is `true`.
///
/// To omit `type` field from member metadata, set [includeType] to `false`
/// Default is `true`.
///
/// To get `status` field of UUID metadata, set [includeUUIDStatus] to `true`
/// Default is `false`.
///
/// To omit `type` field of UUID metadata, set [includeUUIDType] to `true`
/// Default is `false`.
///
/// Use [limit] to specify Number of objects to return in response.
/// Default is 100, which is also the maximum value.
///
Expand All @@ -41,6 +53,10 @@ class ChannelMetadata {
bool? includeUUIDFields,
bool? includeUUIDCustomFields,
bool? includeCount,
bool includeUUIDStatus = false,
bool includeUUIDType = false,
bool includeStatus = true,
bool includeType = true,
String? filter,
Set<String>? sort}) =>
_objects.setChannelMembers(_id, channelMembersMetadata,
Expand All @@ -50,6 +66,10 @@ class ChannelMetadata {
includeCustomFields: includeCustomFields,
includeUUIDFields: includeUUIDFields,
includeUUIDCustomFields: includeUUIDCustomFields,
includeUUIDStatus: includeUUIDStatus,
includeUUIDType: includeUUIDType,
includeStatus: includeStatus,
includeType: includeType,
includeCount: includeCount,
filter: filter,
sort: sort);
Expand All @@ -61,6 +81,18 @@ class ChannelMetadata {
/// To include `uuid` metadata fields of channel's memebrs in response, set [includeUUIDFields] to `true`
/// To include `custom` fields of channel member's uuidMetadata, set [includeUUIDCustomFields] to `true`
///
/// To omit `status` field from member metadata, set [includeStatus] to `false`
/// Default is `true`.
///
/// To omit `type` field from member metadata, set [includeType] to `false`
/// Default is `true`.
///
/// To get `status` field of UUID metadata, set [includeUUIDStatus] to `true`
/// Default is `false`.
///
/// To omit `type` field of UUID metadata, set [includeUUIDType] to `true`
/// Default is `false`.
///
/// Use [limit] to specify Number of objects to return in response.
/// Default is 100, which is also the maximum value.
///
Expand All @@ -84,6 +116,10 @@ class ChannelMetadata {
bool? includeUUIDFields,
bool? includeUUIDCustomFields,
bool? includeCount,
bool includeUUIDStatus = false,
bool includeUUIDType = false,
bool includeStatus = true,
bool includeType = true,
String? filter,
Set<String>? sort}) =>
_objects.removeChannelMembers(_id, uuids,
Expand All @@ -94,6 +130,10 @@ class ChannelMetadata {
includeCustomFields: includeCustomFields,
includeUUIDFields: includeUUIDFields,
includeUUIDCustomFields: includeUUIDCustomFields,
includeUUIDStatus: includeUUIDStatus,
includeUUIDType: includeUUIDType,
includeStatus: includeStatus,
includeType: includeType,
includeCount: includeCount,
filter: filter,
sort: sort);
Expand Down
Loading