import 'package:yumi/shared/business_logic/models/res/room_res.dart';

import 'package:yumi/shared/business_logic/models/res/login_res.dart';

/// entrants : {"level":{"charmLevel":0,"userId":0,"wealthLevel":0},"nobleVipAbility":[""],"roles":"","roomToken":""}
/// roomProfile : {"regionCode":"","roomCounter":{"adminCount":0,"memberCount":0},"roomProfile":{"activeTime":0,"countryCode":"","countryName":"","createTime":0,"del":false,"event":"","id":"0","langCode":"","nationalFlag":"","roomAccount":"","roomCover":"","roomDesc":"","roomName":"","sysOrigin":"","updateTime":0,"userId":"0"},"roomSetting":{"adminLockSeat":false,"allowMusic":false,"joinGolds":0,"lockLocation":"","maxAdmin":0,"maxMember":0,"mikeSize":0,"openKtvMode":false,"password":"","roomId":0,"roomSpecialMikeType":"","showHeartbeat":false,"takeMicRole":"","touristMike":false,"touristMsg":false,"userId":"0"},"userProfile":{"account":"","accountStatus":"","age":0,"bornDay":0,"bornMonth":0,"bornYear":0,"countryCode":"","countryId":0,"countryName":"","createTime":0,"del":false,"freezingTime":0,"id":"0","originSys":"","ownSpecialId":{"account":"","expiredTime":0},"sameRegion":false,"sysOriginChild":"","useProps":[{"expireTime":0,"propsResources":{"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""},"userId":0}],"userAvatar":"","userNickname":"","userSex":0,"wearBadge":[{"animationUrl":"","badgeKey":"","badgeLevel":0,"badgeName":"","expireTime":0,"id":0,"milestone":0,"notSelectUrl":"","selectUrl":"","type":"","userId":0}]}}
/// roomProps : {"layoutCode":"","roomTheme":{"expireTime":0,"id":0,"themeBack":"","themeStatus":"","useTheme":false}}

class JoinRoomRes {
  JoinRoomRes({
    Entrants? entrants,
    RoomProfile? roomProfile,
    RoomProps? roomProps,
  }) {
    _entrants = entrants;
    _roomProfile = roomProfile;
    _roomProps = roomProps;
  }

  JoinRoomRes.fromJson(dynamic json) {
    _entrants =
        json['entrants'] != null ? Entrants.fromJson(json['entrants']) : null;
    _roomProfile =
        json['roomProfile'] != null
            ? RoomProfile.fromJson(json['roomProfile'])
            : null;
    _roomProps =
        json['roomProps'] != null
            ? RoomProps.fromJson(json['roomProps'])
            : null;
  }

  Entrants? _entrants;
  RoomProfile? _roomProfile;
  RoomProps? _roomProps;

  JoinRoomRes copyWith({
    Entrants? entrants,
    RoomProfile? roomProfile,
    RoomProps? roomProps,
  }) => JoinRoomRes(
    entrants: entrants ?? _entrants,
    roomProfile: roomProfile ?? _roomProfile,
    roomProps: roomProps ?? _roomProps,
  );

  Entrants? get entrants => _entrants;

  RoomProfile? get roomProfile => _roomProfile;

  RoomProps? get roomProps => _roomProps;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    if (_entrants != null) {
      map['entrants'] = _entrants?.toJson();
    }
    if (_roomProfile != null) {
      map['roomProfile'] = _roomProfile?.toJson();
    }
    if (_roomProps != null) {
      map['roomProps'] = _roomProps?.toJson();
    }
    return map;
  }
}

/// layoutCode : ""
/// roomTheme : {"expireTime":0,"id":0,"themeBack":"","themeStatus":"","useTheme":false}

class RoomProps {
  RoomProps({String? layoutCode, RoomTheme? roomTheme}) {
    _layoutCode = layoutCode;
    _roomTheme = roomTheme;
  }

