// Autogenerated from Pigeon (v11.0.1), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; enum NotificationIcon { warning, error, none, } enum NotificationEventType { markAsRead, reply, open, } enum NotificationChannelImportance { MIN, HIGH, DEFAULT, } class NotificationMessageContent { NotificationMessageContent({ this.body, this.mime, this.path, }); /// The textual body of the message. String? body; /// The path and mime type of the media to show. String? mime; String? path; Object encode() { return [ body, mime, path, ]; } static NotificationMessageContent decode(Object result) { result as List; return NotificationMessageContent( body: result[0] as String?, mime: result[1] as String?, path: result[2] as String?, ); } } class NotificationMessage { NotificationMessage({ this.groupId, this.sender, this.jid, required this.content, required this.timestamp, this.avatarPath, }); /// The grouping key for the notification. String? groupId; /// The sender of the message. String? sender; /// The jid of the sender. String? jid; /// The body of the message. NotificationMessageContent content; /// Milliseconds since epoch. int timestamp; /// The path to the avatar to use String? avatarPath; Object encode() { return [ groupId, sender, jid, content.encode(), timestamp, avatarPath, ]; } static NotificationMessage decode(Object result) { result as List; return NotificationMessage( groupId: result[0] as String?, sender: result[1] as String?, jid: result[2] as String?, content: NotificationMessageContent.decode(result[3]! as List), timestamp: result[4]! as int, avatarPath: result[5] as String?, ); } } class MessagingNotification { MessagingNotification({ required this.title, required this.id, required this.channelId, required this.jid, required this.messages, required this.isGroupchat, this.groupId, this.extra, }); /// The title of the conversation. String title; /// The id of the notification. int id; /// The id of the notification channel the notification should appear on. String channelId; /// The JID of the chat in which the notifications happen. String jid; /// Messages to show. List messages; /// Flag indicating whether this notification is from a groupchat or not. bool isGroupchat; /// The id for notification grouping. String? groupId; /// Additional data to include. Map? extra; Object encode() { return [ title, id, channelId, jid, messages, isGroupchat, groupId, extra, ]; } static MessagingNotification decode(Object result) { result as List; return MessagingNotification( title: result[0]! as String, id: result[1]! as int, channelId: result[2]! as String, jid: result[3]! as String, messages: (result[4] as List?)!.cast(), isGroupchat: result[5]! as bool, groupId: result[6] as String?, extra: (result[7] as Map?)?.cast(), ); } } class RegularNotification { RegularNotification({ required this.title, required this.body, required this.channelId, this.groupId, required this.id, required this.icon, }); /// The title of the notification. String title; /// The body of the notification. String body; /// The id of the channel to show the notification on. String channelId; /// The id for notification grouping. String? groupId; /// The id of the notification. int id; /// The icon to use. NotificationIcon icon; Object encode() { return [ title, body, channelId, groupId, id, icon.index, ]; } static RegularNotification decode(Object result) { result as List; return RegularNotification( title: result[0]! as String, body: result[1]! as String, channelId: result[2]! as String, groupId: result[3] as String?, id: result[4]! as int, icon: NotificationIcon.values[result[5]! as int], ); } } class NotificationEvent { NotificationEvent({ required this.id, required this.jid, required this.type, this.payload, this.extra, }); /// The notification id. int id; /// The JID the notification was for. String jid; /// The type of event. NotificationEventType type; /// An optional payload. /// - type == NotificationType.reply: The reply message text. /// Otherwise: undefined. String? payload; /// Extra data. Only set when type == NotificationType.reply. Map? extra; Object encode() { return [ id, jid, type.index, payload, extra, ]; } static NotificationEvent decode(Object result) { result as List; return NotificationEvent( id: result[0]! as int, jid: result[1]! as String, type: NotificationEventType.values[result[2]! as int], payload: result[3] as String?, extra: (result[4] as Map?)?.cast(), ); } } class NotificationI18nData { NotificationI18nData({ required this.reply, required this.markAsRead, required this.you, }); /// The content of the reply button. String reply; /// The content of the "mark as read" button. String markAsRead; /// The text to show when *you* reply. String you; Object encode() { return [ reply, markAsRead, you, ]; } static NotificationI18nData decode(Object result) { result as List; return NotificationI18nData( reply: result[0]! as String, markAsRead: result[1]! as String, you: result[2]! as String, ); } } class NotificationGroup { NotificationGroup({ required this.id, required this.description, }); String id; String description; Object encode() { return [ id, description, ]; } static NotificationGroup decode(Object result) { result as List; return NotificationGroup( id: result[0]! as String, description: result[1]! as String, ); } } class NotificationChannel { NotificationChannel({ required this.title, required this.description, required this.id, required this.importance, required this.showBadge, this.groupId, required this.vibration, required this.enableLights, }); String title; String description; String id; NotificationChannelImportance importance; bool showBadge; String? groupId; bool vibration; bool enableLights; Object encode() { return [ title, description, id, importance.index, showBadge, groupId, vibration, enableLights, ]; } static NotificationChannel decode(Object result) { result as List; return NotificationChannel( title: result[0]! as String, description: result[1]! as String, id: result[2]! as String, importance: NotificationChannelImportance.values[result[3]! as int], showBadge: result[4]! as bool, groupId: result[5] as String?, vibration: result[6]! as bool, enableLights: result[7]! as bool, ); } } class _MoxxyNotificationsApiCodec extends StandardMessageCodec { const _MoxxyNotificationsApiCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { if (value is MessagingNotification) { buffer.putUint8(128); writeValue(buffer, value.encode()); } else if (value is NotificationChannel) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is NotificationEvent) { buffer.putUint8(130); writeValue(buffer, value.encode()); } else if (value is NotificationGroup) { buffer.putUint8(131); writeValue(buffer, value.encode()); } else if (value is NotificationI18nData) { buffer.putUint8(132); writeValue(buffer, value.encode()); } else if (value is NotificationMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); } else if (value is NotificationMessageContent) { buffer.putUint8(134); writeValue(buffer, value.encode()); } else if (value is RegularNotification) { buffer.putUint8(135); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } } @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 128: return MessagingNotification.decode(readValue(buffer)!); case 129: return NotificationChannel.decode(readValue(buffer)!); case 130: return NotificationEvent.decode(readValue(buffer)!); case 131: return NotificationGroup.decode(readValue(buffer)!); case 132: return NotificationI18nData.decode(readValue(buffer)!); case 133: return NotificationMessage.decode(readValue(buffer)!); case 134: return NotificationMessageContent.decode(readValue(buffer)!); case 135: return RegularNotification.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } } } class MoxxyNotificationsApi { /// Constructor for [MoxxyNotificationsApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. MoxxyNotificationsApi({BinaryMessenger? binaryMessenger}) : _binaryMessenger = binaryMessenger; final BinaryMessenger? _binaryMessenger; static const MessageCodec codec = _MoxxyNotificationsApiCodec(); /// Notification APIs Future createNotificationGroups( List arg_groups) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.createNotificationGroups', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_groups]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future deleteNotificationGroups(List arg_ids) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.deleteNotificationGroups', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_ids]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future createNotificationChannels( List arg_channels) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.createNotificationChannels', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_channels]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future deleteNotificationChannels(List arg_ids) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.deleteNotificationChannels', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_ids]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future showMessagingNotification( MessagingNotification arg_notification) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.showMessagingNotification', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_notification]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future showNotification(RegularNotification arg_notification) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.showNotification', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_notification]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future dismissNotification(int arg_id) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.dismissNotification', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_id]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future setNotificationSelfAvatar(String arg_path) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.setNotificationSelfAvatar', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_path]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future setNotificationI18n(NotificationI18nData arg_data) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.setNotificationI18n', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_data]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } Future notificationStub(NotificationEvent arg_event) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyNotificationsApi.notificationStub', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_event]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return; } } }