Promotion.fromJson constructor

Promotion.fromJson(
  1. Map json_
)

Implementation

Promotion.fromJson(core.Map json_)
    : this(
        brand: json_.containsKey('brand')
            ? (json_['brand'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        brandExclusion: json_.containsKey('brandExclusion')
            ? (json_['brandExclusion'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        contentLanguage: json_.containsKey('contentLanguage')
            ? json_['contentLanguage'] as core.String
            : null,
        couponValueType: json_.containsKey('couponValueType')
            ? json_['couponValueType'] as core.String
            : null,
        freeGiftDescription: json_.containsKey('freeGiftDescription')
            ? json_['freeGiftDescription'] as core.String
            : null,
        freeGiftItemId: json_.containsKey('freeGiftItemId')
            ? json_['freeGiftItemId'] as core.String
            : null,
        freeGiftValue: json_.containsKey('freeGiftValue')
            ? PriceAmount.fromJson(
                json_['freeGiftValue'] as core.Map<core.String, core.dynamic>)
            : null,
        genericRedemptionCode: json_.containsKey('genericRedemptionCode')
            ? json_['genericRedemptionCode'] as core.String
            : null,
        getThisQuantityDiscounted:
            json_.containsKey('getThisQuantityDiscounted')
                ? json_['getThisQuantityDiscounted'] as core.int
                : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        itemGroupId: json_.containsKey('itemGroupId')
            ? (json_['itemGroupId'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        itemGroupIdExclusion: json_.containsKey('itemGroupIdExclusion')
            ? (json_['itemGroupIdExclusion'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        itemId: json_.containsKey('itemId')
            ? (json_['itemId'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        itemIdExclusion: json_.containsKey('itemIdExclusion')
            ? (json_['itemIdExclusion'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        limitQuantity: json_.containsKey('limitQuantity')
            ? json_['limitQuantity'] as core.int
            : null,
        limitValue: json_.containsKey('limitValue')
            ? PriceAmount.fromJson(
                json_['limitValue'] as core.Map<core.String, core.dynamic>)
            : null,
        longTitle: json_.containsKey('longTitle')
            ? json_['longTitle'] as core.String
            : null,
        minimumPurchaseAmount: json_.containsKey('minimumPurchaseAmount')
            ? PriceAmount.fromJson(json_['minimumPurchaseAmount']
                as core.Map<core.String, core.dynamic>)
            : null,
        minimumPurchaseQuantity: json_.containsKey('minimumPurchaseQuantity')
            ? json_['minimumPurchaseQuantity'] as core.int
            : null,
        moneyBudget: json_.containsKey('moneyBudget')
            ? PriceAmount.fromJson(
                json_['moneyBudget'] as core.Map<core.String, core.dynamic>)
            : null,
        moneyOffAmount: json_.containsKey('moneyOffAmount')
            ? PriceAmount.fromJson(json_['moneyOffAmount']
                as core.Map<core.String, core.dynamic>)
            : null,
        offerType: json_.containsKey('offerType')
            ? json_['offerType'] as core.String
            : null,
        orderLimit: json_.containsKey('orderLimit')
            ? json_['orderLimit'] as core.int
            : null,
        percentOff: json_.containsKey('percentOff')
            ? json_['percentOff'] as core.int
            : null,
        productApplicability: json_.containsKey('productApplicability')
            ? json_['productApplicability'] as core.String
            : null,
        productType: json_.containsKey('productType')
            ? (json_['productType'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        productTypeExclusion: json_.containsKey('productTypeExclusion')
            ? (json_['productTypeExclusion'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        promotionDestinationIds: json_.containsKey('promotionDestinationIds')
            ? (json_['promotionDestinationIds'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        promotionDisplayDates: json_.containsKey('promotionDisplayDates')
            ? json_['promotionDisplayDates'] as core.String
            : null,
        promotionDisplayTimePeriod:
            json_.containsKey('promotionDisplayTimePeriod')
                ? TimePeriod.fromJson(json_['promotionDisplayTimePeriod']
                    as core.Map<core.String, core.dynamic>)
                : null,
        promotionEffectiveDates: json_.containsKey('promotionEffectiveDates')
            ? json_['promotionEffectiveDates'] as core.String
            : null,
        promotionEffectiveTimePeriod:
            json_.containsKey('promotionEffectiveTimePeriod')
                ? TimePeriod.fromJson(json_['promotionEffectiveTimePeriod']
                    as core.Map<core.String, core.dynamic>)
                : null,
        promotionId: json_.containsKey('promotionId')
            ? json_['promotionId'] as core.String
            : null,
        promotionStatus: json_.containsKey('promotionStatus')
            ? PromotionPromotionStatus.fromJson(json_['promotionStatus']
                as core.Map<core.String, core.dynamic>)
            : null,
        promotionUrl: json_.containsKey('promotionUrl')
            ? json_['promotionUrl'] as core.String
            : null,
        redemptionChannel: json_.containsKey('redemptionChannel')
            ? (json_['redemptionChannel'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        shippingServiceNames: json_.containsKey('shippingServiceNames')
            ? (json_['shippingServiceNames'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        storeApplicability: json_.containsKey('storeApplicability')
            ? json_['storeApplicability'] as core.String
            : null,
        storeCode: json_.containsKey('storeCode')
            ? (json_['storeCode'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        storeCodeExclusion: json_.containsKey('storeCodeExclusion')
            ? (json_['storeCodeExclusion'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        targetCountry: json_.containsKey('targetCountry')
            ? json_['targetCountry'] as core.String
            : null,
      );