  RoomProps.fromJson(dynamic json) {
    _layoutCode = json['layoutCode'];
    _roomTheme =
        json['roomTheme'] != null
            ? RoomTheme.fromJson(json['roomTheme'])
            : null;
  }

  String? _layoutCode;
  RoomTheme? _roomTheme;

  RoomProps copyWith({String? layoutCode, RoomTheme? roomTheme}) => RoomProps(
    layoutCode: layoutCode ?? _layoutCode,
    roomTheme: roomTheme ?? _roomTheme,
  );

  String? get layoutCode => _layoutCode;

  RoomTheme? get roomTheme => _roomTheme;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['layoutCode'] = _layoutCode;
    if (_roomTheme != null) {
      map['roomTheme'] = _roomTheme?.toJson();
    }
    return map;
  }

  void setRoomTheme(RoomTheme? roomTheme) {
    _roomTheme = roomTheme;
  }
}

/// expireTime : 0
/// id : 0
/// themeBack : ""
/// themeStatus : ""
/// useTheme : false

class RoomTheme {
  RoomTheme({
    int? expireTime,
    String? id,
    String? themeBack,
    String? themeStatus,
    bool? useTheme,
  }) {
    _expireTime = expireTime;
    _id = id;
    _themeBack = themeBack;
    _themeStatus = themeStatus;
    _useTheme = useTheme;
  }

  RoomTheme.fromJson(dynamic json) {
    _expireTime = json['expireTime'];
    _id = json['id'];
    _themeBack = json['themeBack'];
    _themeStatus = json['themeStatus'];
    _useTheme = json['useTheme'];
  }

  int? _expireTime;
  String? _id;
  String? _themeBack;
  String? _themeStatus;
  bool? _useTheme;

  RoomTheme copyWith({
    int? expireTime,
    String? id,
    String? themeBack,
    String? themeStatus,
    bool? useTheme,
  }) => RoomTheme(
    expireTime: expireTime ?? _expireTime,
    id: id ?? _id,
    themeBack: themeBack ?? _themeBack,
    themeStatus: themeStatus ?? _themeStatus,
    useTheme: useTheme ?? _useTheme,
  );

  int? get expireTime => _expireTime;

  String? get id => _id;

  String? get themeBack => _themeBack;

  String? get themeStatus => _themeStatus;

  bool? get useTheme => _useTheme;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['expireTime'] = _expireTime;
    map['id'] = _id;
    map['themeBack'] = _themeBack;
    map['themeStatus'] = _themeStatus;
    map['useTheme'] = _useTheme;
    return map;
  }
}

/// regionCode : ""
/// roomCounter : {"adminCount":0,"memberCount":0}
/// roomProfile : {"activeTime":0,"countryCode":"","countryName":"","createTime":0,"del":false,"event":"","id":"0","langCode":"","nationalFlag":"","roomAccount":"","roomCover":"","roomDesc":"","roomName":"","sysOrigin":"","updateTime":0,"userId":"0"}
/// roomSetting : {"adminLockSeat":false,"allowMusic":false,"joinGolds":0,"lockLocation":"","maxAdmin":0,"maxMember":0,"mikeSize":0,"openKtvMode":false,"password":"","roomId":0,"roomSpecialMikeType":"","showHeartbeat":false,"takeMicRole":"","touristMike":false,"touristMsg":false,"userId":"0"}
/// userProfile : {"account":"","accountStatus":"","age":0,"bornDay":0,"bornMonth":0,"bornYear":0,"countryCode":"","countryId":0,"countryName":"","createTime":0,"del":false,"freezingTime":0,"id":"0","originSys":"","ownSpecialId":{"account":"","expiredTime":0},"sameRegion":false,"sysOriginChild":"","useProps":[{"expireTime":0,"propsResources":{"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""},"userId":0}],"userAvatar":"","userNickname":"","userSex":0,"wearBadge":[{"animationUrl":"","badgeKey":"","badgeLevel":0,"badgeName":"","expireTime":0,"id":0,"milestone":0,"notSelectUrl":"","selectUrl":"","type":"","userId":0}]}

