WooCoupon.fromJson constructor

WooCoupon.fromJson(
  1. Map<String, dynamic> json
)

Implementation

WooCoupon.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  code = json['code'];
  amount = json['amount'];
  dateCreated = json['date_created'];
  dateCreatedGmt = json['date_created_gmt'];
  dateModified = json['date_modified'];
  dateModifiedGmt = json['date_modified_gmt'];
  discountType = json['discount_type'];
  description = json['description'];
  dateExpires = json['date_expires'];
  dateExpiresGmt = json['date_expires_gmt'];
  usageCount = json['usage_count'];
  individualUse = json['individual_use'];
  productIds = json['product_ids'].cast<int>();
  excludedProductIds = json['excluded_product_ids'].cast<int>();
  usageLimit = json['usage_limit'];
  usageLimitPerUser = json['usage_limit_per_user'];
  limitUsageToXItems = json['limit_usage_to_x_items'];
  freeShipping = json['free_shipping'];
  productCategories = json['product_categories'].cast<int>();
  excludedProductCategories = json['excluded_product_categories'].cast<int>();
  excludeSaleItems = json['exclude_sale_items'];
  minimumAmount = json['minimum_amount'];
  maximumAmount = json['maximum_amount'];
  emailRestrictions = json['email_restrictions'].cast<String>();
  usedBy = json['used_by'].cast<String>();
  metaData = json['meta_data'].cast<String>();
  lLinks = json['_links'] != null
      ? new WooCouponLinks.fromJson(json['_links'])
      : null;
}