// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'get_room_response.dart';

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

GetRoomResponse _$GetRoomResponseFromJson(Map<String, dynamic> json) =>
    GetRoomResponse(
        (json['data'] as List<dynamic>)
            .map(
              (e) => GetRoomResponseObject.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> _$GetRoomResponseToJson(GetRoomResponse instance) =>
    <String, dynamic>{
      'headers': ?instance.headers,
      'data': instance.data.map((e) => e.toJson()).toList(),
    };

GetRoomResponseObject _$GetRoomResponseObjectFromJson(
  Map<String, dynamic> json,
) => GetRoomResponseObject(
  (json['id'] as num).toInt(),
  json['token'] as String,
  $enumDecode(_$GetRoomResponseObjectConversationTypeEnumMap, json['type']),
  json['name'] as String,
  json['displayName'] as String,
  json['description'] as String,
  (json['participantType'] as num).toInt(),
  (json['participantFlags'] as num).toInt(),
  (json['readOnly'] as num).toInt(),
  (json['listable'] as num).toInt(),
  (json['lastPing'] as num).toInt(),
  json['sessionId'] as String,
  json['hasPassword'] as bool,
  json['hasCall'] as bool,
  (json['callFlag'] as num).toInt(),
  json['canStartCall'] as bool,
  json['canDeleteConversation'] as bool,
  json['canLeaveConversation'] as bool,
  (json['lastActivity'] as num).toInt(),
  json['isFavorite'] as bool,
  $enumDecode(
    _$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
    json['notificationLevel'],
  ),
  (json['unreadMessages'] as num).toInt(),
  json['unreadMention'] as bool,
  json['unreadMentionDirect'] as bool,
  (json['lastReadMessage'] as num).toInt(),
  (json['lastCommonReadMessage'] as num).toInt(),
  GetChatResponseObject.fromJson(json['lastMessage'] as Map<String, dynamic>),
  json['status'] as String?,
  json['statusIcon'] as String?,
  json['statusMessage'] as String?,
);

Map<String, dynamic> _$GetRoomResponseObjectToJson(
  GetRoomResponseObject instance,
) => <String, dynamic>{
  'id': instance.id,
  'token': instance.token,
  'type': _$GetRoomResponseObjectConversationTypeEnumMap[instance.type]!,
  'name': instance.name,
  'displayName': instance.displayName,
  'description': instance.description,
  'participantType': instance.participantType,
  'participantFlags': instance.participantFlags,
  'readOnly': instance.readOnly,
  'listable': instance.listable,
  'lastPing': instance.lastPing,
  'sessionId': instance.sessionId,
  'hasPassword': instance.hasPassword,
  'hasCall': instance.hasCall,
  'callFlag': instance.callFlag,
  'canStartCall': instance.canStartCall,
  'canDeleteConversation': instance.canDeleteConversation,
  'canLeaveConversation': instance.canLeaveConversation,
  'lastActivity': instance.lastActivity,
  'isFavorite': instance.isFavorite,
  'notificationLevel':
      _$GetRoomResponseObjectParticipantNotificationLevelEnumMap[instance
          .notificationLevel]!,
  'unreadMessages': instance.unreadMessages,
  'unreadMention': instance.unreadMention,
  'unreadMentionDirect': instance.unreadMentionDirect,
  'lastReadMessage': instance.lastReadMessage,
  'lastCommonReadMessage': instance.lastCommonReadMessage,
  'lastMessage': instance.lastMessage.toJson(),
  'status': instance.status,
  'statusIcon': instance.statusIcon,
  'statusMessage': instance.statusMessage,
};

const _$GetRoomResponseObjectConversationTypeEnumMap = {
  GetRoomResponseObjectConversationType.oneToOne: 1,
  GetRoomResponseObjectConversationType.group: 2,
  GetRoomResponseObjectConversationType.public: 3,
  GetRoomResponseObjectConversationType.changelog: 4,
  GetRoomResponseObjectConversationType.deleted: 5,
  GetRoomResponseObjectConversationType.noteToSelf: 6,
};

const _$GetRoomResponseObjectParticipantNotificationLevelEnumMap = {
  GetRoomResponseObjectParticipantNotificationLevel.defaultLevel: 0,
  GetRoomResponseObjectParticipantNotificationLevel.alwaysNotify: 1,
  GetRoomResponseObjectParticipantNotificationLevel.notifyOnMention: 2,
  GetRoomResponseObjectParticipantNotificationLevel.neverNotify: 3,
};