class RoomProfile {
  RoomProfile({
    String? regionCode,
    RoomCounter? roomCounter,
    RoomProfile2? roomProfile,
    RoomSetting? roomSetting,
    SocialChatUserProfile? userProfile,
  }) {
    _regionCode = regionCode;
    _roomCounter = roomCounter;
    _roomProfile = roomProfile;
    _roomSetting = roomSetting;
    _userProfile = userProfile;
  }

  RoomProfile.fromJson(dynamic json) {
    _regionCode = json['regionCode'];
    _roomCounter =
        json['roomCounter'] != null
            ? RoomCounter.fromJson(json['roomCounter'])
            : null;
    _roomProfile =
        json['roomProfile'] != null
            ? RoomProfile2.fromJson(json['roomProfile'])
            : null;
    _roomSetting =
        json['roomSetting'] != null
            ? RoomSetting.fromJson(json['roomSetting'])
            : null;
    _userProfile =
        json['userProfile'] != null
            ? SocialChatUserProfile.fromJson(json['userProfile'])
            : null;
  }

  String? _regionCode;
  RoomCounter? _roomCounter;
  RoomProfile2? _roomProfile;
  RoomSetting? _roomSetting;
  SocialChatUserProfile? _userProfile;

  RoomProfile copyWith({
    String? regionCode,
    RoomCounter? roomCounter,
    RoomProfile2? roomProfile,
    RoomSetting? roomSetting,
    SocialChatUserProfile? userProfile,
  }) => RoomProfile(
    regionCode: regionCode ?? _regionCode,
    roomCounter: roomCounter ?? _roomCounter,
    roomProfile: roomProfile ?? _roomProfile,
    roomSetting: roomSetting ?? _roomSetting,
    userProfile: userProfile ?? _userProfile,
  );

  String? get regionCode => _regionCode;

  RoomCounter? get roomCounter => _roomCounter;

  RoomProfile2? get roomProfile => _roomProfile;

  RoomSetting? get roomSetting => _roomSetting;

  SocialChatUserProfile? get userProfile => _userProfile;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['regionCode'] = _regionCode;
    if (_roomCounter != null) {
      map['roomCounter'] = _roomCounter?.toJson();
    }
    if (_roomProfile != null) {
      map['roomProfile'] = _roomProfile?.toJson();
    }
    if (_roomSetting != null) {
      map['roomSetting'] = _roomSetting?.toJson();
    }
    if (_userProfile != null) {
      map['userProfile'] = _userProfile?.toJson();
    }
    return map;
  }

  void setRoomSetting(RoomSetting roomSetting) {
    _roomSetting = roomSetting;
  }
}

/// account : ""
/// accountStatus : ""
/// age : 0
/// bornDay : 0
/// bornMonth : 0
/// bornYear : 0
/// countryCode : ""
/// countryId : 0
/// countryName : ""
/// createTime : 0
/// del : false
/// freezingTime : 0
/// id : "0"
/// originSys : ""
/// ownSpecialId : {"account":"","expiredTime":0}
/// sameRegion : false
/// sysOriginChild : ""
/// useProps : [{"expireTime":0,"propsResources":{"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""},"userId":0}]
/// userAvatar : ""
/// userNickname : ""
/// userSex : 0
/// wearBadge : [{"animationUrl":"","badgeKey":"","badgeLevel":0,"badgeName":"","expireTime":0,"id":0,"milestone":0,"notSelectUrl":"","selectUrl":"","type":"","userId":0}]

/// animationUrl : ""
/// badgeKey : ""
/// badgeLevel : 0
/// badgeName : ""
/// expireTime : 0
/// id : 0
/// milestone : 0
/// notSelectUrl : ""
/// selectUrl : ""
/// type : ""
/// userId : 0

