class ClosedIOModel {
  int? statusCode;
  Data? data;
  String? message;
  bool? success;

  ClosedIOModel({this.statusCode, this.data, this.message, this.success});

  ClosedIOModel.fromJson(Map<String, dynamic> json) {
    statusCode = json['statusCode'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    message = json['message'];
    success = json['success'];
  }

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

class Data {
  int? totalItems;
  List<Rows>? rows;
  int? totalPages;
  int? currentPage;

  Data({this.totalItems, this.rows, this.totalPages, this.currentPage});

  Data.fromJson(Map<String, dynamic> json) {
    totalItems = json['totalItems'];
    if (json['rows'] != null) {
      rows = <Rows>[];
      json['rows'].forEach((v) {
        rows!.add(new Rows.fromJson(v));
      });
    }
    totalPages = json['totalPages'];
    currentPage = json['currentPage'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['totalItems'] = this.totalItems;
    if (this.rows != null) {
      data['rows'] = this.rows!.map((v) => v.toJson()).toList();
    }
    data['totalPages'] = this.totalPages;
    data['currentPage'] = this.currentPage;
    return data;
  }
}

class Rows {
  int? id;
  String? ioId;
  int? investmentTypeXid;
  int? sponsorXid;
  int? ioStatusXid;
  String? investmentNameEnglish;
  String? investmentNameArabic;
  String? descriptionEnglish;
  String? descriptionArabic;
  String? goalAmount;
  String? closingDate;
  String? holdingPeriod;
  String? expectedReturn;
  String? originalValuation;
  String? currentValuation;
  String? iSIN;
  String? investmentDetails;
  String? comment;
  bool? isInvestedAmount;
  String? amountInvested;
  bool? isActive;
  Null? createdBy;
  Null? modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null? deletedAt;
  Sponsor? sponsor;
  IoStatus? ioStatus;
  InvestmentType? investmentType;
  List<ArtifactsImage>? artifactsImage;
  List<MinInvestmentAmt>? minInvestmentAmt;

  Rows(
      {this.id,
      this.ioId,
      this.investmentTypeXid,
      this.sponsorXid,
      this.ioStatusXid,
      this.investmentNameEnglish,
      this.investmentNameArabic,
      this.descriptionEnglish,
      this.descriptionArabic,
      this.goalAmount,
      this.closingDate,
      this.holdingPeriod,
      this.expectedReturn,
      this.originalValuation,
      this.currentValuation,
      this.iSIN,
      this.investmentDetails,
      this.comment,
      this.isInvestedAmount,
      this.amountInvested,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt,
      this.sponsor,
      this.ioStatus,
      this.investmentType,
      this.artifactsImage,
      this.minInvestmentAmt});

  Rows.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ioId = json['io_id'];
    investmentTypeXid = json['investmentType_xid'];
    sponsorXid = json['sponsor_xid'];
    ioStatusXid = json['ioStatus_xid'];
    investmentNameEnglish = json['investmentNameEnglish'];
    investmentNameArabic = json['investmentNameArabic'];
    descriptionEnglish = json['descriptionEnglish'];
    descriptionArabic = json['descriptionArabic'];
    goalAmount = json['goalAmount'];
    closingDate = json['closingDate'];
    holdingPeriod = json['holdingPeriod'];
    expectedReturn = json['expectedReturn'];
    originalValuation = json['originalValuation'];
    currentValuation = json['currentValuation'];
    iSIN = json['ISIN'];
    investmentDetails = json['InvestmentDetails'];
    comment = json['comment'];
    isInvestedAmount = json['isInvestedAmount'];
    amountInvested = json['amountInvested'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
    sponsor =
        json['sponsor'] != null ? new Sponsor.fromJson(json['sponsor']) : null;
    ioStatus = json['ioStatus'] != null
        ? new IoStatus.fromJson(json['ioStatus'])
        : null;
    investmentType = json['investmentType'] != null
        ? new InvestmentType.fromJson(json['investmentType'])
        : null;
    if (json['artifactsImage'] != null) {
      artifactsImage = <ArtifactsImage>[];
      json['artifactsImage'].forEach((v) {
        artifactsImage!.add(new ArtifactsImage.fromJson(v));
      });
    }
    if (json['minInvestmentAmt'] != null) {
      minInvestmentAmt = <MinInvestmentAmt>[];
      json['minInvestmentAmt'].forEach((v) {
        minInvestmentAmt!.add(new MinInvestmentAmt.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['io_id'] = this.ioId;
    data['investmentType_xid'] = this.investmentTypeXid;
    data['sponsor_xid'] = this.sponsorXid;
    data['ioStatus_xid'] = this.ioStatusXid;
    data['investmentNameEnglish'] = this.investmentNameEnglish;
    data['investmentNameArabic'] = this.investmentNameArabic;
    data['descriptionEnglish'] = this.descriptionEnglish;
    data['descriptionArabic'] = this.descriptionArabic;
    data['goalAmount'] = this.goalAmount;
    data['closingDate'] = this.closingDate;
    data['holdingPeriod'] = this.holdingPeriod;
    data['expectedReturn'] = this.expectedReturn;
    data['originalValuation'] = this.originalValuation;
    data['currentValuation'] = this.currentValuation;
    data['ISIN'] = this.iSIN;
    data['InvestmentDetails'] = this.investmentDetails;
    data['comment'] = this.comment;
    data['isInvestedAmount'] = this.isInvestedAmount;
    data['amountInvested'] = this.amountInvested;
    data['isActive'] = this.isActive;
    data['createdBy'] = this.createdBy;
    data['modifiedBy'] = this.modifiedBy;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['deletedAt'] = this.deletedAt;
    if (this.sponsor != null) {
      data['sponsor'] = this.sponsor!.toJson();
    }
    if (this.ioStatus != null) {
      data['ioStatus'] = this.ioStatus!.toJson();
    }
    if (this.investmentType != null) {
      data['investmentType'] = this.investmentType!.toJson();
    }
    if (this.artifactsImage != null) {
      data['artifactsImage'] =
          this.artifactsImage!.map((v) => v.toJson()).toList();
    }
    if (this.minInvestmentAmt != null) {
      data['minInvestmentAmt'] =
          this.minInvestmentAmt!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ArtifactsImage {
  int? id;
  int? ioXid;
  String? artifactName;
  String? artifactPathName;
  int? displayOrder;
  bool? isActive;
  Null? createdBy;
  Null? modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null? deletedAt;

  ArtifactsImage(
      {this.id,
      this.ioXid,
      this.artifactName,
      this.artifactPathName,
      this.displayOrder,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  ArtifactsImage.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ioXid = json['io_xid'];
    artifactName = json['artifactName'];
    artifactPathName = json['artifactPathName'];
    displayOrder = json['displayOrder'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['io_xid'] = this.ioXid;
    data['artifactName'] = this.artifactName;
    data['artifactPathName'] = this.artifactPathName;
    data['displayOrder'] = this.displayOrder;
    data['isActive'] = this.isActive;
    data['createdBy'] = this.createdBy;
    data['modifiedBy'] = this.modifiedBy;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['deletedAt'] = this.deletedAt;
    return data;
  }
}

class Sponsor {
  int? id;
  String? sponsorName;
  String? sponsorNameArabic;
  String? email;
  Null? profile;
  Null? address;
  Null? mobileNo;
  Null? bankName;
  Null? accountNumber;
  bool? isActive;
  Null? createdBy;
  Null? modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null? deletedAt;

  Sponsor(
      {this.id,
      this.sponsorName,
      this.sponsorNameArabic,
      this.email,
      this.profile,
      this.address,
      this.mobileNo,
      this.bankName,
      this.accountNumber,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  Sponsor.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sponsorName = json['sponsorName'];
    sponsorNameArabic = json['sponsorNameArabic'];
    email = json['email'];
    profile = json['profile'];
    address = json['address'];
    mobileNo = json['mobileNo'];
    bankName = json['bankName'];
    accountNumber = json['accountNumber'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['sponsorName'] = this.sponsorName;
    data['sponsorNameArabic'] = this.sponsorNameArabic;
    data['email'] = this.email;
    data['profile'] = this.profile;
    data['address'] = this.address;
    data['mobileNo'] = this.mobileNo;
    data['bankName'] = this.bankName;
    data['accountNumber'] = this.accountNumber;
    data['isActive'] = this.isActive;
    data['createdBy'] = this.createdBy;
    data['modifiedBy'] = this.modifiedBy;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['deletedAt'] = this.deletedAt;
    return data;
  }
}

class IoStatus {
  int? id;
  String? statusAdmin;
  String? statusInvest;
  String? statusPortfolio;
  bool? isActive;
  Null? createdBy;
  Null? modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null? deletedAt;

  IoStatus(
      {this.id,
      this.statusAdmin,
      this.statusInvest,
      this.statusPortfolio,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  IoStatus.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    statusAdmin = json['statusAdmin'];
    statusInvest = json['statusInvest'];
    statusPortfolio = json['statusPortfolio'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['statusAdmin'] = this.statusAdmin;
    data['statusInvest'] = this.statusInvest;
    data['statusPortfolio'] = this.statusPortfolio;
    data['isActive'] = this.isActive;
    data['createdBy'] = this.createdBy;
    data['modifiedBy'] = this.modifiedBy;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['deletedAt'] = this.deletedAt;
    return data;
  }
}

class InvestmentType {
  int? id;
  String? investmentTypeName;
  String? investmentTypeNameArabic;
  String? note;
  String? noteArabic;
  bool? isActive;
  Null? createdBy;
  Null? modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null? deletedAt;

  InvestmentType(
      {this.id,
      this.investmentTypeName,
      this.investmentTypeNameArabic,
      this.note,
      this.noteArabic,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  InvestmentType.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    investmentTypeName = json['investmentTypeName'];
    investmentTypeNameArabic = json['investmentTypeNameArabic'];
    note = json['note'];
    noteArabic = json['noteArabic'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['investmentTypeName'] = this.investmentTypeName;
    data['investmentTypeNameArabic'] = this.investmentTypeNameArabic;
    data['note'] = this.note;
    data['noteArabic'] = this.noteArabic;
    data['isActive'] = this.isActive;
    data['createdBy'] = this.createdBy;
    data['modifiedBy'] = this.modifiedBy;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['deletedAt'] = this.deletedAt;
    return data;
  }
}

class MinInvestmentAmt {
  int? id;
  int? ioXid;
  int? countryXid;
  String? minInvestmentAmt;
  String? maxInvestmentAmt;
  bool? isActive;
  Null? createdBy;
  Null? modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null? deletedAt;

  MinInvestmentAmt(
      {this.id,
      this.ioXid,
      this.countryXid,
      this.minInvestmentAmt,
      this.maxInvestmentAmt,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  MinInvestmentAmt.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ioXid = json['io_xid'];
    countryXid = json['country_xid'];
    minInvestmentAmt = json['minInvestmentAmt'];
    maxInvestmentAmt = json['maxInvestmentAmt'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['io_xid'] = this.ioXid;
    data['country_xid'] = this.countryXid;
    data['minInvestmentAmt'] = this.minInvestmentAmt;
    data['maxInvestmentAmt'] = this.maxInvestmentAmt;
    data['isActive'] = this.isActive;
    data['createdBy'] = this.createdBy;
    data['modifiedBy'] = this.modifiedBy;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['deletedAt'] = this.deletedAt;
    return data;
  }
}
