import 'package:wisdom_cli/wisdom_cli.dart';

class TaskDetailModel {
  String? id;
  String? title;
  String? status;
  bool? isPublic;
  String? createdAt;
  String? updatedAt;
  String? finishedTime;
  bool? isnowWeek;
  String? beLongWeek;
  bool? iscreatedBy;
  String? createdBy;
  String? createdByName;
  bool? isoperator;
  String? operator;
  String? content;
  bool? isChild;
  String? mailFrom;
  List<dynamic>? mailFromIds;
  List<AccessoryVosOfTaskDetailModel>? accessoryVos;
  num? useTime;
  String? fatherContent;
  String? fatherTitle;
  num? score;
  bool? reviewed;
  String? reviewContent;
  String? closeTime;
  bool? whetherCloseTime;
  dynamic startTime;
  bool? whetherStart;
  String? operatorPhone;
  num? childTaskCount;
  String? inventoryId;
  String? inventoryName;
  String? canStartTime;
  String? overdueTime;
  bool? isTimeOut;
  String? parentId;
  String? operatorId;
  bool? seqencing;
  bool? preset;
  bool? taskMultiStepEnable;
  bool? isMultiStep;
  String? supervisorId;
  String? supervisorName;
  bool? examine;
  bool? readState;
  bool? taskTimeout;
  dynamic resultAbnormalSolve;
  List<GlobalIdToNameModel>? labelVos;
  TaskDetailModel({
    this.id,
    this.title,
    this.status,
    this.isPublic,
    this.createdAt,
    this.updatedAt,
    this.finishedTime,
    this.isnowWeek,
    this.beLongWeek,
    this.iscreatedBy,
    this.createdBy,
    this.createdByName,
    this.isoperator,
    this.operator,
    this.content,
    this.isChild,
    this.mailFrom,
    this.mailFromIds,
    this.accessoryVos,
    this.useTime,
    this.fatherContent,
    this.fatherTitle,
    this.score,
    this.reviewed,
    this.reviewContent,
    this.closeTime,
    this.whetherCloseTime,
    this.startTime,
    this.whetherStart,
    this.operatorPhone,
    this.childTaskCount,
    this.inventoryId,
    this.inventoryName,
    this.canStartTime,
    this.overdueTime,
    this.isTimeOut,
    this.parentId,
    this.operatorId,
    this.seqencing,
    this.preset,
    this.taskMultiStepEnable,
    this.isMultiStep,
    this.supervisorId,
    this.supervisorName,
    this.examine,
    this.readState,
    this.taskTimeout,
    this.resultAbnormalSolve,
    this.labelVos,
  });

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