class WearBadge {
  WearBadge({
    String? animationUrl,
    String? badgeKey,
    num? badgeLevel,
    String? badgeName,
    num? expireTime,
    num? id,
    num? milestone,
    String? notSelectUrl,
    String? selectUrl,
    String? type,
    num? userId,
  }) {
    _animationUrl = animationUrl;
    _badgeKey = badgeKey;
    _badgeLevel = badgeLevel;
    _badgeName = badgeName;
    _expireTime = expireTime;
    _id = id;
    _milestone = milestone;
    _notSelectUrl = notSelectUrl;
    _selectUrl = selectUrl;
    _type = type;
    _userId = userId;
  }

  WearBadge.fromJson(dynamic json) {
    _animationUrl = json['animationUrl'];
    _badgeKey = json['badgeKey'];
    _badgeLevel = json['badgeLevel'];
    _badgeName = json['badgeName'];
    _expireTime = json['expireTime'];
    _id = json['id'];
    _milestone = json['milestone'];
    _notSelectUrl = json['notSelectUrl'];
    _selectUrl = json['selectUrl'];
    _type = json['type'];
    _userId = json['userId'];
  }

  String? _animationUrl;
  String? _badgeKey;
  num? _badgeLevel;
  String? _badgeName;
  num? _expireTime;
  num? _id;
  num? _milestone;
  String? _notSelectUrl;
  String? _selectUrl;
  String? _type;
  num? _userId;

  WearBadge copyWith({
    String? animationUrl,
    String? badgeKey,
    num? badgeLevel,
    String? badgeName,
    num? expireTime,
    num? id,
    num? milestone,
    String? notSelectUrl,
    String? selectUrl,
    String? type,
    num? userId,
  }) => WearBadge(
    animationUrl: animationUrl ?? _animationUrl,
    badgeKey: badgeKey ?? _badgeKey,
    badgeLevel: badgeLevel ?? _badgeLevel,
    badgeName: badgeName ?? _badgeName,
    expireTime: expireTime ?? _expireTime,
    id: id ?? _id,
    milestone: milestone ?? _milestone,
    notSelectUrl: notSelectUrl ?? _notSelectUrl,
    selectUrl: selectUrl ?? _selectUrl,
    type: type ?? _type,
    userId: userId ?? _userId,
  );

  String? get animationUrl => _animationUrl;

  String? get badgeKey => _badgeKey;

  num? get badgeLevel => _badgeLevel;

  String? get badgeName => _badgeName;

  num? get expireTime => _expireTime;

  num? get id => _id;

  num? get milestone => _milestone;

  String? get notSelectUrl => _notSelectUrl;

  String? get selectUrl => _selectUrl;

  String? get type => _type;

  num? get userId => _userId;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['animationUrl'] = _animationUrl;
    map['badgeKey'] = _badgeKey;
    map['badgeLevel'] = _badgeLevel;
    map['badgeName'] = _badgeName;
    map['expireTime'] = _expireTime;
    map['id'] = _id;
    map['milestone'] = _milestone;
    map['notSelectUrl'] = _notSelectUrl;
    map['selectUrl'] = _selectUrl;
    map['type'] = _type;
    map['userId'] = _userId;
    return map;
  }
}

/// expireTime : 0
/// propsResources : {"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""}
/// userId : 0

class UseProps {
  UseProps({
    String? expireTime,
    PropsResources? propsResources,
    String? userId,
  }) {
    _expireTime = expireTime;
    _propsResources = propsResources;
    _userId = userId;
  }

  UseProps.fromJson(dynamic json) {
    _expireTime = json['expireTime'];
    _propsResources =
        json['propsResources'] != null
            ? PropsResources.fromJson(json['propsResources'])
            : null;
    _userId = json['userId'];
  }

  String? _expireTime;
  PropsResources? _propsResources;
  String? _userId;

  UseProps copyWith({
    String? expireTime,
    PropsResources? propsResources,
    String? userId,
  }) => UseProps(
    expireTime: expireTime ?? _expireTime,
    propsResources: propsResources ?? _propsResources,
    userId: userId ?? _userId,
  );

  String? get expireTime => _expireTime;

