class HotRankingListModel {
  List<String> hotRankIconList;
  String topMargin;
  String leftRighMargin;
  List<Providers> providers;
  String titleColor;
  String currentPriceColor;
  String marketPriceColor;
  String shopNameColor;
  String saleCountColor;
  String shopIcon;
  CouponCommission couponCommission;
  HotRank hotRank;

  HotRankingListModel(
      {this.hotRankIconList,
        this.topMargin,
        this.leftRighMargin,
        this.providers,
        this.titleColor,
        this.currentPriceColor,
        this.marketPriceColor,
        this.shopNameColor,
        this.saleCountColor,
        this.shopIcon,
        this.couponCommission,
        this.hotRank});

  HotRankingListModel.fromJson(Map<String, dynamic> json) {
    hotRankIconList = json['hot_rank_icon_list'].cast<String>();
    topMargin = json['top_margin'];
    leftRighMargin = json['left_righ_margin'];
    if (json['providers'] != null) {
      providers = new List<Providers>();
      json['providers'].forEach((v) {
        providers.add(new Providers.fromJson(v));
      });
    }
    titleColor = json['title_color'];
    currentPriceColor = json['current_price_color'];
    marketPriceColor = json['market_price_color'];
    shopNameColor = json['shop_name_color'];
    saleCountColor = json['sale_count_color'];
    shopIcon = json['shop_icon'];
    couponCommission = json['coupon_commission'] != null
        ? new CouponCommission.fromJson(json['coupon_commission'])
        : null;
    hotRank = json['hot_rank'] != null
        ? new HotRank.fromJson(json['hot_rank'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['hot_rank_icon_list'] = this.hotRankIconList;
    data['top_margin'] = this.topMargin;
    data['left_righ_margin'] = this.leftRighMargin;
    if (this.providers != null) {
      data['providers'] = this.providers.map((v) => v.toJson()).toList();
    }
    data['title_color'] = this.titleColor;
    data['current_price_color'] = this.currentPriceColor;
    data['market_price_color'] = this.marketPriceColor;
    data['shop_name_color'] = this.shopNameColor;
    data['sale_count_color'] = this.saleCountColor;
    data['shop_icon'] = this.shopIcon;
    if (this.couponCommission != null) {
      data['coupon_commission'] = this.couponCommission.toJson();
    }
    if (this.hotRank != null) {
      data['hot_rank'] = this.hotRank.toJson();
    }
    return data;
  }
}

class Providers {
  String type;
  String providerNameColor;
  String providerBgColor;

  Providers({this.type, this.providerNameColor, this.providerBgColor});

  Providers.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    providerNameColor = json['provider_name_color'];
    providerBgColor = json['provider_bg_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['provider_name_color'] = this.providerNameColor;
    data['provider_bg_color'] = this.providerBgColor;
    return data;
  }
}

class CouponCommission {
  Left left;
  Right right;

  CouponCommission({this.left, this.right});

  CouponCommission.fromJson(Map<String, dynamic> json) {
    left = json['left'] != null ? new Left.fromJson(json['left']) : null;
    right = json['right'] != null ? new Right.fromJson(json['right']) : null;
  }

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

class Left {
  String couonText;
  String couponFontColor;
  String couponBgColor;
  String couponBgImg;

  Left(
      {this.couonText,
        this.couponFontColor,
        this.couponBgColor,
        this.couponBgImg});

  Left.fromJson(Map<String, dynamic> json) {
    couonText = json['couon_text'];
    couponFontColor = json['coupon_font_color'];
    couponBgColor = json['coupon_bg_color'];
    couponBgImg = json['coupon_bg_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['couon_text'] = this.couonText;
    data['coupon_font_color'] = this.couponFontColor;
    data['coupon_bg_color'] = this.couponBgColor;
    data['coupon_bg_img'] = this.couponBgImg;
    return data;
  }
}

class Right {
  String commissionText;
  String commissionFontColor;
  String commissionBgColor;
  String commissionBgImg;

  Right(
      {this.commissionText,
        this.commissionFontColor,
        this.commissionBgColor,
        this.commissionBgImg});

  Right.fromJson(Map<String, dynamic> json) {
    commissionText = json['commission_text'];
    commissionFontColor = json['commission_font_color'];
    commissionBgColor = json['commission_bg_color'];
    commissionBgImg = json['commission_bg_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['commission_text'] = this.commissionText;
    data['commission_font_color'] = this.commissionFontColor;
    data['commission_bg_color'] = this.commissionBgColor;
    data['commission_bg_img'] = this.commissionBgImg;
    return data;
  }
}

class HotRank {
  String isOpen;
  String bgColor;
  String fontColor;
  String hotSaleImg;
  String buyNowImg;

  HotRank(
      {this.isOpen,
        this.bgColor,
        this.fontColor,
        this.hotSaleImg,
        this.buyNowImg});

  HotRank.fromJson(Map<String, dynamic> json) {
    isOpen = json['is_open'];
    bgColor = json['bg_color'];
    fontColor = json['font_color'];
    hotSaleImg = json['hot_sale_img'];
    buyNowImg = json['buy_now_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['is_open'] = this.isOpen;
    data['bg_color'] = this.bgColor;
    data['font_color'] = this.fontColor;
    data['hot_sale_img'] = this.hotSaleImg;
    data['buy_now_img'] = this.buyNowImg;
    return data;
  }
}
