class CounponModel {
  String provider;
  String good_id;

  ConvertArgs convertArgs;
  String coupon_endtime;
  String coupon_price;
  String coupon_url;

  String name;
  String desc;
  String moduleType;
  String moduleKey;
  String isTopMargin;
  String isLeftRightMargin;
  String isShow;
  String topMargin;
  String leftRightMargin;
  String topLeftRadius;
  String topRightRadius;
  String bottomLeftRadius;
  String bottomRightRadius;
  String bgColor;
  String couponText;
  String couponTextColor;
  String couponPriceColor;
  String couponTimeColor;
  String bgImage;

  CounponModel({
    this.good_id,
    this.provider,
    this.coupon_endtime,
    this.coupon_price,
    this.coupon_url,
    this.convertArgs,

    this.name,
    this.desc,
    this.moduleType,
    this.moduleKey,
    this.isTopMargin,
    this.isLeftRightMargin,
    this.isShow,
    this.topMargin,
    this.leftRightMargin,
    this.topLeftRadius,
    this.topRightRadius,
    this.bottomLeftRadius,
    this.bottomRightRadius,
    this.bgColor,
    this.couponText,
    this.couponTextColor,
    this.couponPriceColor,
    this.couponTimeColor,
    this.bgImage
  });

  CounponModel.fromJson(Map<String, dynamic> json) {
      good_id = json['good_id'];
      provider = json['provider'];
      coupon_endtime = json['coupon_endtime'];
      coupon_price = json['coupon_price'];
      coupon_url = json['coupon_url'];
      convertArgs = json['convert_args'] != null ? ConvertArgs.fromJson(json['convert_args']) : null;


      name = json['name'];
      desc = json['desc'];
      moduleType = json['module_type'];
      moduleKey = json['module_key'];
      isTopMargin = json['is_top_margin'];
      isLeftRightMargin = json['is_left_right_margin'];
      isShow = json['is_show'];
      topMargin = json['top_margin'];
      leftRightMargin = json['left_right_margin'];
      topLeftRadius = json['top_left_radius'];
      topRightRadius = json['top_right_radius'];
      bottomLeftRadius = json['bottom_left_radius'];
      bottomRightRadius = json['bottom_right_radius'];
      bgColor = json['bg_color'];
      couponText = json['coupon_text'];
      couponTextColor = json['coupon_text_color'];
      couponPriceColor = json['coupon_price_color'];
      couponTimeColor = json['coupon_time_color'];
      bgImage = json['bg_image'];


  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['coupon_endtime'] = this.coupon_endtime;
    data['coupon_price'] = this.coupon_price;
    data['coupon_url'] = this.coupon_url;
    data['provider'] = this.provider;
    data['good_id'] = this.good_id;
    if (this.convertArgs != null) {
      data['convert_args'] = this.convertArgs.toJson();
    }

    data['name'] = this.name;
    data['desc'] = this.desc;
    data['module_type'] = this.moduleType;
    data['module_key'] = this.moduleKey;
    data['is_top_margin'] = this.isTopMargin;
    data['is_left_right_margin'] = this.isLeftRightMargin;
    data['is_show'] = this.isShow;
    data['top_margin'] = this.topMargin;
    data['left_right_margin'] = this.leftRightMargin;
    data['top_left_radius'] = this.topLeftRadius;
    data['top_right_radius'] = this.topRightRadius;
    data['bottom_left_radius'] = this.bottomLeftRadius;
    data['bottom_right_radius'] = this.bottomRightRadius;
    data['bg_color'] = this.bgColor;
    data['coupon_text'] = this.couponText;
    data['coupon_text_color'] = this.couponTextColor;
    data['coupon_price_color'] = this.couponPriceColor;
    data['coupon_time_color'] = this.couponTimeColor;
    data['bg_image'] = this.bgImage;


    return data;
  }
}

class ConvertArgs {
  String gid;
  String goodUrl;
  String couponUrl;
  String couponPrice;
  String activityUrl;
  String isShare;
  String commission;

  ConvertArgs({this.gid, this.goodUrl, this.couponUrl, this.couponPrice, this.activityUrl, this.isShare, this.commission});

  ConvertArgs.fromJson(Map<String, dynamic> json) {
    gid = json['gid'];
    goodUrl = json['good_url'];
    couponUrl = json['coupon_url'];
    couponPrice = json['coupon_price'];
    activityUrl = json['activity_url'];
    isShare = json['is_share'];
    commission = json['commission'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['gid'] = this.gid;
    data['good_url'] = this.goodUrl;
    data['coupon_url'] = this.couponUrl;
    data['coupon_price'] = this.couponPrice;
    data['activity_url'] = this.activityUrl;
    data['is_share'] = this.isShare;
    data['commission'] = this.commission;
    return data;
  }
}
