class CategoriseParentModel {
  String id;
  String name;
  String namen;
  List<LocalizedNames> localizedNames;
  dynamic description;
  int parentCategoryId;
  int displayOrder;
  dynamic image;
  bool isLeaf;

  CategoriseParentModel(
      {this.id,
      this.name,
      this.namen,
      this.localizedNames,
      this.description,
      this.parentCategoryId,
      this.displayOrder,
      this.image,
      this.isLeaf});

  CategoriseParentModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    namen = json['namen'];
    if (json['localized_names'] != null) {
      localizedNames = new List<LocalizedNames>();
      json['localized_names'].forEach((v) {
        localizedNames.add(new LocalizedNames.fromJson(v));
      });
    }
    description = json['description'];
    parentCategoryId = json['parent_category_id'];
    displayOrder = json['display_order'];
    image = json['image'];
    isLeaf = json['is_leaf'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['namen'] = this.namen;
    if (this.localizedNames != null) {
      data['localized_names'] =
          this.localizedNames.map((v) => v.toJson()).toList();
    }
    data['description'] = this.description;
    data['parent_category_id'] = this.parentCategoryId;
    data['display_order'] = this.displayOrder;
    data['image'] = this.image;
    data['is_leaf'] = this.isLeaf;
    return data;
  }
}

class LocalizedNames {
  int languageId;
  String localizedName;

  LocalizedNames({this.languageId, this.localizedName});

  LocalizedNames.fromJson(Map<String, dynamic> json) {
    languageId = json['language_id'];
    localizedName = json['localized_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['language_id'] = this.languageId;
    data['localized_name'] = this.localizedName;
    return data;
  }
}