  PropsResources? get propsResources => _propsResources;

  String? get userId => _userId;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['expireTime'] = _expireTime;
    if (_propsResources != null) {
      map['propsResources'] = _propsResources?.toJson();
    }
    map['userId'] = _userId;
    return map;
  }
}

/// amount : 0.0
/// code : ""
/// cover : ""
/// expand : ""
/// id : 0
/// name : ""
/// sourceUrl : ""
/// type : ""

class PropsResources {
  PropsResources({
    num? amount,
    String? code,
    String? cover,
    String? expand,
    String? id,
    String? name,
    String? sourceUrl,
    String? type,
  }) {
    _amount = amount;
    _code = code;
    _cover = cover;
    _expand = expand;
    _id = id;
    _name = name;
    _sourceUrl = sourceUrl;
    _type = type;
  }

  PropsResources.fromJson(dynamic json) {
    _amount = json['amount'];
    _code = json['code'];
    _cover = json['cover'];
    _expand = json['expand'];
    _id = json['id'];
    _name = json['name'];
    _sourceUrl = json['sourceUrl'];
    _type = json['type'];
  }

  num? _amount;
  String? _code;
  String? _cover;
  String? _expand;
  String? _id;
  String? _name;
  String? _sourceUrl;
  String? _type;

  PropsResources copyWith({
    num? amount,
    String? code,
    String? cover,
    String? expand,
    String? id,
    String? name,
    String? sourceUrl,
    String? type,
  }) => PropsResources(
    amount: amount ?? _amount,
    code: code ?? _code,
    cover: cover ?? _cover,
    expand: expand ?? _expand,
    id: id ?? _id,
    name: name ?? _name,
    sourceUrl: sourceUrl ?? _sourceUrl,
    type: type ?? _type,
  );

  num? get amount => _amount;

  String? get code => _code;

  String? get cover => _cover;

  String? get expand => _expand;

  String? get id => _id;

  String? get name => _name;

  String? get sourceUrl => _sourceUrl;

  String? get type => _type;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['amount'] = _amount;
    map['code'] = _code;
    map['cover'] = _cover;
    map['expand'] = _expand;
    map['id'] = _id;
    map['name'] = _name;
    map['sourceUrl'] = _sourceUrl;
    map['type'] = _type;
    return map;
  }
}

/// account : ""
/// expiredTime : 0

class OwnSpecialId {
  OwnSpecialId({String? account, num? expiredTime}) {
    _account = account;
    _expiredTime = expiredTime;
  }

  OwnSpecialId.fromJson(dynamic json) {
    _account = json['account'];
    _expiredTime = json['expiredTime'];
  }

  String? _account;
  num? _expiredTime;

  OwnSpecialId copyWith({String? account, num? expiredTime}) => OwnSpecialId(
    account: account ?? _account,
    expiredTime: expiredTime ?? _expiredTime,
  );

  String? get account => _account;

  num? get expiredTime => _expiredTime;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['account'] = _account;
    map['expiredTime'] = _expiredTime;
    return map;
  }
}

/// adminLockSeat : false
/// allowMusic : false
/// joinGolds : 0
/// lockLocation : ""
/// maxAdmin : 0
/// maxMember : 0
/// mikeSize : 0
/// openKtvMode : false
/// password : ""
/// roomId : 0
/// roomSpecialMikeType : ""
/// showHeartbeat : false
/// takeMicRole : ""
/// touristMike : false
/// touristMsg : false
/// userId : "0"

/// activeTime : 0
/// countryCode : ""
/// countryName : ""
/// createTime : 0
/// del : false
/// event : ""
/// id : "0"
/// langCode : ""
/// nationalFlag : ""
/// roomAccount : ""
/// roomCover : ""
/// roomDesc : ""
/// roomName : ""
/// sysOrigin : ""
/// updateTime : 0
/// userId : "0"

