Create.fromJson constructor

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

Implementation

factory Create.fromJson(Map<String, dynamic> json) => Create(
      id: json["id"],
      code: json["code"],
      amount: json["amount"],
      dateCreated: DateTime.parse(json["date_created"]),
      dateCreatedGmt: DateTime.parse(json["date_created_gmt"]),
      dateModified: DateTime.parse(json["date_modified"]),
      dateModifiedGmt: DateTime.parse(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: List<dynamic>.from(json["product_ids"].map((x) => x)),
      excludedProductIds:
          List<dynamic>.from(json["excluded_product_ids"].map((x) => x)),
      usageLimit: json["usage_limit"],
      usageLimitPerUser: json["usage_limit_per_user"],
      limitUsageToXItems: json["limit_usage_to_x_items"],
      freeShipping: json["free_shipping"],
      productCategories:
          List<dynamic>.from(json["product_categories"].map((x) => x)),
      excludedProductCategories: List<dynamic>.from(
          json["excluded_product_categories"].map((x) => x)),
      excludeSaleItems: json["exclude_sale_items"],
      minimumAmount: json["minimum_amount"],
      maximumAmount: json["maximum_amount"],
      emailRestrictions:
          List<dynamic>.from(json["email_restrictions"].map((x) => x)),
      usedBy: List<dynamic>.from(json["used_by"].map((x) => x)),
      metaData: List<dynamic>.from(json["meta_data"].map((x) => x)),
      links: Links.fromJson(json["_links"]),
    );