class crmLeadDetailsEditProductsViewResponse {
  List<Products>? products;
  List<LeadProducts>? leadProducts;
  String? error;
  String? message;
  int? sessionExists;

  crmLeadDetailsEditProductsViewResponse(
      {this.products, this.leadProducts, this.error, this.message, this.sessionExists});

  crmLeadDetailsEditProductsViewResponse.fromJson(Map<String, dynamic> json) {
    if (json['products'] != null) {
      products = <Products>[];
      json['products'].forEach((v) {
        products!.add(new Products.fromJson(v));
      });
    }
    if (json['lead_products'] != null) {
      leadProducts = <LeadProducts>[];
      json['lead_products'].forEach((v) {
        leadProducts!.add(new LeadProducts.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.products != null) {
      data['products'] = this.products!.map((v) => v.toJson()).toList();
    }
    if (this.leadProducts != null) {
      data['lead_products'] =
          this.leadProducts!.map((v) => v.toJson()).toList();
    }
    data['error'] = this.error;
    data['message'] = this.message;
    data['session_exists'] = this.sessionExists;
    return data;
  }
}

class Products {
  String? id;
  String? name;

  Products({this.id, this.name});

  Products.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    return data;
  }
}

class LeadProducts {
  String? id;
  String? leadId;
  String? productId;
  String? qty;
  String? price;
  String? date;
  String? isDel;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;
  String? productName;

  LeadProducts(
      {this.id,
        this.leadId,
        this.productId,
        this.qty,
        this.price,
        this.date,
        this.isDel,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime,
        this.productName});

  LeadProducts.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    leadId = json['lead_id'];
    productId = json['product_id'];
    qty = json['qty'];
    price = json['price'];
    date = json['date'];
    isDel = json['is_del'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    productName = json['product_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['lead_id'] = this.leadId;
    data['product_id'] = this.productId;
    data['qty'] = this.qty;
    data['price'] = this.price;
    data['date'] = this.date;
    data['is_del'] = this.isDel;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['product_name'] = this.productName;
    return data;
  }
}
