SubscriptionOffer.fromJson constructor

SubscriptionOffer.fromJson(
  1. Map json_
)

Implementation

SubscriptionOffer.fromJson(core.Map json_)
    : this(
        basePlanId: json_.containsKey('basePlanId')
            ? json_['basePlanId'] as core.String
            : null,
        offerId: json_.containsKey('offerId')
            ? json_['offerId'] as core.String
            : null,
        offerTags: json_.containsKey('offerTags')
            ? (json_['offerTags'] as core.List)
                .map((value) => OfferTag.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        otherRegionsConfig: json_.containsKey('otherRegionsConfig')
            ? OtherRegionsSubscriptionOfferConfig.fromJson(
                json_['otherRegionsConfig']
                    as core.Map<core.String, core.dynamic>)
            : null,
        packageName: json_.containsKey('packageName')
            ? json_['packageName'] as core.String
            : null,
        phases: json_.containsKey('phases')
            ? (json_['phases'] as core.List)
                .map((value) => SubscriptionOfferPhase.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        productId: json_.containsKey('productId')
            ? json_['productId'] as core.String
            : null,
        regionalConfigs: json_.containsKey('regionalConfigs')
            ? (json_['regionalConfigs'] as core.List)
                .map((value) => RegionalSubscriptionOfferConfig.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        state:
            json_.containsKey('state') ? json_['state'] as core.String : null,
        targeting: json_.containsKey('targeting')
            ? SubscriptionOfferTargeting.fromJson(
                json_['targeting'] as core.Map<core.String, core.dynamic>)
            : null,
      );