class ChatUserModel {
  ChatUserModel({
    this.response,
    this.errorResponses,
  });

  List<ChatUser>? response;
  dynamic errorResponses;

  factory ChatUserModel.fromJson(Map<String, dynamic> json) => ChatUserModel(
        response: json["response"] == null ? null : List<ChatUser>.from(json["response"].map((x) => ChatUser.fromJson(x))),
        errorResponses: json["errorResponses"],
      );

  Map<String, dynamic> toJson() => {
        "response": response == null ? null : List<dynamic>.from(response!.map((x) => x.toJson())),
        "errorResponses": errorResponses,
      };
}

class ChatUser {
  ChatUser({
    this.id,
    this.userName,
    this.email,
    this.phone,
    this.title,
    this.userStatus,
    this.image,
    this.unreadMessageCount,
    this.userAction,
    this.isPin,
    this.isFav,
    this.isAdmin,
    this.isTyping,
  });

  int? id;
  String? userName;
  String? email;
  dynamic? phone;
  dynamic? title;
  int? userStatus;
  dynamic? image;
  int? unreadMessageCount;
  dynamic? userAction;
  bool? isPin;
  bool? isFav;
  bool? isAdmin;
  bool? isTyping;

  factory ChatUser.fromJson(Map<String, dynamic> json) => ChatUser(
        id: json["id"] == null ? null : json["id"],
        userName: json["userName"] == null ? null : json["userName"],
        email: json["email"] == null ? null : json["email"],
        phone: json["phone"],
        title: json["title"],
        userStatus: json["userStatus"] == null ? null : json["userStatus"],
        image: json["image"],
        unreadMessageCount: json["unreadMessageCount"] == null ? null : json["unreadMessageCount"],
        userAction: json["userAction"],
        isPin: json["isPin"] == null ? null : json["isPin"],
        isFav: json["isFav"] == null ? null : json["isFav"],
        isAdmin: json["isAdmin"] == null ? null : json["isAdmin"],
        isTyping: false,
      );

  Map<String, dynamic> toJson() => {
        "id": id == null ? null : id,
        "userName": userName == null ? null : userName,
        "email": email == null ? null : email,
        "phone": phone,
        "title": title,
        "userStatus": userStatus == null ? null : userStatus,
        "image": image,
        "unreadMessageCount": unreadMessageCount == null ? null : unreadMessageCount,
        "userAction": userAction,
        "isPin": isPin == null ? null : isPin,
        "isFav": isFav == null ? null : isFav,
        "isAdmin": isAdmin == null ? null : isAdmin,
      };
}
