2024-11-16 16:55:31 +08:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'chat.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// JsonSerializableGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
|
|
_$SnChannelImpl _$$SnChannelImplFromJson(Map<String, dynamic> json) =>
|
|
|
|
_$SnChannelImpl(
|
|
|
|
id: (json['id'] as num).toInt(),
|
|
|
|
createdAt: DateTime.parse(json['created_at'] as String),
|
|
|
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
|
|
|
deletedAt: json['deleted_at'],
|
|
|
|
alias: json['alias'] as String,
|
|
|
|
name: json['name'] as String,
|
|
|
|
description: json['description'] as String,
|
2024-12-08 13:45:51 +08:00
|
|
|
members: (json['members'] as List<dynamic>?)
|
|
|
|
?.map((e) => SnChannelMember.fromJson(e as Map<String, dynamic>))
|
|
|
|
.toList(),
|
2024-11-17 01:16:54 +08:00
|
|
|
messages: (json['messages'] as List<dynamic>?)
|
|
|
|
?.map((e) => SnChatMessage.fromJson(e as Map<String, dynamic>))
|
|
|
|
.toList(),
|
2024-11-16 16:55:31 +08:00
|
|
|
type: (json['type'] as num).toInt(),
|
|
|
|
accountId: (json['account_id'] as num).toInt(),
|
|
|
|
realm: json['realm'] == null
|
|
|
|
? null
|
|
|
|
: SnRealm.fromJson(json['realm'] as Map<String, dynamic>),
|
|
|
|
realmId: (json['realm_id'] as num?)?.toInt(),
|
2024-11-16 21:15:55 +08:00
|
|
|
isPublic: json['is_public'] as bool,
|
|
|
|
isCommunity: json['is_community'] as bool,
|
2024-11-16 16:55:31 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$$SnChannelImplToJson(_$SnChannelImpl instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'id': instance.id,
|
|
|
|
'created_at': instance.createdAt.toIso8601String(),
|
|
|
|
'updated_at': instance.updatedAt.toIso8601String(),
|
|
|
|
'deleted_at': instance.deletedAt,
|
|
|
|
'alias': instance.alias,
|
|
|
|
'name': instance.name,
|
|
|
|
'description': instance.description,
|
2024-12-08 13:45:51 +08:00
|
|
|
'members': instance.members?.map((e) => e.toJson()).toList(),
|
2024-11-17 01:16:54 +08:00
|
|
|
'messages': instance.messages?.map((e) => e.toJson()).toList(),
|
2024-11-16 16:55:31 +08:00
|
|
|
'type': instance.type,
|
|
|
|
'account_id': instance.accountId,
|
|
|
|
'realm': instance.realm?.toJson(),
|
|
|
|
'realm_id': instance.realmId,
|
2024-11-16 21:15:55 +08:00
|
|
|
'is_public': instance.isPublic,
|
|
|
|
'is_community': instance.isCommunity,
|
2024-11-16 16:55:31 +08:00
|
|
|
};
|
2024-11-17 01:16:54 +08:00
|
|
|
|
|
|
|
_$SnChannelMemberImpl _$$SnChannelMemberImplFromJson(
|
|
|
|
Map<String, dynamic> json) =>
|
|
|
|
_$SnChannelMemberImpl(
|
|
|
|
id: (json['id'] as num).toInt(),
|
|
|
|
createdAt: DateTime.parse(json['created_at'] as String),
|
|
|
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
|
|
|
deletedAt: json['deleted_at'] == null
|
|
|
|
? null
|
|
|
|
: DateTime.parse(json['deleted_at'] as String),
|
|
|
|
channelId: (json['channel_id'] as num).toInt(),
|
|
|
|
accountId: (json['account_id'] as num).toInt(),
|
|
|
|
nick: json['nick'] as String?,
|
|
|
|
channel: json['channel'] == null
|
|
|
|
? null
|
|
|
|
: SnChannel.fromJson(json['channel'] as Map<String, dynamic>),
|
|
|
|
account: json['account'] == null
|
|
|
|
? null
|
|
|
|
: SnAccount.fromJson(json['account'] as Map<String, dynamic>),
|
|
|
|
notify: (json['notify'] as num?)?.toInt() ?? 0,
|
|
|
|
powerLevel: (json['power_level'] as num).toInt(),
|
|
|
|
calls: json['calls'],
|
|
|
|
events: json['events'],
|
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$$SnChannelMemberImplToJson(
|
|
|
|
_$SnChannelMemberImpl instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'id': instance.id,
|
|
|
|
'created_at': instance.createdAt.toIso8601String(),
|
|
|
|
'updated_at': instance.updatedAt.toIso8601String(),
|
|
|
|
'deleted_at': instance.deletedAt?.toIso8601String(),
|
|
|
|
'channel_id': instance.channelId,
|
|
|
|
'account_id': instance.accountId,
|
|
|
|
'nick': instance.nick,
|
|
|
|
'channel': instance.channel?.toJson(),
|
|
|
|
'account': instance.account?.toJson(),
|
|
|
|
'notify': instance.notify,
|
|
|
|
'power_level': instance.powerLevel,
|
|
|
|
'calls': instance.calls,
|
|
|
|
'events': instance.events,
|
|
|
|
};
|
|
|
|
|
|
|
|
_$SnChatMessageImpl _$$SnChatMessageImplFromJson(Map<String, dynamic> json) =>
|
|
|
|
_$SnChatMessageImpl(
|
|
|
|
id: (json['id'] as num).toInt(),
|
|
|
|
createdAt: DateTime.parse(json['created_at'] as String),
|
|
|
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
|
|
|
deletedAt: json['deleted_at'] == null
|
|
|
|
? null
|
|
|
|
: DateTime.parse(json['deleted_at'] as String),
|
|
|
|
uuid: json['uuid'] as String,
|
2024-11-18 23:59:08 +08:00
|
|
|
body: json['body'] as Map<String, dynamic>? ?? const {},
|
2024-11-17 01:16:54 +08:00
|
|
|
type: json['type'] as String,
|
|
|
|
channel: SnChannel.fromJson(json['channel'] as Map<String, dynamic>),
|
|
|
|
sender: SnChannelMember.fromJson(json['sender'] as Map<String, dynamic>),
|
|
|
|
channelId: (json['channel_id'] as num).toInt(),
|
|
|
|
senderId: (json['sender_id'] as num).toInt(),
|
2024-11-18 23:04:36 +08:00
|
|
|
quoteEventId: (json['quote_event_id'] as num?)?.toInt(),
|
2024-11-18 23:59:08 +08:00
|
|
|
relatedEventId: (json['related_event_id'] as num?)?.toInt(),
|
2024-11-18 00:55:39 +08:00
|
|
|
preload: json['preload'] == null
|
|
|
|
? null
|
|
|
|
: SnChatMessagePreload.fromJson(
|
|
|
|
json['preload'] as Map<String, dynamic>),
|
2024-11-17 01:16:54 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$$SnChatMessageImplToJson(_$SnChatMessageImpl instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'id': instance.id,
|
|
|
|
'created_at': instance.createdAt.toIso8601String(),
|
|
|
|
'updated_at': instance.updatedAt.toIso8601String(),
|
|
|
|
'deleted_at': instance.deletedAt?.toIso8601String(),
|
|
|
|
'uuid': instance.uuid,
|
|
|
|
'body': instance.body,
|
|
|
|
'type': instance.type,
|
|
|
|
'channel': instance.channel.toJson(),
|
|
|
|
'sender': instance.sender.toJson(),
|
|
|
|
'channel_id': instance.channelId,
|
|
|
|
'sender_id': instance.senderId,
|
2024-11-18 23:04:36 +08:00
|
|
|
'quote_event_id': instance.quoteEventId,
|
2024-11-18 23:59:08 +08:00
|
|
|
'related_event_id': instance.relatedEventId,
|
2024-11-18 00:55:39 +08:00
|
|
|
'preload': instance.preload?.toJson(),
|
|
|
|
};
|
|
|
|
|
|
|
|
_$SnChatMessagePreloadImpl _$$SnChatMessagePreloadImplFromJson(
|
|
|
|
Map<String, dynamic> json) =>
|
|
|
|
_$SnChatMessagePreloadImpl(
|
|
|
|
attachments: (json['attachments'] as List<dynamic>?)
|
|
|
|
?.map((e) => e == null
|
|
|
|
? null
|
|
|
|
: SnAttachment.fromJson(e as Map<String, dynamic>))
|
|
|
|
.toList(),
|
2024-11-18 22:33:03 +08:00
|
|
|
quoteEvent: json['quote_event'] == null
|
|
|
|
? null
|
|
|
|
: SnChatMessage.fromJson(json['quote_event'] as Map<String, dynamic>),
|
2024-11-18 00:55:39 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$$SnChatMessagePreloadImplToJson(
|
|
|
|
_$SnChatMessagePreloadImpl instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'attachments': instance.attachments?.map((e) => e?.toJson()).toList(),
|
2024-11-18 22:33:03 +08:00
|
|
|
'quote_event': instance.quoteEvent?.toJson(),
|
2024-11-17 01:16:54 +08:00
|
|
|
};
|
2024-11-24 20:23:06 +08:00
|
|
|
|
|
|
|
_$SnChatCallImpl _$$SnChatCallImplFromJson(Map<String, dynamic> json) =>
|
|
|
|
_$SnChatCallImpl(
|
|
|
|
id: (json['id'] as num).toInt(),
|
|
|
|
createdAt: DateTime.parse(json['created_at'] as String),
|
|
|
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
|
|
|
deletedAt: json['deleted_at'] == null
|
|
|
|
? null
|
|
|
|
: DateTime.parse(json['deleted_at'] as String),
|
|
|
|
endedAt: json['ended_at'] == null
|
|
|
|
? null
|
|
|
|
: DateTime.parse(json['ended_at'] as String),
|
|
|
|
externalId: json['external_id'] as String,
|
|
|
|
founderId: (json['founder_id'] as num).toInt(),
|
|
|
|
channelId: (json['channel_id'] as num).toInt(),
|
|
|
|
founder:
|
|
|
|
SnChannelMember.fromJson(json['founder'] as Map<String, dynamic>),
|
|
|
|
participants: json['participants'] as List<dynamic>? ?? const [],
|
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$$SnChatCallImplToJson(_$SnChatCallImpl instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'id': instance.id,
|
|
|
|
'created_at': instance.createdAt.toIso8601String(),
|
|
|
|
'updated_at': instance.updatedAt.toIso8601String(),
|
|
|
|
'deleted_at': instance.deletedAt?.toIso8601String(),
|
|
|
|
'ended_at': instance.endedAt?.toIso8601String(),
|
|
|
|
'external_id': instance.externalId,
|
|
|
|
'founder_id': instance.founderId,
|
|
|
|
'channel_id': instance.channelId,
|
|
|
|
'founder': instance.founder.toJson(),
|
|
|
|
'participants': instance.participants,
|
|
|
|
};
|