// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'get_chat_response.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

GetChatResponse _$GetChatResponseFromJson(Map<String, dynamic> json) =>
    GetChatResponse(
        (json['data'] as List<dynamic>)
            .map(
              (e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>),
            )
            .toSet(),
      )
      ..headers = (json['headers'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(k, e as String),
      );

Map<String, dynamic> _$GetChatResponseToJson(GetChatResponse instance) =>
    <String, dynamic>{
      'headers': ?instance.headers,
      'data': instance.data.map((e) => e.toJson()).toList(),
    };

GetChatResponseObject _$GetChatResponseObjectFromJson(
  Map<String, dynamic> json,
) => GetChatResponseObject(
  (json['id'] as num).toInt(),
  json['token'] as String,
  $enumDecode(
    _$GetRoomResponseObjectMessageActorTypeEnumMap,
    json['actorType'],
  ),
  json['actorId'] as String,
  json['actorDisplayName'] as String,
  (json['timestamp'] as num).toInt(),
  json['systemMessage'] as String,
  $enumDecode(_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
  json['isReplyable'] as bool,
  json['referenceId'] as String,
  json['message'] as String,
  _fromJson(json['messageParameters']),
  (json['reactions'] as Map<String, dynamic>?)?.map(
    (k, e) => MapEntry(k, (e as num).toInt()),
  ),
  (json['reactionsSelf'] as List<dynamic>?)?.map((e) => e as String).toList(),
  json['parent'] == null
      ? null
      : GetChatResponseObject.fromJson(json['parent'] as Map<String, dynamic>),
  json['markdown'] as bool? ?? false,
);

Map<String, dynamic> _$GetChatResponseObjectToJson(
  GetChatResponseObject instance,
) => <String, dynamic>{
  'id': instance.id,
  'token': instance.token,
  'actorType':
      _$GetRoomResponseObjectMessageActorTypeEnumMap[instance.actorType]!,
  'actorId': instance.actorId,
  'actorDisplayName': instance.actorDisplayName,
  'timestamp': instance.timestamp,
  'systemMessage': instance.systemMessage,
  'messageType':
      _$GetRoomResponseObjectMessageTypeEnumMap[instance.messageType]!,
  'isReplyable': instance.isReplyable,
  'referenceId': instance.referenceId,
  'message': instance.message,
  'reactions': instance.reactions,
  'reactionsSelf': instance.reactionsSelf,
  'messageParameters': instance.messageParameters?.map(
    (k, e) => MapEntry(k, e.toJson()),
  ),
  'parent': instance.parent?.toJson(),
  'markdown': instance.markdown,
};

const _$GetRoomResponseObjectMessageActorTypeEnumMap = {
  GetRoomResponseObjectMessageActorType.deletedUsers: 'deleted_users',
  GetRoomResponseObjectMessageActorType.user: 'users',
  GetRoomResponseObjectMessageActorType.guest: 'guests',
  GetRoomResponseObjectMessageActorType.bot: 'bots',
  GetRoomResponseObjectMessageActorType.bridge: 'bridged',
};

const _$GetRoomResponseObjectMessageTypeEnumMap = {
  GetRoomResponseObjectMessageType.comment: 'comment',
  GetRoomResponseObjectMessageType.voiceMessage: 'voice-message',
  GetRoomResponseObjectMessageType.deletedComment: 'comment_deleted',
  GetRoomResponseObjectMessageType.system: 'system',
  GetRoomResponseObjectMessageType.command: 'command',
};

RichObjectString _$RichObjectStringFromJson(Map<String, dynamic> json) =>
    RichObjectString(
      $enumDecode(_$RichObjectStringObjectTypeEnumMap, json['type']),
      json['id'] as String,
      json['name'] as String,
      json['path'] as String?,
      json['link'] as String?,
    );

Map<String, dynamic> _$RichObjectStringToJson(RichObjectString instance) =>
    <String, dynamic>{
      'type': _$RichObjectStringObjectTypeEnumMap[instance.type]!,
      'id': instance.id,
      'name': instance.name,
      'path': instance.path,
      'link': instance.link,
    };

const _$RichObjectStringObjectTypeEnumMap = {
  RichObjectStringObjectType.user: 'user',
  RichObjectStringObjectType.group: 'group',
  RichObjectStringObjectType.file: 'file',
  RichObjectStringObjectType.guest: 'guest',
  RichObjectStringObjectType.highlight: 'highlight',
  RichObjectStringObjectType.talkPoll: 'talk-poll',
  RichObjectStringObjectType.geoLocation: 'geo-location',
  RichObjectStringObjectType.call: 'call',
};