class RoomProfile2 {
  RoomProfile2({
    num? activeTime,
    String? countryCode,
    String? countryName,
    num? createTime,
    bool? del,
    String? event,
    String? id,
    String? langCode,
    String? nationalFlag,
    String? roomAccount,
    String? roomCover,
    String? roomDesc,
    String? roomName,
    String? sysOrigin,
    num? updateTime,
    String? userId,
  }) {
    _activeTime = activeTime;
    _countryCode = countryCode;
    _countryName = countryName;
    _createTime = createTime;
    _del = del;
    _event = event;
    _id = id;
    _langCode = langCode;
    _nationalFlag = nationalFlag;
    _roomAccount = roomAccount;
    _roomCover = roomCover;
    _roomDesc = roomDesc;
    _roomName = roomName;
    _sysOrigin = sysOrigin;
    _updateTime = updateTime;
    _userId = userId;
  }

  RoomProfile2.fromJson(dynamic json) {
    _activeTime = json['activeTime'];
    _countryCode = json['countryCode'];
    _countryName = json['countryName'];
    _createTime = json['createTime'];
    _del = json['del'];
    _event = json['event'];
    _id = json['id'];
    _langCode = json['langCode'];
    _nationalFlag = json['nationalFlag'];
    _roomAccount = json['roomAccount'];
    _roomCover = json['roomCover'] ?? json['cover'];
    _roomDesc = json['roomDesc'];
    _roomName = json['roomName'];
    _sysOrigin = json['sysOrigin'];
    _updateTime = json['updateTime'];
    _userId = json['userId'];
  }

  num? _activeTime;
  String? _countryCode;
  String? _countryName;
  num? _createTime;
  bool? _del;
  String? _event;
  String? _id;
  String? _langCode;
  String? _nationalFlag;
  String? _roomAccount;
  String? _roomCover;
  String? _roomDesc;
  String? _roomName;
  String? _sysOrigin;
  num? _updateTime;
  String? _userId;

  RoomProfile2 copyWith({
    num? activeTime,
    String? countryCode,
    String? countryName,
    num? createTime,
    bool? del,
    String? event,
    String? id,
    String? langCode,
    String? nationalFlag,
    String? roomAccount,
    String? roomCover,
    String? roomDesc,
    String? roomName,
    String? sysOrigin,
    num? updateTime,
    String? userId,
  }) => RoomProfile2(
    activeTime: activeTime ?? _activeTime,
    countryCode: countryCode ?? _countryCode,
    countryName: countryName ?? _countryName,
    createTime: createTime ?? _createTime,
    del: del ?? _del,
    event: event ?? _event,
    id: id ?? _id,
    langCode: langCode ?? _langCode,
    nationalFlag: nationalFlag ?? _nationalFlag,
    roomAccount: roomAccount ?? _roomAccount,
    roomCover: roomCover ?? _roomCover,
    roomDesc: roomDesc ?? _roomDesc,
    roomName: roomName ?? _roomName,
    sysOrigin: sysOrigin ?? _sysOrigin,
    updateTime: updateTime ?? _updateTime,
    userId: userId ?? _userId,
  );

  num? get activeTime => _activeTime;

  String? get countryCode => _countryCode;

  String? get countryName => _countryName;

  num? get createTime => _createTime;

  bool? get del => _del;

  String? get event => _event;

  String? get id => _id;

  String? get langCode => _langCode;

  String? get nationalFlag => _nationalFlag;

  String? get roomAccount => _roomAccount;

  String? get roomCover => _roomCover;

  String? get roomDesc => _roomDesc;

  String? get roomName => _roomName;

  String? get sysOrigin => _sysOrigin;

  num? get updateTime => _updateTime;

  String? get userId => _userId;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['activeTime'] = _activeTime;
    map['countryCode'] = _countryCode;
    map['countryName'] = _countryName;
    map['createTime'] = _createTime;
    map['del'] = _del;
    map['event'] = _event;
    map['id'] = _id;
    map['langCode'] = _langCode;
    map['nationalFlag'] = _nationalFlag;
    map['roomAccount'] = _roomAccount;
    map['roomCover'] = _roomCover;
    map['roomDesc'] = _roomDesc;
    map['roomName'] = _roomName;
    map['sysOrigin'] = _sysOrigin;
    map['updateTime'] = _updateTime;
    map['userId'] = _userId;
    return map;
  }
}

