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

/// roomId : 0
/// micIndex : 0
/// micLock : false
/// micMute : false
/// user : {"id":"0","account":"","userAvatar":"","userNickname":"","userSex":0,"ownSpecialId":{"account":"","expiredTime":0},"useProps":[{"userId":"0","propsResources":{"id":"0","type":"","code":"","name":"","cover":"","sourceUrl":"","expand":"","amount":0.0},"expireTime":0}],"roles":"","charmLevel":0,"heartbeatVal":0}
/// roomToken : ""

class MicRes {
  MicRes({
    String? roomId,
    num? micIndex,
    bool? micLock,
    bool? micMute,
    String? emojiPath,
    SocialChatUserProfile? user,
    String? type,
    String? roomToken,
    String?number
  }) {
    _roomId = roomId;
    _micIndex = micIndex;
    _micLock = micLock;
    _micMute = micMute;
    _user = user;
    _roomToken = roomToken;
    _emojiPath = emojiPath;
    _type = type;
    _number = number;
  }

  MicRes.fromJson(dynamic json) {
    _roomId = json['roomId'];
    _micIndex = json['micIndex'];
    _micLock = json['micLock'];
    _micMute = json['micMute'];
    _user = json['user'] != null ? SocialChatUserProfile.fromJson(json['user']) : null;
    _roomToken = json['roomToken'];
    _type = json['type'];
    _number = json['number'];
  }

  String? _roomId;
  num? _micIndex;
  bool? _micLock;
  bool? _micMute;
  SocialChatUserProfile? _user;
  String? _roomToken;
  int? _volume = 0;
  String? _type = "";
  String? _emojiPath;
  String? _number;

  MicRes copyWith({
    String? roomId,
    num? micIndex,
    bool? micLock,
    bool? micMute,
    String? type,
    SocialChatUserProfile? user,
    String? roomToken,
    String? emojiPath,
    String? number,
  }) => MicRes(
    roomId: roomId ?? _roomId,
    micIndex: micIndex ?? _micIndex,
    micLock: micLock ?? _micLock,
    micMute: micMute ?? _micMute,
    user: user ?? _user,
    roomToken: roomToken ?? _roomToken,
    emojiPath: emojiPath ?? _emojiPath,
    type: type ?? _type,
    number: number ?? _number,
  );

  String? get roomId => _roomId;

  num? get micIndex => _micIndex;

  bool? get micLock => _micLock;

  bool? get micMute => _micMute;

  SocialChatUserProfile? get user => _user;

  String? get roomToken => _roomToken;

  String? get type => _type;

  String? get emojiPath => _emojiPath;

  String? get number => _number;

  set setUser(SocialChatUserProfile? value) => _user = value;

  set setVolume(int? value) => _volume = value;

  set setEmojiPath(String? value) => _emojiPath = value;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['roomId'] = _roomId;
    map['micIndex'] = _micIndex;
    map['micLock'] = _micLock;
    map['micMute'] = _micMute;
    map['type'] = _type;
    map['number'] = _number;
    if (_user != null) {
      map['user'] = _user?.toJson();
    }
    map['roomToken'] = _roomToken;
    return map;
  }
}
