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