class crmDashboardResponse {
  Hotleads? hotleads;
  Hotleads? pendingTasks;
  Hotleads? coldleads;
  Hotleads? warmleads;
  Hotleads? totalleads;
  Hotleads? openleads;
  Hotleads? visits;
  Hotleads? calls;
  Hotleads? quote;
  Hotleads? orderlost;
  Hotleads? norequirement;
  Hotleads? openEnquiries;
  List<NearbyLeads>? nearbyLeads;
  String? error;
  String? message;
  int? sessionExists;

  crmDashboardResponse(
      {this.hotleads,
        this.pendingTasks,
        this.coldleads,
        this.warmleads,
        this.totalleads,
        this.openleads,
        this.visits,
        this.calls,
        this.quote,
        this.orderlost,
        this.norequirement,
        this.openEnquiries,
        this.nearbyLeads,
        this.error,
        this.message,
        this.sessionExists});

  crmDashboardResponse.fromJson(Map<String, dynamic> json) {
    hotleads = json['hotleads'] != null
        ? new Hotleads.fromJson(json['hotleads'])
        : null;
    pendingTasks = json['pending_tasks'] != null
        ? new Hotleads.fromJson(json['pending_tasks'])
        : null;
    coldleads = json['coldleads'] != null
        ? new Hotleads.fromJson(json['coldleads'])
        : null;
    warmleads = json['warmleads'] != null
        ? new Hotleads.fromJson(json['warmleads'])
        : null;
    totalleads = json['totalleads'] != null
        ? new Hotleads.fromJson(json['totalleads'])
        : null;
    openleads = json['openleads'] != null
        ? new Hotleads.fromJson(json['openleads'])
        : null;
    visits =
    json['visits'] != null ? new Hotleads.fromJson(json['visits']) : null;
    calls = json['calls'] != null ? new Hotleads.fromJson(json['calls']) : null;
    quote = json['quote'] != null ? new Hotleads.fromJson(json['quote']) : null;
    orderlost = json['orderlost'] != null
        ? new Hotleads.fromJson(json['orderlost'])
        : null;
    norequirement = json['norequirement'] != null
        ? new Hotleads.fromJson(json['norequirement'])
        : null;
    openEnquiries = json['open_enquiries'] != null
        ? new Hotleads.fromJson(json['open_enquiries'])
        : null;
    if (json['nearby_leads'] != null) {
      nearbyLeads = <NearbyLeads>[];
      json['nearby_leads'].forEach((v) {
        nearbyLeads!.add(new NearbyLeads.fromJson(v));
      });
    }
    error = json['error'];
    message = json['message'];
    sessionExists = json['session_exists'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.hotleads != null) {
      data['hotleads'] = this.hotleads!.toJson();
    }
    if (this.pendingTasks != null) {
      data['pending_tasks'] = this.pendingTasks!.toJson();
    }
    if (this.coldleads != null) {
      data['coldleads'] = this.coldleads!.toJson();
    }
    if (this.warmleads != null) {
      data['warmleads'] = this.warmleads!.toJson();
    }
    if (this.totalleads != null) {
      data['totalleads'] = this.totalleads!.toJson();
    }
    if (this.openleads != null) {
      data['openleads'] = this.openleads!.toJson();
    }
    if (this.visits != null) {
      data['visits'] = this.visits!.toJson();
    }
    if (this.calls != null) {
      data['calls'] = this.calls!.toJson();
    }
    if (this.quote != null) {
      data['quote'] = this.quote!.toJson();
    }
    if (this.orderlost != null) {
      data['orderlost'] = this.orderlost!.toJson();
    }
    if (this.norequirement != null) {
      data['norequirement'] = this.norequirement!.toJson();
    }
    if (this.openEnquiries != null) {
      data['open_enquiries'] = this.openEnquiries!.toJson();
    }
    if (this.nearbyLeads != null) {
      data['nearby_leads'] = this.nearbyLeads!.map((v) => v.toJson()).toList();
    }
    data['error'] = this.error;
    data['message'] = this.message;
    data['session_exists'] = this.sessionExists;
    return data;
  }
}

class Hotleads {
  String? count;
  Filter? filter;

  Hotleads({this.count, this.filter});

  Hotleads.fromJson(Map<String, dynamic> json) {
    count = json['count'];
    filter =
    json['filter'] != null ? new Filter.fromJson(json['filter']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['count'] = this.count;
    if (this.filter != null) {
      data['filter'] = this.filter!.toJson();
    }
    return data;
  }
}

class Filter {
  String? id;
  String? pageName;
  String? mode;
  String? openStatus;
  String? status;

  Filter({this.id, this.pageName, this.mode, this.openStatus, this.status});

  Filter.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    pageName = json['page_name'];
    mode = json['mode'];
    openStatus = json['open_status'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['page_name'] = this.pageName;
    data['mode'] = this.mode;
    data['open_status'] = this.openStatus;
    data['status'] = this.status;
    return data;
  }
}

class NearbyLeads {
  String? id;
  String? ownerId;
  String? accId;
  String? accManagerId;
  String? status;
  String? openStatus;
  String? date;
  String? closeDate;
  String? closereason;
  String? competitor;
  String? orderGainId;
  String? loc;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;
  String? followupFunction;
  String? name;
  String? product;
  String? contName;
  String? address;
  String? mob1;
  String? mob2;
  String? tel;
  String? email;
  String? distance;

  NearbyLeads(
      {this.id,
        this.ownerId,
        this.accId,
        this.accManagerId,
        this.status,
        this.openStatus,
        this.date,
        this.closeDate,
        this.closereason,
        this.competitor,
        this.orderGainId,
        this.loc,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime,
        this.followupFunction,
        this.name,
        this.product,
        this.contName,
        this.address,
        this.mob1,
        this.mob2,
        this.tel,
        this.email,
        this.distance});

  NearbyLeads.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ownerId = json['owner_id'];
    accId = json['acc_id'];
    accManagerId = json['acc_manager_id'];
    status = json['status'];
    openStatus = json['open_status'];
    date = json['date'];
    closeDate = json['close_date'];
    closereason = json['closereason'];
    competitor = json['competitor'];
    orderGainId = json['order_gain_id'];
    loc = json['loc'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    followupFunction = json['followup_function'];
    name = json['name'];
    product = json['product'];
    contName = json['cont_name'];
    address = json['address'];
    mob1 = json['mob1'];
    mob2 = json['mob2'];
    tel = json['tel'];
    email = json['email'];
    distance = json['distance'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['owner_id'] = this.ownerId;
    data['acc_id'] = this.accId;
    data['acc_manager_id'] = this.accManagerId;
    data['status'] = this.status;
    data['open_status'] = this.openStatus;
    data['date'] = this.date;
    data['close_date'] = this.closeDate;
    data['closereason'] = this.closereason;
    data['competitor'] = this.competitor;
    data['order_gain_id'] = this.orderGainId;
    data['loc'] = this.loc;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['followup_function'] = this.followupFunction;
    data['name'] = this.name;
    data['product'] = this.product;
    data['cont_name'] = this.contName;
    data['address'] = this.address;
    data['mob1'] = this.mob1;
    data['mob2'] = this.mob2;
    data['tel'] = this.tel;
    data['email'] = this.email;
    data['distance'] = this.distance;
    return data;
  }
}
