class TamaraInstallmentDetails {
  String? name;
  String? description;
  MinLimit? minLimit;
  MinLimit? maxLimit;
  List<SupportedInstalments>? supportedInstalments;

  TamaraInstallmentDetails({this.name, this.description, this.minLimit, this.maxLimit, this.supportedInstalments});

  TamaraInstallmentDetails.fromJson(Map<dynamic, dynamic> json) {
    name = json['name'];
    description = json['description'];
    minLimit = json['minLimit'] != null ? new MinLimit.fromJson(json['minLimit']) : null;
    maxLimit = json['maxLimit'] != null ? new MinLimit.fromJson(json['maxLimit']) : null;
    if (json['supportedInstalments'] != null) {
      supportedInstalments = <SupportedInstalments>[];
      json['supportedInstalments'].forEach((v) {
        supportedInstalments!.add(new SupportedInstalments.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['description'] = this.description;
    if (this.minLimit != null) {
      data['minLimit'] = this.minLimit!.toJson();
    }
    if (this.maxLimit != null) {
      data['maxLimit'] = this.maxLimit!.toJson();
    }
    if (this.supportedInstalments != null) {
      data['supportedInstalments'] = this.supportedInstalments!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class MinLimit {
  String? currency;
  int? amount;

  MinLimit({this.currency, this.amount});

  MinLimit.fromJson(Map<String, dynamic> json) {
    currency = json['currency'];
    amount = json['amount'];
  }

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

class SupportedInstalments {
  int? instalments;
  MinLimit? minLimit;
  MinLimit? maxLimit;

  SupportedInstalments({this.instalments, this.minLimit, this.maxLimit});

  SupportedInstalments.fromJson(Map<String, dynamic> json) {
    instalments = json['instalments'];
    minLimit = json['minLimit'] != null ? new MinLimit.fromJson(json['minLimit']) : null;
    maxLimit = json['maxLimit'] != null ? new MinLimit.fromJson(json['maxLimit']) : null;
  }

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