/// adminCount : 0
/// memberCount : 0

class RoomCounter {
  RoomCounter({num? adminCount, num? memberCount}) {
    _adminCount = adminCount;
    _memberCount = memberCount;
  }

  RoomCounter.fromJson(dynamic json) {
    _adminCount = json['adminCount'];
    _memberCount = json['memberCount'];
  }

  num? _adminCount;
  num? _memberCount;

  RoomCounter copyWith({num? adminCount, num? memberCount}) => RoomCounter(
    adminCount: adminCount ?? _adminCount,
    memberCount: memberCount ?? _memberCount,
  );

  num? get adminCount => _adminCount;

  num? get memberCount => _memberCount;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['adminCount'] = _adminCount;
    map['memberCount'] = _memberCount;
    return map;
  }
}

/// level : {"charmLevel":0,"userId":0,"wealthLevel":0}
/// nobleVipAbility : [""]
/// roles : ""
/// roomToken : ""

class Entrants {
  Entrants({
    Level? level,
    List<String>? nobleVipAbility,
    String? roles,
    String? roomToken,
  }) {
    _level = level;
    _nobleVipAbility = nobleVipAbility;
    _roles = roles;
    _roomToken = roomToken;
  }

  Entrants.fromJson(dynamic json) {
    _level = json['level'] != null ? Level.fromJson(json['level']) : null;
    _nobleVipAbility =
        json['nobleVipAbility'] != null
            ? (json['nobleVipAbility'] as List)
                .map((item) => item as String)
                .toList()
            : null;
    _roles = json['roles'];
    _roomToken = json['roomToken'];
  }

  Level? _level;
  List<String>? _nobleVipAbility;
  String? _roles;
  String? _roomToken;

  Entrants copyWith({
    Level? level,
    List<String>? nobleVipAbility,
    String? roles,
    String? roomToken,
  }) => Entrants(
    level: level ?? _level,
    nobleVipAbility: nobleVipAbility ?? _nobleVipAbility,
    roles: roles ?? _roles,
    roomToken: roomToken ?? _roomToken,
  );

  Level? get level => _level;

  List<String>? get nobleVipAbility => _nobleVipAbility;

  String? get roles => _roles;

  String? get roomToken => _roomToken;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    if (_level != null) {
      map['level'] = _level?.toJson();
    }
    map['nobleVipAbility'] = _nobleVipAbility;
    map['roles'] = _roles;
    map['roomToken'] = _roomToken;
    return map;
  }

  void setRoles(String? roles) {
    _roles = roles;
  }
}

/// charmLevel : 0
/// userId : 0
/// wealthLevel : 0

class Level {
  Level({num? charmLevel, num? userId, num? wealthLevel}) {
    _charmLevel = charmLevel;
    _userId = userId;
    _wealthLevel = wealthLevel;
  }

  Level.fromJson(dynamic json) {
    _charmLevel = json['charmLevel'];
    _userId = json['userId'];
    _wealthLevel = json['wealthLevel'];
  }

  num? _charmLevel;
  num? _userId;
  num? _wealthLevel;

  Level copyWith({num? charmLevel, num? userId, num? wealthLevel}) => Level(
    charmLevel: charmLevel ?? _charmLevel,
    userId: userId ?? _userId,
    wealthLevel: wealthLevel ?? _wealthLevel,
  );

  num? get charmLevel => _charmLevel;

  num? get userId => _userId;

  num? get wealthLevel => _wealthLevel;

  Map<String?, dynamic> toJson() {
    final map = <String?, dynamic>{};
    map['charmLevel'] = _charmLevel;
    map['userId'] = _userId;
    map['wealthLevel'] = _wealthLevel;
    return map;
  }
}