    id = map['id'];
    title = map['title'];
    status = map['status'];
    isPublic = map['isPublic'];
    createdAt = map['createdAt'];
    updatedAt = map['updatedAt'];
    finishedTime = map['finishedTime'];
    isnowWeek = map['isnowWeek'];
    beLongWeek = map['beLongWeek'];
    iscreatedBy = map['iscreatedBy'];
    createdBy = map['createdBy'];
    createdByName = map['createdByName'];
    isoperator = map['isoperator'];
    operator = map['operator'];
    content = map['content'];
    isChild = map['isChild'];
    mailFrom = map['mailFrom'];
    mailFromIds = map['mailFromIds'];
    accessoryVos = List<AccessoryVosOfTaskDetailModel>.from(
        (map["accessoryVos"] ?? []).map((x) => AccessoryVosOfTaskDetailModel.fromJson(x)));
    ;
    useTime = map['useTime'];
    fatherContent = map['fatherContent'];
    fatherTitle = map['fatherTitle'];
    score = map['score'];
    reviewed = map['reviewed'];
    reviewContent = map['reviewContent'];
    closeTime = map['closeTime'];
    whetherCloseTime = map['whetherCloseTime'];
    startTime = map['startTime'];
    whetherStart = map['whetherStart'];
    operatorPhone = map['operatorPhone'];
    childTaskCount = map['childTaskCount'];
    inventoryId = map['inventoryId'];
    inventoryName = map['inventoryName'];
    canStartTime = map['canStartTime'];
    overdueTime = map['overdueTime'];
    isTimeOut = map['isTimeOut'];
    parentId = map['parentId'];
    operatorId = map['operatorId'];
    seqencing = map['seqencing'];
    preset = map['preset'];
    taskMultiStepEnable = map['taskMultiStepEnable'];
    isMultiStep = map['isMultiStep'];
    supervisorId = map['supervisorId'];
    supervisorName = map['supervisorName'];
    examine = map['examine'];
    readState = map['readState'];
    taskTimeout = map['taskTimeout'];
    resultAbnormalSolve = map['resultAbnormalSolve'];
    labelVos = List<GlobalIdToNameModel>.from(
        (map["labelVos"] ?? []).map((x) => GlobalIdToNameModel.fromJson(x)));
    ;
  }

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

    json['id'] = this.id;
    json['title'] = this.title;
    json['status'] = this.status;
    json['isPublic'] = this.isPublic;
    json['createdAt'] = this.createdAt;
    json['updatedAt'] = this.updatedAt;
    json['finishedTime'] = this.finishedTime;
    json['isnowWeek'] = this.isnowWeek;
    json['beLongWeek'] = this.beLongWeek;
    json['iscreatedBy'] = this.iscreatedBy;
    json['createdBy'] = this.createdBy;
    json['createdByName'] = this.createdByName;
    json['isoperator'] = this.isoperator;
    json['operator'] = this.operator;
    json['content'] = this.content;
    json['isChild'] = this.isChild;
    json['mailFrom'] = this.mailFrom;
    json['mailFromIds'] = this.mailFromIds;
    json['accessoryVos'] = this.accessoryVos;
    json['useTime'] = this.useTime;
    json['fatherContent'] = this.fatherContent;
    json['fatherTitle'] = this.fatherTitle;
    json['score'] = this.score;
    json['reviewed'] = this.reviewed;
    json['reviewContent'] = this.reviewContent;
    json['closeTime'] = this.closeTime;
    json['whetherCloseTime'] = this.whetherCloseTime;
    json['startTime'] = this.startTime;
    json['whetherStart'] = this.whetherStart;
    json['operatorPhone'] = this.operatorPhone;
    json['childTaskCount'] = this.childTaskCount;
    json['inventoryId'] = this.inventoryId;
    json['inventoryName'] = this.inventoryName;
    json['canStartTime'] = this.canStartTime;
    json['overdueTime'] = this.overdueTime;
    json['isTimeOut'] = this.isTimeOut;
    json['parentId'] = this.parentId;
    json['operatorId'] = this.operatorId;
    json['seqencing'] = this.seqencing;
    json['preset'] = this.preset;
    json['taskMultiStepEnable'] = this.taskMultiStepEnable;
    json['isMultiStep'] = this.isMultiStep;
    json['supervisorId'] = this.supervisorId;
    json['supervisorName'] = this.supervisorName;
    json['examine'] = this.examine;
    json['readState'] = this.readState;
    json['taskTimeout'] = this.taskTimeout;
    json['resultAbnormalSolve'] = this.resultAbnormalSolve;
    json['labelVos'] = this.labelVos;

    return json;
  }
}

class AccessoryVosOfTaskDetailModel {
  String? accessoryId;
  String? accessoryName;
  String? type;

  AccessoryVosOfTaskDetailModel({
    this.accessoryId,
    this.accessoryName,
    this.type,
  });

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

    accessoryId = map['accessoryId'];
    accessoryName = map['accessoryName'];
    type = map['type'];
  }

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

    json['accessoryId'] = this.accessoryId;
    json['accessoryName'] = this.accessoryName;
    json['type'] = this.type;

    return json;
  }
}
