ConfigurationSubscriptionUpdate.fromJson constructor

ConfigurationSubscriptionUpdate.fromJson(
  1. Object? json
)

Implementation

factory ConfigurationSubscriptionUpdate.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return ConfigurationSubscriptionUpdate(
    defaultAllowedUpdates: map['default_allowed_updates'] == null
        ? null
        : (map['default_allowed_updates'] as List<Object?>)
            .map((el) =>
                PortalSubscriptionUpdateDefaultAllowedUpdatesItem.fromJson(
                    el))
            .toList(),
    enabled: (map['enabled'] as bool),
    products: map['products'] == null
        ? null
        : (map['products'] as List<Object?>)
            .map((el) => PortalSubscriptionUpdateProduct.fromJson(el))
            .toList(),
    prorationBehavior: map['proration_behavior'] == null
        ? null
        : PortalSubscriptionCancelProrationBehavior.fromJson(
            map['proration_behavior']),
  );
}