class TaskInventoryTreeModel {
  String? id;
  String? type;
  String? label;
  dynamic disabled;
  dynamic parentId;
  List<ChildrenOfTaskInventoryTreeModel>? children;

  TaskInventoryTreeModel({
    this.id,
    this.type,
    this.label,
    this.disabled,
    this.parentId,
    this.children,
  });

  TaskInventoryTreeModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    type = map['type'];
    label = map['label'];
    disabled = map['disabled'];
    parentId = map['parentId'];
    children = List<ChildrenOfTaskInventoryTreeModel>.from(
        (map["children"] ?? [])
            .map((x) => ChildrenOfTaskInventoryTreeModel.fromJson(x)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['type'] = this.type;
    json['label'] = this.label;
    json['disabled'] = this.disabled;
    json['parentId'] = this.parentId;
    json['children'] =
        List<dynamic>.from((children ?? []).map((x) => x.toJson()));

    return json;
  }
}

class ChildrenOfTaskInventoryTreeModel {
  String? id;
  String? type;
  String? label;
  dynamic disabled;
  dynamic parentId;

  ChildrenOfTaskInventoryTreeModel({
    this.id,
    this.type,
    this.label,
    this.disabled,
    this.parentId,
  });

  ChildrenOfTaskInventoryTreeModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    type = map['type'];
    label = map['label'];
    disabled = map['disabled'];
    parentId = map['parentId'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['type'] = this.type;
    json['label'] = this.label;
    json['disabled'] = this.disabled;
    json['parentId'] = this.parentId;

    return json;
  }
}
