ReturnPolicy.fromJson constructor

ReturnPolicy.fromJson(
  1. Map json_
)

Implementation

ReturnPolicy.fromJson(core.Map json_)
    : this(
        country: json_.containsKey('country')
            ? json_['country'] as core.String
            : null,
        kind: json_.containsKey('kind') ? json_['kind'] as core.String : null,
        label:
            json_.containsKey('label') ? json_['label'] as core.String : null,
        name: json_.containsKey('name') ? json_['name'] as core.String : null,
        nonFreeReturnReasons: json_.containsKey('nonFreeReturnReasons')
            ? (json_['nonFreeReturnReasons'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        policy: json_.containsKey('policy')
            ? ReturnPolicyPolicy.fromJson(
                json_['policy'] as core.Map<core.String, core.dynamic>)
            : null,
        returnPolicyId: json_.containsKey('returnPolicyId')
            ? json_['returnPolicyId'] as core.String
            : null,
        returnShippingFee: json_.containsKey('returnShippingFee')
            ? Price.fromJson(json_['returnShippingFee']
                as core.Map<core.String, core.dynamic>)
            : null,
        seasonalOverrides: json_.containsKey('seasonalOverrides')
            ? (json_['seasonalOverrides'] as core.List)
                .map((value) => ReturnPolicySeasonalOverride.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
      );